Created
October 4, 2015 22:40
-
-
Save audiefile/a9b89a71505b13b513cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Setup IFTTT Account | |
You need to create an account and connect to the Maker channel and the notification channel | |
of your choice. I use pushover as I already had the app and it allows me more control | |
over the notification on my phone. | |
Create an IF recipe | |
The trigger is the maker channel. You can customize the notification message if you wish. | |
Get the event trigger | |
On the Maker channel there is a "how to trigger" link. Copy and paste the curl command into | |
status-check.sh (Be sure to change the event name field) | |
Script assumptions: your openaps instance is located at ~/openaps-dev and openaps knows your pump as 'pump' | |
Script | |
#!/bin/bash | |
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
cd ~/openaps-dev | |
empty="" | |
# check carelink is working - if not send notification | |
python -m decocare.stick $(python -m decocare.scan) >/dev/null || curl -X POST https://maker.ifttt.com/trigger/{event}/with/key/MyKey | |
echo "Carelink Stick OK" | |
# check carelink can talk to pump - if not send notification | |
model=$(openaps use pump model) | |
echo "Model: " $model | |
if [ $model=$empty ]; | |
then | |
echo "Model is empty" | |
curl -X POST https://maker.ifttt.com/trigger/{event}/with/key/MyKey | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment