I've been working on the laundry room portion of my home automation system. I've worked out the OpenHAB automation portion. I've changed the way I've been doing alarms and light indicators from my previous demos, so I thought others might be interested in seeing these parts.
Here's a graphic of what the screen looks like.
For custom icons, I found out how to do them from an OpenHAB forum member. For the item definition, I'm defining a switch item for the alarm, but I'm overriding the default icon with my custom "myalarm" icon.
Item Definition:
Switch itm_laun_water_leak_alm_sta "Laundry Water Leak Status" <myalarm>
This is done by creating three .png files in the <OpenHAB15\webapps\images> folder. For the water leak alarm icon, I have these:
- myalarm.png
- myalarm-off.png
- myalarm-on.png
Easy way to create these is to copy one of the existing icons and, preserving the size (32x32 pixel), edit the image with your custom image. OpenHAB automatically searches out the "xxxx-off" and "xxxx-on" version of the icon if you have a mapping defined. Then, to clear alarms when the status is in "alarmed" state, I use the off button to reset.
Sitemap Definition
Switch item=itm_laun_water_leak_alm_sta mappings=[OFF="Reset"]
I'm doing similarly with the lights on/off indicator, but using a number type since these are simple indicators. That's better than how I was doing it before.
Item Definition:
Number itm_laun_light_icon "Laundry Room Light" <mylight>
Sitemap:
Text item=itm_laun_light_icon
Then, in the image folder: mylight.png, mylight-0.png, mylight-1.png