Create a home automation dashboard on your Android home screen using AutoRemote, Tasker and KLWP
This tutorial builds on previous tutorials like sending information from Homey to your smartphone using KLWP. At least read them before diving into this one. This tutorial is just a showcase of what’s possible with Homey, Tasker, AutoRemote and KLWP and not a tutorial on how to create a completely featured dashboard. I’ll leave that up to your own creativity. The tutorial will also not go into every detail on every tool used. There is a lot of information on how to use these tools on the internet. I’ll link to some information but do also use Google.
Here is a short video on what can be achieved with this tutorial. It’s a small dashboard that will show user presence, the surveillance mode and alarm state from the Heimdall app and the lock status of a Nuki lock, inside temperature, solar generation, energie usage and gas usage. I’ll only be focusing on Heimdall surveillance and energie generation for the sake of this tutorial.
Prerequisites
- A working Homey
- The HTTP app installed on Homey
- An Android smartphone with Tasker installed
- An app called AutoRemote (paid app which is a part of the incredibable AutoApps suite) installed which enables an extra plugin in Tasker
- An app called KLWP installed which is free with ads or paid adfree and which also enables an extra plugin in Tasker)
Install and setup AutoRemote
AutoRemote enables you to send message and notification to your smartphone from external sources. Install it from the Play Store and have a look here to send your first test message to confirm the app has been set up correctly and your smartphone can receive the external message. After visiting your personal URL (which can be found on the homepage of the AutoRemote app) all you need to do is enter a message and click the send button. Check the log in the AutoRemote app to confirm your message has been received.
Install and setup KLWP
KLWP uses an awesome WYSIWYG editor to create live wallpapers with pretty much any information you like. If you are completely new to KLWP first start with watching the videos from the beginners series from this website. Keep watching the videos until you understand how KLWP works and you are capable of making changes to your own live wallpaper.
Push or pull strategy
When adding data to your live wallpaper from Homey you can choose for a push or pull strategy. Which is best depends on the data you want to show. Let me explain.
Push from Homey to your smartphone
If data does not change very often (like the presence of a user) it’s best to push changes from Homey to your smartphone when it happens. This way you receive a change immediately and limit the amount of traffic. You can achieve a push mechanisme by using actions cards with GET requests (HTTP app) on Homey which send messages to the AutoRemote server on your phone. You can then use Tasker on your phone to update variables in KLWP which in it’s turn show it on your home screen dashboard.
Pull from Homey to your smartphone
If data changes very often but you do not need to know every change but just want to update the value on a time based interval (like the daily generation or usage of energy) it’s best to use a pull strategy. Sending every change would be bad for performance and it’s best to just ask Homey the latest value on a time based interval. You need to create a flow in Homey with a GET trigger card (HTTP app) that returns the value from a tag or a Bettter Logic variable or something. KLWP can be configured to send the GET request to Homey and parse the result to show on your home screen dashboard.
Show Heimdall surveillance
This is about showing Heimdall surveillance but the concept can be used for any data that does not change very often and can be pushed to your smartphone from Homey.
- Create a flow in Homey (or use an existing flow) that is triggered when Heimdall’s surveillance mode is changed. Add a HTTP GET action card and use it to send a request to your personalized AutoRemote service. You can create the correct URL on the personalized test page which you can access from the AutoRemote app on your phone. In the message to send you can add a parameter which you can filter out on your phone. My messages look like this: armed=:=surveillance heimdall and disarmed=:=surveillance heimdall. I use the word Heimdall to filter out the message and the word surveillance as parameter to set and use in Tasker and KLWP.
- Create a profile in Tasker. Choose AutoRemote as trigger and set the filter to the word heimdall (or what other filter word you used in the message send to the AutoRemote service). Under the advance settings of the AutoRemote plugin in Tasker select the Comm Params Prefix and enter the variable you want to receive, in my cased called surveillance.
- Create a new action for this profile and select the KLWP Send Variable plugin. In the ‘Tasker Text’ field enter the variable like this %surveillance() and in the Kustom variable field give it a name to use in KLPW. For the sake of this tutorial I’ll name it klwp_surveillance.
- Add a text field in KLPW and edit it to show the status of the variable klwp_surveillance like this br(tasker, klwp_surveillance) . You can now test the setup by triggering the Homey flow which sends the request to AutoRemote. You should now see the value appear on your KLWP live wallpaper.
- Now that you can receive status changes from the Heimdall surveillance mode you can do all sorts of stuff in KLWP. In the video with the example dashboard I’m using it to show an font icon based on the surveillance mode and also give this icon a color is surveillance mode is (partially) armed. Read up on the KLWP documentation to do stuff like this.
Show generated energy
This is about showing generated energy from my solar panels but the concept can be used for any data that changes very often but only needs to be updated on a time based interval and can be pulled by your smartphone from Homey. Although KLWP is capable of executing requests and parsing any returned data its not possible to use KLWP for this as we need to send an Authorization header with your Homey bearer token. KLWP is (currently not capable of sending request headers so we are going to use Tasker for this.
- Either create a Better Logic variable to holds the data you want to retrieve and use the Better Logic API to request the value of the variable (see app store description from the Better Logic app) or create a flow that uses a HTTP GET trigger card with a HTTP GET action card that calls the AutoRemote service similar as in the push example. You can than use a global tag to send as parameter in the GET request to AutoRemote. The following steps are based on retrieving data from a Better Logic variable.
- In Tasker create a profile with a time based condition, for instance every 5 minutes depending how often you want to update the data. Obviously the more often you retrieve data the more battery resources it will take. Then add an action for retrieving the content of a Better Logic variable similar as described in a previous tutorial. But now use a GET request and parse the returning data (the value of the Better Logic variable is in .result.value) and save it in a Tasker variable.
- Add another action in the same profile to send the variable to KLWP similar as in the push example.
That’s it. You have now mastered all the skills to create your own live wallpaper showing a dashboard with all kinds of information from Homey.