Webcore start timer and don't retrigger unless timer is expired

So I have the code below. In the first if statment after the switch is turned on i want a 30 second timer to start. (And reset if motion is triggered again)

then in the second statement I want to check if the timer is at 0 and if so then continue.

So right now if motion the lights turn on, but motion is detected by every second, so if no movement for 1 second, the lights turn off. I want it to wait 30 seconds before it check after there was motion as the could be more motion within 30 second,. so after the last motion wait 30 seconds before turning them off so its not turning on and off rapidly.

How do I accomplish this?

If I understand correctly, I think all you have to do is add a condition to your turn off block to check if motion "was not active for at least 30 seconds."

1 Like

LOL I did not even think to check for that option. I found it thanks.

1 Like