Switch on if was on

have a cupboard Heater
and a micro switch on the door

if i open the door the heater goes OFF :slight_smile:
and Closed the door heater turn back on :slight_smile:

now the bit want to do is

if the heater is off and I open/close door it to stays off
but if the heater is on before i open the door when the door is closed again to turn on the heater

any ideas how to do this

hope this make cents

The way I would do it is have 2 automations and an Input_boolean.

The first automation triggers on the door opening and checks the condition if the heater is on. If so runs the action of turning the input_boolean on.

The second automation triggers on the door closing, and checks the condition if the heater is on and if the input_boolean is on (from the first automation) and then runs the action of turning on the heater.

With that said, if the heater is already on, there’s no point in turning it on again right? So do you mean to have it turn it on if by the time you close the door the heater was off?? If so, then I’d change the second automations condition to if the heater is off.

1 Like

thats the word I was after

now more reading

thanks
20mins later
Got it working thanks

2 Likes