I have a heater in my garage. I have 3 doors with sensors (A, B, C). I have a connected thermostat.
I have the following event:
Event 1
If Door Sensor A changes and becomes open
Set 'heater state virtual device' to current thermostat mode
Set thermostat mode to 'Off'
Event 2
If Door Sensor A changes and becomes closed
Set thermostat mode to 'heater state virtual device'
This works as it stores the current state of the thermostat, turns it off while the door is open, than sets it back to whatever state it was before.
NOW, the fun part. I have 2 other doors. I'd like it to turn off the heat when ANY door is open, but if door B opens, and I set the state when door B opens, it will set the state to off (as the thermostat mode is off due to door A being open).
How would I go about turning off the heat but remembering what the state was when the first door opens, and back when the last one closes, in any order?