Two items should update each other - how to avoid infinte loop?

Good morning,

I have two switch items, which should follow each other, i.e. if the status of one changes, I want to send a command to the other to change the status as well. This should work in both directions. If I just code two rules for status changes, it seems I will be running into an infinite loop with the two items sending commands to each other endlessly.

Is there a way to code the rule(s) to avoid such an infinite loop? Or any other better way to implement two switch items that follow each other?

Thanks for your help!

  1. of you create a rule triggered by “state change”, there will be no infinitive loop because in worst case item #1 is changing from on to off, rule triggered, item #2 will change based on rule, rule triggered again, item #1 is already off, therefore rule will not run again and it’s only running 2 times.

If your rule would be triggered by “received command” you wild indeed create a loop

  1. if your items are linked to specific channels, maybe have a look at follow profile
1 Like