Table of Contents
In addition to Nightscout's web-based alarms, your site can also trigger push notifications (or other actions) through the IFTTT Maker service. With Maker you are able to integrate with all the other IFTTT Services. For example, you can send a tweet when there is an alarm, change the color of a smart light, send an email, send a text, and much more.
Note: There have been some recent reports of the IFTTT service delaying Nightscout alarms. Be sure to test your implementation before relying solely on its alerts. Pushover is an alternate push notification service that might be worth considering as well.
Plugins can create custom events, but all events sent to Maker will be prefixed with ns-
. The core events are:
ns-event
- This event is sent on all alarms and notifications. This is good catch-all event for general logging.ns-allclear
- This event is sent when an alarm has been acknowledged or when the server starts up without triggering any alarms. (For example, you could use this event to turn a light to green.)ns-info
- All notifications at theinfo
level will cause this event to be triggered.ns-warning
- All notifications at thewarning
level will cause this event to be triggered.ns-urgent
- All notifications at theurgent
level will cause this event to be triggered.ns-warning-high
- This event is triggered when crossing theBG_TARGET_TOP
threshold.ns-urgent-high
- This event is triggered when crossing theBG_HIGH
threshold.ns-warning-low
- This event is triggered when crossing theBG_TARGET_BOTTOM
threshold.ns-urgent-low
- This event is triggered when crossing theBG_LOW
threshold.ns-info-treatmentnotify
- This event is triggered when a treatment is entered into thecareportal
.ns-warning-bwp
- This event is triggered when thebwp
plugin generates a warning alarm.ns-urgent-bwp
- This event is triggered when thebwp
plugin generates an urgent alarm.
Set up an IFTTT account, and log into it.
On the "My Applets" page, click "New Applet", then click the blue +this
. Search for "webhooks" among the services, and click it.
Click on the "Receive a web request" box.
Enter one of the Nightscout events listed above (like ns-urgent-low
), and click "Create Trigger".
Click on the blue +that
.
Search for the action you'd like this event to trigger. In this example, we'll choose the Notifications
action to send a push notification.
Choose the "Send a notification from the IFTTT app" action type for a basic push alert. You can experiment with the "rich" notifications later.
Enter the message that will display in this push notification. In this example, it was triggered on an ns-urgent-low
, so we'll write something like "Urgent Low!". We can also display the current BG by including the Value2
ingredient (via the "Add ingredient" button).
Click the "Create action" button when you're done.
Click the "Finish" button if your applet looks good.
Click on "My Applets" in the main menu, then click the "Services" tab, then search for "Webhooks" and select it.
Go to the Settings
for this service, in the upper right.
The string of characters at the end of the URL here is your MAKER_KEY
. Copy it from there, so we can paste it into your Config Vars.
From your Heroku dashboard, go to your app's Settings page, then click the "Reveal Config Vars" button. Find the MAKER_KEY
entry, and edit its value, pasting in your Maker Key. If you don't already have a MAKER_KEY
line, add it to the bottom of the list.
Find your ENABLE
line, and add maker
to the list of enabled plugins.
That's all of the services complete. In order to receive push notifications on a mobile device, you'll need to have the IFTTT app installed and logged into the same account you set up the actions in.
To add more alerts for different events, just create a new applet for each trigger.