When you configure OpenHAB or HomeAutomation or any other SmartHome system that has database of current states all sensors, how I can visualize it. If you like Metro style and use it in your Windows 8.1 or Windows 10 you can configure your custom tile with values directly from your sensors.
Process is actually the same as adding your favourite blog or website. Case is that you have to first prepare website that will be added.
As example I present outside temperature. In my OpenHab installation I get a bunch of weather data directly from OpenWeatherMap. Results are shown in OpenHab mobile app, HABPanel and now also as a tile in Windows 10.
OpenHAB
Let’s assume that this is my Item Weather_Temperature we want to visualize:
1 |
Number Weather_Temperature "Temperatura [%.1f °C]" <temperature> (Weather) {weather="locationId=jaworzno, type=temperature, property=current"} |
The idea is to send it value to the RSS feed and give access Windows desktop over website.
We create rule that execute get_temp.sh bash script on every temperature update.
1 2 3 4 5 6 |
rule Temp_WZ2 when Item Weather_Temperature received update then executeCommandLine("/usr/local/bin/get_temp.sh " + Weather_Temperature.state) end |
System
get_temp.sh script details:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#!/bin/bash echo '<?xml version="1.0" encoding="utf-8"?> <tile> <visual version="2"> <binding template="TileSquare150x150Block" branding="name"> <text id="1">'$1'</text> <text id="2">°C</text> </binding> <binding template="TileSquare150x150Text02" branding="name" > <text id="1">'$1'</text> <text id="2">°C</text> </binding> </visual> </tile>' > /var/www/iot.formatx.net/rss.xml |
We get values from OpenHAB and put directly to text id section. In the last line we have to define where RSS feed will be available on our webserver. In this case file rss.xml. It needs to be accessible later.
Other sections like “TileSquare150x150Block” defines how our tile will be look like. More about possible styles you may read here:
https://msdn.microsoft.com/library/windows/apps/br208621
Next step is create website that will be added to the Start menu. Actually writing “website” is too much. We just need piece of HTML with basic definitions and link to RSS feed inside.
I have created file called w.html
1 2 3 4 5 6 7 |
<html> <head> <meta name= "application-name" content= "Pogoda" /> <meta name= "msapplication-TileColor" content= "#08109e" /> <meta name= "msapplication-notification" content= "frequency=1;polling-uri=http://iot.formatx.net/rss.xml;id=1;cycle=1" /> </head> </html> |
Again, makes sure that w.html is accessible.
Almost done.
https://www.laptopmag.com/articles/pin-website-windows-10-start
How to pin website to the Windows 10 Start Menu
- Open Edge.
- Navigate to the site you want to pin. (iot.formatx.net/w.html)
- Tap the three-dot menu button at the top right.
- Select Pin To Start.
- Open the Start menu.
- Right-click the icon for the page and turn on live updates