Sunset to 10 pm Lights On with Motion

I am using ST. I have a ST motion sensor in a bedroom. I have the bedroom light connected to a ge zwave switch. I want the light to come on anytime Motion is detected between sunset and 10pm. How can I accomplish this?


As with all things in the SmartThings world there is more than one way to do anything. You could set up a Sunset mode for the home that activates at sunset and ends at 10pm (when house mode changes to night perhaps). Or you are going to need something that allows you to have multiple conditions be met before the rule executes i.e. After sunset and before 10:01pm. Such as CORE.

If your an IOS user, there is also an IOS app called SmartRules that could easily handle this. It’s free to create one rule.

You could also use the smart lighting app.

1 Like

You’ve come across a limitation of SmartLighting If you use sunset as the start time, your only option is sunrise as an end time. The 2 options would be to set it to be between 7pm & 10pm ( or whatever times) or set it up from sunset to say 8 hours before sunrise which would not give you your exact 10pm end time.

Thanks to some recent changes, you can now do this with the official smart lighting feature. You add the time constraint at the very end of the rule.

So first you pick the switch you want to come on.

Then you say you want to have it come on with motion and identify the motion sensor.

And then you use “more options” to restrict the automation to just run between sunset and 10 PM.

It works well, it’s just you’d never know it was there until someone pointed out to you. :sunglasses:


This used to be true, but it no longer is. Now you set the start time and the end times in two separate steps and you have more choices now. :sunglasses:

See the screenshots in my post above.

I actually looked in my app to make sure it hadn’t changed before I posted and put my foot in my mouth again LOL

Never mind, I didn’t click through enough times to get to the submenu and see I could indeed change the sunrise to a specific time now.


I have mine set up like that and it actually runs locally.

1 Like

Unless something has changed, which is always possible, I’m pretty sure the “sunset” part the OP requested will not run locally. That requires checking with the cloud.

Additionally, sunrise/sunset and mode changes cannot process locally. Using these as triggers for Smart Lights will prevent the automations from performing without an active internet connection. Use a different trigger, such as At a specific time, instead to ensure your automations can run locally.

Your not able to do sunset to sunrise but you can do sunset to time and time to sunrise .

Interesting! Have you tested it to see if it actually works when you’re disconnected from the Internet?

The sunset to 9:30 worked during yesterday"s outage. I will test it tomorrow with the cat5 disconnected.

1 Like

Cool. It may work, but just not update the sunset time until you have the Cloud connection again.

1 Like

Thanks for helping out JD. I wasn’t aware smart lighting had that added ability.

1 Like

Just tried it with the cat5 disconnected form the hub and it worked.

1 Like