It’s important to replace <maker-key> with your maker channel key and <eventname> with your recipe event name.
import os, sys
import RPi.GPIO as GPIO
from datetime import datetime
req = requests.post("http://maker.ifttt.com/trigger/<eventname>/with/key/<maker-key>", data=payload)
if(now!=past and start==0):
If we’re executing the code through SSH we need to execute the code in background. To do that you can use screen. Remeber giving execution access to the file.
chmod +x program.py
python program.py &
Then we need to set up the IFTTT recipe:
With IFTTT we could use other recipes such as making a log with the Google Spreadsheet channel or a Evernote Log.
With this setup we could attach to the GPIO pin a digital sensor and monitor it in our smartphone. If we attach a switch we are doing a physical DO recipe.