I have bunch of these motion light automations. They start by creating a scene with all of the lights current state, then activate a new scene with the desired brightness and color, then wait for a specified period of time, then revert to the snapshot scene created at the beginning.
The way it works right now, during periods of intermittent motion, the timer runs out and motions needs to be detected again to start the automation again. I would prefer that the timer restart when motion is detected again.
Originally I had this automation set to a āRestartā mode, but the problem with that is that it overwrites the original snapshot scene with the original state of the lights.
Iām looking for some suggestions on how to have my cake and eat it too.
Originally I had this automation set to a āRestartā mode, but the problem with that is that it overwrites the original snapshot scene with the original state of the lights.
As mentioned, the problem with restart is that it repeats this step, which defeats the purpose of the automation.
Iām an idiot and know very little about HA. But i did a similar thing where i set a helper as true and waited until completion of the automation before resetting to false.
It eliminated sending me multiple alerts when i only wanted one.
Maybe this helps?
Edit:
Iām very curious if you get this figured out because i need my motion lights to do exactly (literally) the same as you.
Right now a motion event will shut the lights off after 5min regardless of what state they were in (via switches) and its super annoying.
That honestly sounds like a decent solution. I do this with other automations to throttle notifications (Uber Eats where Iām notifying on order status but sometimes that will flip to unavailable and back causing the same notification to be sent again).
So first action becomes an if statement to check if the input is off and, if it is, captures the scene. Second action turns the input helper on, do whatever else, and add an action after the wait period to turn the helper off. Change the mode to restart.
When the automation triggers the first time, the helper is turned on and scene is captured. If itās triggered again before the timeout, then capturing the scene would be skipped since the helper would be on.
Allows you to set how far ābelowā the horizon you want the automation to start working. Itās still pretty bright out where I am, so I wait a bit to enable things.