Using automation to KEEP lights on when motion detected

I’m in the process of replacing a nice Webcore piston that would keep my lights on when motion was detected in my basement.

Here is what I have. My kid turns on lights in the basement and if after 20 minutes there is no motion detected the lights turn off. However, if during that 20 minutes any motion is detected the 20 minute time resets and starts counting down again.

I’ve read about automation and looked to replicate this process in the SmartThings app’s automation area. I first tackled it with one automation, but learned that once the process fires, there is no way to ‘reset’ the time delay i built to kill the lights. I then tried using multiple processes with a virtual switch that would reset with motion, but again having the time countdown in an automation process doesn’t reset. I’ve read some comments about using SmartThings labs lighting section, but I also read that is being mothballed also.

Any assistance on replicating my process of when light switch A is turned on, that it starts to count down for 20minutes and if no motion detected after 20 minutes it turns off, but if motion detected, it resets that 20 minute time looking for motion.

I use the following to turn off devices when no motion is detected for a set time:

motion sensor
motion sensor: no motion
for x minutes
You can add a precondition for if the light is on if you want

turn off lights

I am sure others will have better solutions.

Also, you can try Smart Lighting. a new version should be released soon.

1 Like

I would ignore the lights being turned on and just turn them off regardless whenever there has been twenty minutes without motion. In webCoRE that is

  motion stays inactive for 20 minutes
  turn light off
end if

I see @jkp has given you the nearest equivalent for a Routine while I was distracted.

The gotcha would be if the lights are turned on and then turned off again by the Routine before any motion is detected. I guess you might be trying to guard against that by having the timer start after the lights are turned on.

Thanks, I was in the mindset of using the switch on as the trigger (the IF) to care about motion. Instead of as you suggest, just use the motion inactive to turn off the lights regardless if on. Just needed to see the forest through the trees and refocus my thinking.

Addendum: I tried it with the IF of lights on, but it turned off immediately per the automation. I could turn the lights on and start walking to the area of the motion sensor, before any motion is sensed. So testing now to see if the original suggestion will work, since there is no ‘trigger’ to say start that 10 minutes of inactivity.

Thank you. I need to rethink my WebCore routines during this transition. I liked when I could see the wording of the if etc. verses. the dumbed down version. Apparently my too dumb for the dumbed down version. :rofl:

Check out SharpTools Rules Engine. Perhaps there are features there you may like better.

1 Like