So, my solution, based on the logic, is this the following.
Cycle Logic (pseudo-blocks)
Trigger: Button press (scene controller state changes)
Variables:
- fan1 = getEntity("zwavejs>13-1").attributes.power_switch.state
- fan2 = getEntity("zwavejs>13-2").attributes.power_switch.state
- skip (default = false)
- lastTurnedOff (text)
Group 1 – Both OFF → Fan1 ON
Condition: skip == false AND fan1 == OFF AND fan2 == OFF AND lastTurnedOff <> "fan1"
Action:
- Turn Fan1 ON
- Set skip = true
Group 2 – Fan1 ON → Fan1 OFF
Condition: skip == false AND fan1 == ON
Action:
- Turn Fan1 OFF
- Set lastTurnedOff = "fan1"
- Set skip = true
Group 3 – Fan1 just OFF → Fan2 ON
Condition: skip == false AND fan2 == OFF AND lastTurnedOff == "fan1"
Action:
- Turn Fan2 ON
- Set skip = true
Group 4 – Fan2 ON → Fan2 OFF
Condition: skip == false AND fan2 == ON
Action:
- Turn Fan2 OFF
- Set lastTurnedOff = "fan2"
- Set skip = true
Notes
- The skip variable ensures only one group runs per button press.
- lastTurnedOff lets Reactor know which fan was just turned off by this rule (so it can toggle the other fan on next).
I'll make some other tests and see if it's working as expected. I used Chat GPT 5 giving the Reactor Docs as context and deep reasoning and it helped me a lot. I just had to explain my logic, provide a couple of screenshots and ask for logic blocks instead of script action. YMMV.