OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) How To: Push notifications for OpenSprinkler Reply To: How To: Push notifications for OpenSprinkler

#39096

nystrom
Participant

I was able to modify the code so that I can use IFTTT Maker channel for notifications. Also, I have it working on OSBo.

Here is what I added to ospi_push_notifications.py:


# Setup variables from config file
....
iftttEventName = config["push"]["ifttt"]["eventName"]
iftttUserKey = config["push"]["ifttt"]["userKey"]
....
# Send Push Notification
....
        elif (pushService == "ifttt"):
                url = "https://maker.ifttt.com/trigger/" + iftttEventName + "/with/key/" + iftttUserKey
                payload = {'value1': event }
                #print url
                #print payload
                ret = requests.post(url, data = payload)
                syslog.syslog("Notification sent to %s. Message: %s. Return message %s" % (pushService,event,ret))
                #print ret

.....

And I added this to the config.yaml file:


push:
  service: "ifttt" # Acceptable options are "instapush" or "pushover" or "ifttt"
......
  ifttt:
    eventName: "YOUR_IFTTT_EVENT_NAME"
    userKey: "YOUR_IFTTT_USER_KEY"
We are currently away till Monday July 21. Orders placed during this time will be shipped on Tuesday July 22. Thank you for your understanding!
This is default text for notification bar