I have some Switches like the Sonoff S20 running with MQTT (Pubsubclient).
The switch is sending its online-status via the topic /SONOFF01/STATE as ON or OFF and its relay state as /SONOFF01/RELSTATE.
I can switch them via Habpanel ON or OFF, but the status stays the same when I unplug them.
I also can switch them, even if they are offline, but I don’t see that on the panel and still think that the switch is reacting.
How can I solve this? I woul like to see the switch green for ON, red for OFF as it does today, and maybe gray for offline. Any Ideas are appreciated.
But you would still need a rule which starts a timer when SwitchingItem gets an command and waits maybe 0,5 seconds if you receive a SteteItem change do nothing, if not set StatusItem to off.
Then use teh proposed sheme the you can shange the UI of the button with css.
Edit: changed the broken link.
Maybe this thread can give you more insight in the css.
I never did CSS on habpanel. I only use basic UI for now.
This logic can be done with a MQTT lastwill message:
Lastwill topic is as example: /SWITCHXX/STATE and the Lastwill message is OFF.
When the device connects to MQTT it send /SWITCHXX/STATE/ON and thats it.
But now I need help on the CSS stuff, this is new for me.