Hi Dave
I have been testing your Sonoff binding and have found it to be working quite well, thanks for the hard work.
I have come across something that I wanted to run past you as I am not sure if it’s a binding issue, OpenHab or me.
Here is the scenario
I have two light switch T3US3C (3 touch buttons) and I am using a rule to keep these two in sync.
For example when button 0 is press on one switch it turns on button 0 on the other, the rule does this for buttons 1 and 2 as well, in a nut shell one light switch with three buttons mirrors the other with 3 buttons.
Now above works perfectly fine with my rule, no problem, however there seems to be a race condition if you press a second button to quickly after the first.
Scenario, press button 0 quickly followed by button 1 (or 2, same result) it seems if you do this before the rule has turned on button 0 on the second light switch then the system gets confused and both switches start flicking on and off, it enters an infinite loop.
Because the lights are touch, you tend to run your finger down the light switch to turn all the lights on, this causes the described issue, if you wait a second in between each press then it works as expected.
I have multiple light switches mirrored to others in other areas and they all have this issue.
I have tried many different rules from the forum but still have this issue.
I will post my rule below for your info.
Let me know your thoughts.
Appreciate your time and understand it is limited.
I am using OH 3.1 and Binding 3.1.0 and also tried 3.2.0
rule “sync lights chalet 0”
when
Item Chalet1_Switch0 changed or
Item Chalet2_Switch0 changed
then
if(Chalet1_Switch0.state != newState) Chalet1_Switch0.sendCommand(newState.toString)
if(Chalet2_Switch0.state != newState) Chalet2_Switch0.sendCommand(newState.toString)
end
rule “sync lights chalet 1”
when
Item Chalet1_Switch1 changed or
Item Chalet2_Switch1 changed
then
if(Chalet1_Switch1.state != newState) Chalet1_Switch1.sendCommand(newState.toString)
if(Chalet2_Switch1.state != newState) Chalet2_Switch1.sendCommand(newState.toString)
end
rule “sync lights chalet 2”
when
Item Chalet1_Switch2 changed or
Item Chalet2_Switch2 changed
then
if(Chalet1_Switch2.state != newState) Chalet1_Switch2.sendCommand(newState.toString)
if(Chalet2_Switch2.state != newState) Chalet2_Switch2.sendCommand(newState.toString)
end