Smart Lighting "Only During a certain time" stops working after midnight

Hi, I have been using a Smartthings v2 hub for over a year now and love it. Im having a problem with the Smart Lighting app, and I wondered if anyone could help. All I want to do is turn dimmer to 80% when motion is detected, then turn off after 10 min. I only want this to happen from Sunset-60 to 10PM. I setup Smart Lighting as follows, but after midnight when I roll over in bed, boom, the light comes on at 80%. Looking at the history, I see it is the Smart Lighting app doing it, despite being setup as follows:

Any ideas??


Make sure you have your location set correctly. The latitude and longitude are needed for calculating sunrise and sunset.

Thanks Zack. I’m not sure where that is set inside the Smartthings app, but the bedroom light starts coming on about an hour before sunset as do my other house lights. So I think it knows the correct time for sunset here.

What time is sunset?

I had some funnies happening when i had a similar rule where the “ON” was sunset - 30 and off at 10pm and where sunset - 30 turned out to be after the “OFF” time. I never quite worked out what it was doing - i just tweaked my rules so that never happened.

Have you looked in the Live Logging in the IDE to see if it has anything interesting to say? For example it reports a ‘timeWindowStart’ and a ‘timeWindowEnd’.

Do you know if the automation runs locally or in the cloud? I have no insight to offer either way, other than to note that they can be independently buggy.

Maybe change sunset to a specific time to test if sunset is the issue.

I have a similar problem related to sunset, the automation works when set to turn on a light when motion is detected between sunset and 10pm, but at midnight and motion is detected the light comes on. It doesn’t last for long, by 1am and motion detected the light will remain off.
If i change Sunset to a specific time the problem goes away, but I really would like sunset to be used.
Any suggestions…?