Hi.
I’m currently switching my automations from NodeRed to HA Native.
I have an automation that turns on the light when a motion detector detects motion. But now I want the light to turn off after a few minutes, depending on the time of day.
E.g. between 08:00 - 20:00 the light should go out after 10 minutes and between 20:01 and 07:59 the light should go out after 5 minutes.
What is the best way to configure this in HA?
Can this be done with one automation or do I need two?
Can someone help me?
Thanks.
I would personally use one automation to set a “turn the light off” helper to either 5 or 10 minutes in the future. You would choose the 5 or 10 minutes using a choose action, and then your helper would be the trigger of the second automation which turns the lights off. While 5-10 minutes isn’t that long, it’s long enough that I would prefer not to do a wait/delay, as if you were to install updates, edit an automation, or restart home assistant during that time then the wait will never finish.
Hi,
thanks for the Info.
it now works as expected.
1 Like