Ability to turn off lights after x minutes of no motion is missing

Thanks for checking.

I really can’t see what it could be.

Smart Lights works if no delay is set. So motion on, no motion off is fine. It’s just when I want motion on, no motion for 5 minutes the light doesn’t go off at all.

The sensor, outlet (light) and 1 door sensor are the only things I’ve got connected.

What type of sensor is it? You can turn on Live Logging in the IDE and see if that sensor is throwing the motion inactive event as it should. That should happen within 10 seconds of motion stopping.

The standard SmartThings one.

It’s definitely throwing the inactive event.

23:13:34 BST: debug Parse returned [name:motion, value:inactive, descriptionText:Living Room Motion Sensor motion has stopped]

Evidently, runIn() scheduled events are failing in the UK. Several different reports of this, and that’s what’s failing with this app also, in the UK.

The problem I’m having with this feature (turn off lights after x minutes of no motion) is that it doesn’t seem to be working properly – or at least not the same way – after my switch to hub v2.

I have several lights in hallways set to turn on with motion, and then turn off after 2-5 minutes of no motion. This all worked perfectly fine under the old hub/app.

Now, this use case is biting us all the time, because the new one doesn’t handle it right:

  1. Person walks into dark hallway. Motion is detected; light turns on.
  2. Person leaves hallway; motion sensor registers “motion stops”. A timer starts (presumably), let’s say this one is set to turn off after 2 minutes of no motion.
  3. Person re-enters hallway 90 seconds after the “motion stops” event. 30 seconds later, the light turns off, even though there is now motion detected in the hallway because someone is in it.

Lights turning off while there’s motion active has been driving us absolutely bananas since the hub v2 “upgrade”. I presume this is because there’s some logic error in the new Smart Lights app in which it doesn’t reset its timer/unschedule the lights off command if motion is detected again before the motion stop timer expires.

I have looked through several threads about the new buggy Smart Lights app but I haven’t seen a peep from Support. I’m not going to install a non-blessed SmartApp to “fix” this because then it has to execute in the cloud, which totally defeats the purpose of Hub v2. Given that lighting is probably one of the most commonly automated things, I imagine the scope of impact is significant. @Ben can you provide any insight?

I thought the purpose of Hub V2 was to automate your home. Most things are going to execute in the cloud anyway. Smart Lights is the exception. Except, Smart Lights has some issues, not least of which is a bug that messes up motion controlled lights. “Non-blessed” smartapps work, which the “blessed” Smart Lights does not.

You can wait until ST fixes Smart Lights, and do without automation in the interim. Or check out Motion Lighting: Motion Lighting. No matter what, if you want motion controlled lighting that works NOW, it’s going to run in the cloud. Once they fix Smart Lights, small matter to remove one and replace it with the other! :grinning:


For all of us haters, the feature to turn off the lights after x minutes is BACK! Scroll down the Smart Light app and you will see the Power Allowance option…They have been pushing out serious fixes today

1 Like

Interesting…I’ll take a look. I just noticed the icon is different, so I figured something is happening. It’s a more noticeable icon change with version 1.7.6 (the much more stable version…)

HaHa. I figured making enough noise about it, and offering to fix their broken launch, would get them motivated!! They pushed out some other subtle fixes also.

One is that when you create a new automation in Smart Lights, when you’re done it takes you back to the list of automations you have in Smart Lights, right to the bottom of the list, where you can add the next one… @JDRoberts spent a fair amount of energy explaining to people how to find it again so they didn’t end up with multiple instance of Smart Lights, instead of multiple automations within a single instance of Smart Lights.


They still haven’t fixed Turn off after motion stops. They still don’t have the option of turning off after some minutes of no motion UNLESS you turned it on with the same automation.

1 Like

So much for that…

Sounds like more pushing is needed…

1 Like

And they didn’t fix the between two motion events bug either. Well, maybe next time.

The fix is something they may find distasteful: a state variable that tracks the on/off status of the switches managed by the automation (not device.currentSwitch), and a state variable used instead of unschedule() to kill a runIn(minutes,turnOff) that’s been launched. They told everyone months ago that unschedule() was unreliable, and to my knowledge have never commented about it since. I just blew it off and use a state variable to know when a new motion event has occurred, and therefore NOT to execute any pending turnOff(). My approach works, theirs doesn’t.


Thank you! This solved my problem too! I don’t know the first thing about writing my own code, but I copied and pasted yours into My SmartApps and … voila! Thanks!

1 Like

PSA, they’ve added this ability to the Smart Lighting smartapp. They’ve also made it so the SL is no longer nested. As in my smartapps list has almost 100 lighting automations now. Yay! Haha

I am not sure this is correct. For one, my smart lighting app is still just one app with multiple “rules” within it. Two, the ability to turn off a light after motion stops for x minutes is still not available. You only have that option if it’s TURNED ON by the sensor.

Still broken…

What version of the app are you running?

Create a new lighting automation from the smartapp menu, not within the existing app. It will start creating individual smartapps instead.

@stevenascott I can confirm that the options there now…

So for clarification for anyone reading…your EXISTING Smart Lighting app will not have the option for the turn off after x minutes. You need to go into the smartapps section and do another instance of Smart Lighting. Doing this now however makes a smartapp with the name of the rule instead of bundling them all under a single Smart Lighting app.

I am not 100% with this approach but I won’t complain yet. It would get get frustrating if you have a ton of rules and essentially filters out all other smartapps as a result.

NOTE: The turn off after x minutes is noted as being in Beta and not working for local execution so it is still dependent on the cloud which I find very curious.

To add to the annoyance and peculiarity, the smartapps are not in pure alphabetical order – making it a nightmare to find things. Now that I have 100+ apps/lighting, it gets hectic fast.

Because for it to run on a V2 hub, the firmware has to be updated. Smart Lighting is in firmware on hub V2, but in the cloud for hub V1. They added the feature, but have not updated the firmware yet. In the meantime, if you need this functionality, you can find it here:

1 Like