Delay for no motion

I successfully set up my first Piston to turn on my bedroom lights when there’s motion between certain hours. I set up a second to turn them off when there’s no motion during the same hours. The second one works too well. It turns off the lights right away but I would like to have a delay of at least 30 seconds. My issue is that I don’t see anywhere to set that delay. I want something like “no motion for 30 seconds then turn off the lights”. How do I set a no motion delay?


Try something like this.

Make your piston type simple not basic. You can accomplish everything with one piston. (My refresh commands aren’t necessary. Ignore those.)

I use this for the same use case (change the delay as desired):

OK, I tried doing what was suggested. It seemed to work in CoRE but in reality, the lights go on great but instead of the 2 minutes I have set, they turn off in 15 seconds. Is there some delay in getting the piston on to the ST cloud for it to actually run? This is my new piston:

Put your two actions 1) wait and 2) using Maryann’s Light under the same action. Like this:

1 Like

Your wait and turn off actions need to be in the same “using” group. Each using group starts at the same time. So, therefore your “turn off” action has no wait associated with it. and executes immediately. If you put your two actions in the same group, the actions will run sequentially.

Thanks for the suggestions. I followed your advice and it works. And the best part is that my wife even likes it!

Thanks again for the help!!!