Hello, complete new here, and searched many topics, and YouTube, but I can’t find a working solution.
I have the following situation: Motion sensor, and led strip. That’s it.
What I want: after movement, enable the led strip for a fixed time, e.g. 2 minutes. After the two minutes, motion can be detected again, for e.g. 15 seconds. And this time, when there is a new motion within these 15 seconds, the timer may start again for 15 seconds. And this goes on as long as there is motion.
Is this possible?
I have watched this YouTube tutorial, but in this example, the timer restarts after a new motion is detected. And I want a fixed time after the first motion.
I tried with delay, but just don’t know to make the second part.
You can do this with repeat until no motion (delay 15 seconds). (You’ll have to look up the exact syntax.)
However, you should first make sure that your motion detector can actually detect a change in 15 second increments. My experience is that anything under a minute is iffy.
The way I handle this is to have the automation turn on the lights for longer than the minimum time of the sensor (5 minutes in this case) and if the sensor triggers again during those 5 minutes, it restarts the automation. This means it will always be on for 5 minutes from the last time motion was detected:
Sorry, this is not what I want.
I have this sensor.
And I have an ESP32 with ESPhome installed.
I would like if motion is detected, the led turns on and stays on for (let’s say) two minutes. So, during this two minutes, the timer should not be restarted even when there is new motion detected.
Then, after those two minutes, a new motion may be detected and the led turns on for 15 seconds. When new motion is dectected within these 15 seconds, the timer may restart and the led stays on.
Then, with no more motion, the whole loop starts again.
When the door is open, the timer runs for 15 minutes, but f the door is closed the timer runs for 5 minutes, and will restart if there is still motion in the garage. This automation also accommodates you manually switching he light on and off to cancel the timers.
This does require some testing with your motion sensor the ones I use does keep the "detected: state active for 40 to 50 seconds after the last motion, so if you don;t move in that instant the timer expire it doesn’t matter.