Turn off X time after the last time motion was detected?

I have a motion sensor on my deck (Multisensor 6). I can very easily make it turn the lights on when motion is detected. But, the only behavior I can find for turning the light off is basically X time later, turn the light off. This is a problem because it will turn the light off after X time whether there is new or continued motion or not. What I want is for it to turn the lights off X time after the last time motion was detected. That way if it is re-triggered within the delay time, the timer basically restarts. The same way any other motion sensor light works.

How can I do this, either with a scene or with PLEG?

A Self ReTrigger timer in PLEG… See my Back Yard Motion + Back Yard Light logic in the attached.

Note, in this case I start the timer when the motion STOPs…

My logic also involves the state of the garage door and another occupancy sensor in the garage, but I think you can see the basic method.

Triggers on the light and the motion detector.

An associated condition for the motion detector to start a timer. The trigger needs to be Self ReTrigger, and the condition should be repeats = yes, so each motion restarts the timer.

A condition to turn on the light (night + motion).

A condition to turn off the light (no motion + motion timer expired).

An optional condition to handle a manual turn on or off of the light which if used, would start a timer and be references by the on and off conditions…

wilme2

What is Device - Outside Light PLEG ?

Tks

[quote=“mlg, post:4, topic:192959”]wilme2

What is Device - Outside Light PLEG ?

Tks[/quote]

The PLEG itself. To start a timer within the PLEG, you call the StartTimer action of the PLEG via the advanced section of the PLEG scene editor…