I am new to HABPanel and have a question with regards to the Switch widget.
I use the widget to switch a lamp on/off, which works great. But, if I use e.g. Alexa to switch the lamp on, HABPanel doesn’t keep track of it and the icon still shows “off”. Is there a way or a custom widget I could use to separate the state of a switch from controlling the switch (like MQTT stat vs. MQTT cmnd)?
Actually, I need to provide two item sources in the widget, one for showing the state, another one for controlling the switch.
The whole of openHAB is built around the separation of Item state (shown in UI) from Item commands (as created by UI in response to user clicks).
I think there’s two questions you should be looking at - when you use Alexa, is your Item state getting updated correctly?
If it is, why isn’t your widget displaying the new state?
A look at your
events.log to follow the effect of using Alexa is a good place to start.
Thanks for the speedy reply.
Yes, Alexa updates the state correctly, but doesn’t use or update the command / control variable.
If I select the state variable in the widget, I can always see the actual state, but I cannot switch the lamp on/off
I don’t really understand this. openHAB uses Items, they have states and you can send them commands. In either case, it is the same named Item.
Not sure, what I am doing wrong then. MQTT definitely uses two different items for control and state.
Depends how you chose to configure your MQTT channels. Normally you would have stateTopic and commandTopic on one channel, and link that channel to one Item. But you can have separate channels and link two to one Item if you wish.
I think you’re missing something about openHAB functionality here. The OH Item is the pivot around which traffic to UIs and to external devices/services revolves.
Sounds like you are trying to manage two Items representing one device?