Hey, I have a ventilator in my bathroom that is controlled by a light switch. I would like to have this behavior:
- When I turn on the light (also controlled by the light switch) I want to wait 2 minutes and then if the light is still on, turn on the ventilator.
- If the light was on for less than 5 minutes, turn off the ventilator 5 minutes after the light was turned off.
- If the light was on for more than 5 minutes, turn off the ventilator 10 minutes after the light was turned off.
I managed to do differentiate between step 2 and 3 with use of another helper automation. The automation is disabled 5 minutes after the light is turned on and the automation that controls the step 2 is started only when the helper automation is enabled and the automation that controls the step 3 is started only when the helper automation is disabled…
Is there a better way to do that?
Also, now I noticed, that I have a bug in the step 1. Actually the ventilator starts even when the light is off 2 minutes after I originally turned the light on. Any ideas how to fix this? Thanks