Automation to turn of lights after no motion is detected for 5 minutes

Hi guys,

I wonder if you can help.

I’m trying to set up an automation (piston) to get the living room lights to turn on/off if motion is detected in either of my motion sensors.

I got the part to turn it on working without issues.

However, I’m a little stuck as to how to get them to turn off. This is because I want the lights only to turn off if the motion detector remains unchanged for 5 minutes and its status is inactive.

I’m trying to have it set up this way so that when I’m in the room, as long as the sensor detects motion, it won’t allow the piston to run, preventing the lights from turning off while I’m still there.

Any help or support is much appreciated.

  • Execution Method
  • Task Cancellation Policy
    On condition state
  • Task Execution Policy
    On condition state

I’m no webcore expert but why wouldn’t you just say if motion sensor 2 and 3 motion stays inactive for 5 minutes, then turn lights off?

That’s how I run all of mine


You shouldn’t need to mess with the TEP, and certainly not on the ‘if’.

I have a feeling ‘stays unchanged’ never got implemented, but regardless of that just using stays inactive, as @Sergeantpup suggests, should suffice.

1 Like