PUSH NOTIFICATIONS FOR AUTOMATION
So you've found a gadget you really like, it works with its own App but you want to use it to trigger Automation in your Smart Home system.
You can't right?
If like most Smart Homes you have an always on Android device, whether its an Android Tablet, an old phone or and Android Box you can use "Notification Listener" and "Tasker" Apps to bridge your devices.
In our example we'll use Homeseer as the Automation controller the command is being sent to, but the same can be done for many controllers and cloud services including Vera, Domoticz and IFTTT using their "Webhooks" service, formally "Maker" channel.
NOTIFICATION LISTENER & TASKER
So the first thing you need to do is install Notification Listener App your android device.
The other App you will need for this is Tasker, if you don't already have Tasker in your life you need it anyway! Trust us, you will thank us later.
Next we open the Notification Listener and grant it permissions.
We then open Tasker and do the same, now we are ready to create!
CREATING THE PROFILE
The first thing we do in Tasker is to create a Profile, this is how we define what triggers actions to happen.
So with "Profiles" selected at the top of the screen, we press the + in the bottom right to create a new profile.
From the list that appears we need to select "Event"
We are then offered a list of possible triggers for the event, select "Plugin" and then "Notification Listener".
We now have a screen with the option to "Configure", press the pencil icon to open the configurations.
On the configuration we are able to select which App we are listening for a Notification from. In my example I am using "tosee" App.
Press the icon on the right of the Apps line, this brings up a list of all the Apps on the device.
Once you find the correct App you want to trigger the action, press the Tick in the top right.
This takes you back to the Event Edit page.
You can now go back by pressing the back button on the top right.
CREATING THE TASK
This is where you will need to have the details of the Calls accepted by your device, this is normally published on the Manufacturers Support pages or the associated forum.
If your device does not have a local API but it does have IFTTT functions, you can use IFTTT's Webhooks. Simply press the Documentation button on the webhooks page to get the HTTP command and key for your IFTTT profile.
In my example I am using the Homeseer IP address:port and JSON with the details of the device and function.
So when prompted following the steps above, you will be able to create a new Task or get to choose one of your existing ones if you have any.
You start with choosing the name of the task, then once into the task screen click the + once again to create a new action.
For both IFTTT Webhooks and our Homeseer controller we select "Net" then "HTTP Get"
Line 1 is our Server:Port
For my example I use the internal IP address for my Homeseer gateway.
The Second line contains the request. E.g.
For IFTTT we would use https://maker.ifttt.com as the server:port
For the second line we use;
That's it. Now whenever your selected app creates a Push Notification on the Android device, Notification Listener will tell tasker to run the task, the task will trigger your Home Automation Gateway or IFTTT Webhook and allow you to integrate all sorts of things you never knew you could integrate before.
WHAT CAN I USE IT FOR?
Really its down to your imagination.
In my example above I use it to trigger a Virtual Device in my Homeseer Gateway when my Tablet receives a notification from my Doorbell.
I then use this to trigger lights and other actions dependant on time of day and other features.
Basically you could use any device or service which reports back to your device via notification and use it to trigger functions on your phone, IFTTT or Home Controller.
A note to add, the same technique can be used to run a script from some CCTV cameras or recorders on motion alerts etc
This can be a cheap and simple way to add Smarts to older equipment.
If you have any question or want us to write a guide relating to something else just drop us an email on firstname.lastname@example.org