Sunset/Sunrise period of time condition not working

I want my front porch to turn on automatically between sunset/sunrise. This automation was working perfectly and then about a week ago stopped working. It does get triggered at some other part of the day (although I haven’t dialed in exactly what the offset is).

My mobile app and API/IDE both correctly show my location. I’ve tried clearing the location and entering it in again a few different ways without success.

I can trigger this automation if I set specific times (e.g. between 5:30p-7:30a).

During troubleshooting I’ve seen this topic come up a few times in the past, so it looks like a known bug. Any idea what I can do to correct it?

Having the same problem, They come on at sunset but do not turn off at sunrise. been about a week also.

Have you looked at the ‘Weather Station’ Smart app via the IDE Location to see when it has been running the sunrise and sunset handlers?

Perhaps not what you are looking for, but the sunset and sunrise values when used in webCore work just fine. I have several automations that revolve around those values and haven’t had any issues.

I’m fairly new to ST—can you give me an idea of where to find this Smart app?

I actually tried this as a workaround and it caused another issue—maybe it’s related or maybe it should be in its own post. When I try to create a basic piston in CoRe (through ST app), I add a condition variable based on Date & Time and I get an error that says “Network or server error occurred. Try again later.” So I haven’t had much success with CoRe so far.

Is this a SmartLighting automation? Also, while in the IDE, go to My Locations and then Installed SmartApps (all the way to the right).

Look for your automation in the list that comes up. Here’s what mine looks like:


Click on update, and then wait to see if it works as expected. If not, you may have to delete the SL automation and recreate. So far (knock on wood), mine is working great.

You should consider using webCoRE at this point instead of the older version of CoRE.

Core and webCore are two similar but different things. Core is older and while it still works, has been superceded by webCore. webCore has it’s own forum where you can find all the help you need writing your pistons.

It’s not a SL automation because as far as I know SL doesn’t allow for multiple triggers. So for example I want the front porch light to turn on when my motion sensor activates, but only during hours of darkness. SL allows for it to turn on/off during hours of darkness but not triggered by a motion sensor.

Am I wrong in understanding the limitations of Smart Lighting?

Thanks for the suggestion, I’ll start digging into webCore. I was a bit intimidated by it sine I don’t know how to code but I can see now that it has some more intuitive ways of interacting with it that might be within my skill set.

I do that too with SL for my front porch light. It only comes on between sunset and sunrise after motion is detected, and then it turns off after 2 minutes:

There’a also an illuminance option if you have a separate sensor instead of sunset to sunrise. I don’t use it, but it’s there:

No, it just depends on how complicated you want to get. In your use case, SL can do it.

This fixed it! I was doing a manual automation and using sunset/sunrise as one of the triggers, for whatever reason that automation randomly stopped working. But setting up the same triggers through Smart Lighting made it work.

Thank you everyone for your replies.

1 Like

Cool, glad that worked for you!