Issue of the topic:
Switch widget status is ON as default (sometimes it OFF for a while, but then goes to ON w/out pushing it) and when pressed, does to OFF for a split second and then back to ON.
Relay deactivates if it’s in ON state and can be activated with fast double click (OFF->ON) Relay commands are logged and every time the switch is actuated when it state indicator shows ON, RELAY OFF command is sent. And also RELAY ON command is sent in case of above double click activity
Issue happens also when using HABPanel from a mobile device.
I deleted following lines from the rules file and now the switch works, but if the relay is actuated from elsewhere, the state isn’t updated. So I guess the culprit is the Denkovi provided code.
rule "RelayState"
when
Item Relay received update
then
logInfo("Relay received update","Relay received update")
if((Relay.state as DecimalType).intValue.bitwiseAnd(0x01)==0x01) Relay1.postUpdate(ON) else Relay1.postUpdate(OFF)
if((Relay.state as DecimalType).intValue.bitwiseAnd(0x02)==0x02) Relay2.postUpdate(ON) else Relay2.postUpdate(OFF)
if((Relay.state as DecimalType).intValue.bitwiseAnd(0x04)==0x04) Relay3.postUpdate(ON) else Relay3.postUpdate(OFF)
if((Relay.state as DecimalType).intValue.bitwiseAnd(0x08)==0x08) Relay4.postUpdate(ON) else Relay4.postUpdate(OFF)
if((Relay.state as DecimalType).intValue.bitwiseAnd(0x10)==0x10) Relay5.postUpdate(ON) else Relay5.postUpdate(OFF)
if((Relay.state as DecimalType).intValue.bitwiseAnd(0x20)==0x20) Relay6.postUpdate(ON) else Relay6.postUpdate(OFF)
if((Relay.state as DecimalType).intValue.bitwiseAnd(0x40)==0x40) Relay7.postUpdate(ON) else Relay7.postUpdate(OFF)
if((Relay.state as DecimalType).intValue.bitwiseAnd(0x80)==0x80) Relay8.postUpdate(ON) else Relay8.postUpdate(OFF)
end