ConsecutiveTimeSwitch is a reusable Node-RED subflow for Home Assistant room switches.
It turns a normal wall/door switch into a state-aware room controller:
- If the room/group is already on, the first flick turns the whole room off.
- If the room/group is off, repeated flicks within a short window cycle scenes or brightness modes.
- The same physical switch works naturally both when entering a room and when leaving it.