Hello, All!
I am fairly new to openHAB and I am testing out some of the basic features.
I would like to know if there is a way to create an item which combines switcher and display device status (icon on or off).
openHAB version: 2.3.0
I used arduino and modbus rtu for remote control a lamp.
My configs:
/etc/openhab2/sitemaps/lamp.sitemap
sitemap default label="Lamp" { Frame label="Lamp remote control" { Text item=LED Switch item=BTN } }
/etc/openhab2/items/lamp.items
Contact LED "Lamp status" {modbus="slave1:5"} Switch BTN "Button" <light> {modbus="slave2:5"}
/etc/openhab2/rules/lamp.rules
rule "Lamp swicher" when Item LED changed then if(LED.state==OPEN){BTN.label="On"}else{BTN.label="Off"} end
The rule above change the item label by current lamp status.
The rule above work correctly if on sitemap present two items but need one item and show the current lamp status as an icon.
Thank you.