Android Push Notification for HomeGenie ======================================= When a significant event occurs in HomeGenie, I wanted to be alerted as quickly as possible and with a repeating alarm on my Android device(s) so that I had a better chance of not missing the alert. Includes 3 parts: 1. Android_Push_Notification_Service - HomeGenie C# app 2. Android AlarmMe.apk - Android 4.0 (and above) app 3. Android Push Notification manual (this document) Because there are 2 inter-related parts to this service, I recommend reading and understanding the entire procedure before installing. I've tested this and it works reliably for me on an HTC Android 4.0.3 phone and a Samsung Android 4.1.2 tablet. No warranty expressed or implied - use at your own risk. Support not guaranteed but feel free to ask. Comments & improvement suggestions welcome. AlarmMe.apk =========== AlarmMe! receives Android Push Notifications and alerts the user. An active internet connection is required to receive the notification. If you configure your Android device to disable the internet connection while the device is sleeping, you will not receive the notification until the internet connection is restored. The user can configure AlarmMe! to vibrate once (Quiet Notification) when the notification is received, or to play the standard notification tone (Play Notification Tone) once, or to play a repeating alarm (Alarm On) with the user's choice of ringtone. For repeating alarms, the user can select how long the alarm plays for, the number of repeats of the alarm, and the interval between repeating alarms. If you have the Alarm On, when the notification comes in, you'll be presented with a alert dialog showing the alert while the alarm is playing - use the Dismiss button to get rid of the alert. If the alarm is not dismissed, the device can go back to sleep until the it needs to alarm again. The notification icon is shown in the status bar; selecting it will bring up the AlarmMe! app, or you can swipe it away. Permissions: ------------ Network Communcication - internet connection to register with Google servers and to receive notification from HG via Google. System Tools - to prevent the tablet from sleeping when it's woken up to play the alarm. Once the alarm is done playing, the wakelock is released and the device can go back to sleep. Your Accounts - probably for Google to figure out who you are. Development Tools - storage - ringtone access Hardware Controls - vibrate - for vibrate alert Installation, Setup, Test: -------------------------- Side load this .apk onto your Android 4.0 (and above) device. Once installed, open the app. If the app is successful retrieving a registration ID, the first few characters of the ID will be displayed. An internet connection is required to register with the Google servers and get the ID. Select the "Copy RegID to Clipboard" button. This RegID is unique to each and every Android device - it's basically the address of the Android device to which the notification is sent. Fire up HomeGenie in your browser. Go to "Configure", then "Automation", then to the group that you imported Android_Push_Notification_Service into (see below). Copy and paste the RegID into the Device Registration ID input field of the HomeGenie Android_Push_Notification_Service app. There are 2 RegID fields allowing up to 2 separate Android devices that will simultaneously receive the notification (easily expandable beyond 2 devices - look into the C# code). Android_Push_Notification_Service: ================================== Import this .hgx C# app into HomeGenie. I put mine in: HomeGenie/Configure/Automation/Messaging and Social. Configure input fields as described below. The registration ID (retrieved from the Android AlarmMe! app is required (see above). Optionally, configure and install a switch widget into your control panel - this will allow you to test the push notification by pressing the "on" button. Alternatively, you can test using the following URL: http:///api/APNRequest/test Input Fields: ------------- 1. Notification Message - the message that is included in the notification to the Android device(s). 2. Minimum Interval between sent notifications (in seconds) - minimum number of seconds betweeen notifications to avoid flooding your Android device(s). 3. Send Notification when Security System is triggered - integrated with the Security Alarm System to send a notification when the alarm is triggered 4. Testing: HG message only - no notification sent when True - set to true if you are testing and do not want notifications to be sent. HG will display when sent. 5. Device 1 Registration ID - Registration ID copied from Android AlarmMe! app for first Android device 6. Device 2 Registration ID - Registration ID copied from Android AlarmMe! app for second Android device (if required) Add Feature: ------------ Android_Push_Notification_Service adds the "Send Android Notification" feature to sensors. Adding this feature will result in a notification being sent when the sensor is activated.