Sunset Automation not functioning in SmartApps

I have been trying various combinations of things to get this to work but it still is not.

Using the SmartLighting I have set up an Automation to turn on my outside lights at Sunset. This is not working. What the Automation does is turn the lights on at 4:05/4:06pm daily. Other aspects of the Automation are fine… like only running M-F. I have tried using the Offset at different amounts, nothing. Most recently I set it to a specific time, 6:20pm, still fired at 4:05/4:06pm. My alternative is to go to IFTT, but I would like to keep it within the system itself, if i can get it to work.

Almost forgot, my hub does have a location set up via the mobile app, since we are using the presence detection for some other automations. This geofencing with the hub is working fine.

Am I missing something? Any thoughts or suggestions would be appreciated?

Do yourself a favor and install webCoRE and never look back. SmartLighting has the advantage of running local if all of the devices are local but other than that, I no longer see any benefit of using "Smart"Lighting as it has turned out to be pretty “Dumb” and basic for me.

Thanks for the Info… Got it installed, and just finished writing the basic Piston to perform the action at Sunset. See how this goes tomorrow.

1 Like

I have 3 different Smart Lighting automations all using sunset/sunrise and all work just fine. If you decide to go back to local control I’d contact support and see f there is something weird with your setup.

So, apparently I have something else going on. Because at 4:06 today the lights came on again. The interesting thing is that I had deleted the Sunset Automation right after I finished up with the WebCore Piston. So unless there is some remnant of that automation that still fired today, then I have something else that is doing it.

My WebCore Piston fired just fine btw. Thanks, rontalley.

Another small twist to this is that I had completely forgotten about an automation I setup back when I first got the hub, which turned on the Living Room light at Sunset… This automation has always worked and continues to work to this day.

So you may definitely be onto something vseven about some oddness with my setup.

Thanks for all the feedback.

If you open one of the devices in Things that came on at 4:06 and then select the SmartApps tab, you will see every single automation (ST) you have that is tied to that device.

Are these bulbs that you are turning on? If so, what kind? Just wondering if you have something like Hue or LIFX that you may have set a scheduled routine up specifically in the app for those bulbs.

Sounds like you might be setup with the wrong location/timezones. You can go into the ide and look at your location details for your hub to see the coordinates and timezone setup for your location.

Just checked that per your suggestion… I have WebCore, the WebCore Piston, A Simulated switch (just On/Off, no timer), a schedule automation to turn the outdoor lights off at 2:30a (this functions fine) and “Notify Me When”. That’s it.

As far as bulb types… 2 Sylvania Flood lights and a Cree bulb (all outdoor rated).

Checked that one already and it is correct. It even displays the Sunrise and sunset in the Hub UI on the website and the times are correct for my area.

I just concluded a very long and exhausting remediation session via email with SmartThings Tech Support. The Sunset (and Sunrise) function were not working for me either. Fortunately, they are able to access the settings and parameters attached to by cloud account so it made the process much more efficient.

First things first. Apparently, when I initially set up the account my geololcation was NOT set. This seemed a little odd to me since my profile showed by accurate home address and time zone. Step 1 was to go in and reset this - easier said than done. To ensure that I was in the right place I wanted to set myself into the absolutely WRONG place (e.g. another time zone) and then back to my actual location. This would of course be simple if the system let you type in a physical address, but the programmers like having control so that’s not an option. I made the map REALLY small and picked a location on the East Coast (I live in California), waited a bit, and reset it back to my actual location.

According to the tech, there’s a SUNRISE/SUNSET SmartApp that runs in the background that was not installed correctly when I activated the Smart Lighting feature - yet another glitch. The following is the email thread on how to correct this.

  1. Login to the SmartThings IDE (
  2. Click ‘My Location’
  3. Click ‘smartapps’ under “Installed SmartApps”
  4. Click Edit
  5. Click ‘Uninstall’ on “Smart Lighting”
  6. Clear both cache & data of the SmartThings app (see below) then uninstall it (Note: I was not able to uninstall SmartThings from my Samsung tablet. The tech gave a hack that involved rebooting in safe mode - SERIOUSLY??? Does it need to be this difficult?? - but I found that I could delete the app on my Samsung Galaxy 8 phone instead)
  7. Install SmartThings Classic
  8. Navigate to Automation -> SmartApps -> Add a SmartApp- -> Lights & Switches -> Smart Lights

Set up the sunrise/sunset automation as you have it now

You can now reinstall the new SmartThings app

Here are the steps to clear both cache & data:

  1. From a Home screen, touch and swipe up to display all apps.
  2. Navigate: Settings app icon > Apps & notifications Apps and notifications icon.
  3. Tap Up arrow icon See all apps.
  4. Tap the appropriate app.
  5. Tap Storage.
  6. Tap Clear cache. (And then also tap clear data)

I’ve literally gone through root canal surgery that was less complicated… In the end, this did work and I can set my porch light to come on from SUNSET to SUNRISE when the motion detector picks up motion in the driveway.

Hope this helps!!!

Hi All,
I have done programming on and off for years, but I am new to SmartThings. I am trying to do what I think should be a pretty simple automation. I have a Ring Video Doorbell that has a motion sensor and is connected to SmartThings. I also have a Levition Z-wave plus switch that controls my Front Porch light. I am trying to program an automation for the SmartThings app to turn on the front porch light when motion is detected and it is dark outside (i.e sunset to sunrise) and then turn the lights off after 10 mins. Something normal motion detector light can do, but wanted to test this with SmartThings before trying to get more advanced. In the SmartThings app, I selected Automations and then Custom Automation. I added a condition under if to signal when motion was detected. Then I added a second condition for the time of day. I selected Period of Time, for Start I selected Sunset, then for End I try to select Sunrise, but it won’t let me. I have to go back to Start and select Sunrise, then I can also select Sunrise for End, then I got back to Start and choose Sunset. Once this is completed, I select every day of the week and then next to add the condition. Under Then, I select the Front Porch Light and then select Next. This adds the action, but then I reopen this action and select Turn off automatically after 10 mins, then select Next again. After completing this, I select Save to complete the animation. Now the frustrating part, the animation works but it works 24 hours a day. Have I done something wrong? What am I missing? Any help would be appreciated. I would like to move on to more complicated things, but I would like to get this working first.

Are you using the SmartThings (Samsung Connect) app and the custom automations? If yes, install Smart Lights and create a rule to turn on your light instead of the custom automations. You will find it easier to use the sunset/sunrise timeframe

jkp - Thanks for your quick response I am using the SmartThings (Samsung Connect) app. So I did as you indicated and installed the Smart Lights and created the rule. I first indicated that I wanted to control the front porch light and to turn it on. I selected motion on the Ring Doorbell as the trigger and then turn of 10 mins after motion stops. Then I selected “Only during a certain time” and selected Sunset to Sunrise. I selected every day of the week and left the other options alone. I completed and saved the automation and then went back to my custom automation and deleted it. With great anticipation, I went out the Front door and triggered the motion sensor during the day (6:47 PM, sunset is at 7:50) and the front porch light came on. Any suggestions?

login to IDE at - click on My Locations and choose your Home location and verify your timezone and sunset/sunrise are correct. If they are correct, post screenshots of the rule you created. If the info in IDE is not correct, report back.

While waiting for your response I tried a couple of other things. First I removed the selection of everyday and just this without input. This did not change anything and the light still came on. The I changed the start time from sunrise to a time an hour later than the current time, the light still came on.

After reading your message, I logged into IDE, selected My Locations, Chose Home and my timezone is shown as America/New York which is correct. I checked the coordinated that are listed in Google maps and they point to my house. I don’t see the sunrise and sunset times listed anywhere.

One more quick test. I changed the end time from Sunrise to 11:59PM and retested. the light did NOT come on. To me, this would seem to indicate that the issue is either with the Sunrise and Sunset times or there is an issue carrying the automation through to a new day.

that can’t be good! try this…in your ST app, change your geolocation to somewhere in the western US, click save and wait one minute, then change back to your correct location and click save. go to IDE, refresh that page and see if your sunrise/sunset times show up. if not, go to My Locations but click on smartapps and in the Hello Home section at the top of the page, is there Weather Station listed?

it is a sunrise/sunset issue. As you pointed out, they are not set in your account or they would show in IDE

Change the geolocation as you suggested, waited for a couple of mins and then changed it back to my home. Still no Sunrise and Sunset times listed in my Home section. I have the following things listed:
Temperature Scale
Current Mode

In SmartAps weather Station is NOT listed

would look like this