Rule triggering in quick succession causes infinite loop (light switch sync)

Rule triggering in quick succession causes infinite loop (light switch sync)
Hi Team
I am using openhab 3.1
I am using Sonoff binding “org.openhab.binding.sonoff-3.2.0-SNAPSHOT_2.5r6.jar”
I am hosting openhab on Raspberry Pi 4.

Disclaimer, I am using the Sonoff binding (not full released) and suspect the issues maybe there but wanted to check in this forum to see if someone is aware of this issue.
I have covered this issue within the Sonoff topic but was suggest to try here.

The issue
I am using a rule to keep 4 light switches in sync, the rule does actually work as intended, however if you change the state of a switch too quickly, eg On to Off and back to On again, the rules goes into and infinite loop.
For visualization purposes, I have four light switches spread out in a long hallway, only one is actually wired to the physical lights.
The light switches are touch switches that glow when On, the desire was to touch any one of the switches and all turn On (and glow), eg turn On and Off from any light switch.
As mentioned above this functionality works just fine unless you toggle the switch to quickly, eg accidental double touch.

rule “sync lights hallway”
Item HallwayLightsSW1 changed or
Item HallwayLightsSW2 changed or
Item HallwayLightsSW3 changed or
Item HallwayLightsSW4 changed

if(HallwayLightsSW1.state != newState) HallwayLightsSW1.sendCommand(newState.toString)
if(HallwayLightsSW2.state != newState) HallwayLightsSW2.sendCommand(newState.toString)
if(HallwayLightsSW3.state != newState) HallwayLightsSW3.sendCommand(newState.toString)
if(HallwayLightsSW4.state != newState) HallwayLightsSW4.sendCommand(newState.toString)


Thanks in advance for any help.

Happy to close this thread off, I am convinced now the issue is in the Sonoff binding so will go back to that thread and address it there.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.