Previous Posts:
Epidode 1: Forget Me Not: Application
Episode 2: Forget Me Not: The Best Laid Plans ...
Episode 3: Forget Me Not: Setup EnOcean with openHAB
Episode 4: Forget Me Not: Medication System
In my last post I discussed setting up the rules for my Medication Reminder System. The system issues a voice command to "Take Medication" when the user tries to leave the home before taking the medication. I wanted to implement a notification on my Android device using the HABDroid app, but I haven't seen how you can create a notification through it. Instead I signed up for a free account at NotifyMyAndroid. This service gives you 5 free notifications a day through an API Key. To use the system simply:
1. Sign up for the account at https://www.notifymyandroid.com/.
2. Login and generate a new API key (Under manage API keys). The key will be large: 4efe210645733a3c20e62c1b8ca7028bca1f53f64fc9510a
This key is not valid, I made it up.
3. Install the notify my android app: https://play.google.com/store/apps/details?id=com.usk.app.notifymyandroid
4. Login to your account from the app.
In your openHab rules when you want the notification simply insert:
notifyMyAndroid("4efe210645733a3c20e62c1b8ca7028bca1f53f64fc9510a
", "Medication", "Take Medication")
In my system I have:
rule "Remind Me While I am Leaving" when Item EnOcean_sensor_CONTACT2 changed from CLOSED to OPEN then var Number hour = now.getHourOfDay if ( (Rocker1A.state == OFF) && (hour > 4) ) { //Rocker1B.setState(ON) say("Take Medication") notifyMyAndroid("4efe210645733a3c20e62c1b8ca7028bca1f53f64fc9510a", "Medication", "Take your medication.") } end
If I try to leave my Raspberry Pi says "Take Medication" and I get a notification on my phone to take my medication.