Is there any way to create a custom time period that only uses Sunset or Sunrise and not both?

You don’t have Labs under the 3 bar far right “Menu” option?

What country are you in? The labs options vary by region. :thinking:

Right now Germany.

In that case, do you have a SmartThings/Aeotec hub? And if so, which model?

Personally I feel this should be a feature of regular automation.

All my lighting should come on at Sunset +/- x minutes and then turn off at 23:00 at bedtime. It’s crazy to expect my interior lighting to either be dusk till dawn or regress to manually turn it off.

Of course it can.

Create a routine to turn it on at sunset plus or minus.
Create a routine to turn it off at 2300.

The OP was questioning it because they have staged logic within the time periods. A switch (virtual or otherwise) can always turn on and off at different time types.

1 Like

It’s easily doable with routines, it’s just that you need two of them, one to turn on and one to turn off. Which seems unnecessary, but it’s how they designed it. :thinking:


Aeotec… Smartthings Hub? I only found one. It has Matter and everything, so should be the latest one.

Excellent. If it’s the Aeotec hub, that’s the most recent one. So in that case, you can use an edge driver to create virtual switches that will run locally on your hub.

There are several popular ones created by the community, each with slightly different features. You can find all of them on the quick browse lists in the community- created wiki. Look for the list for “virtual devices.”

In all cases, you will follow a link that the author gives you, subscribe to that author’s channel, choose the edge driver you want to download to your own hub, and then wait.

It can take as much as 12 hours before it gets downloaded, but usually it’s quicker than that.

Once it is downloaded, then you can get to it through the app. The different drivers do have somewhat different instructions, so ask any further questions in the author thread for the driver you are going to use.

For the purpose as described in this thread of just creating a single virtual switch, I’d suggest starting with the following:

The first install of a driver happens within seconds. Its the later updates that can take up to 12 hours to propagate to all hubs.

1 Like

Yah, the needing two things to do one defeats the purpose to me. It’s needlessly complicating things.

1 Like

The Smartlighting app supports mixing Sunrise/Sunset with specific times. So, if that is supported where you are, it’s another option. Downside is that it doesn’t run local on your hub.

You might also be able to do it with SmartTools, but again, doesn’t run locally.

Haven’t looked at whether the Rules API supports it or not.

I prefer the method that @JDRoberts suggested and is what I migrated to from using Smartlighting.

1 Like

I’m not seeing where the old Smart Lighting app allowed mixing sunrise/sunset with specific times. If you create an automation to turn on at sunset, you can choose the toggle to also turn off at sunrise, but its just a toggle.

Regardless, the new “Smart lighting” (small L) replacement doesn’t support this feature. However, it does run local to your hub (at least for devices that are also local).

The old Smart Lighting smartapp will be sunset (see what I did there?) with the rest of Groovy/DTH.

1 Like

It definitely did, that was a very frequently cited advantage of using it.

I used to use it, and we had porch lights set to turn on from 15 minutes before sunset to 11 PM. :first_quarter_moon_with_face:

Also, the old groovy smart lighting was one of the only things that did run local, at least for most of its automations. Another frequently cited advantage. But I don’t know if that applied to something using Sunset. :thinking:

Yep, it did and still does as mentioned by @JDRoberts


1 Like

Well I’m not able to see how to do it with just simple on at sunset, off at midnight…

Im sure I’m overlooking something.

Oh you mean setting an “only during this time” prerequisite. That I can see allowing a mix between sunrise/sunset and a specific time.

I meant a “turn light on at sunset, off at XXX” type rule. I can’t make any automations that allow that on either version of the smart app now - maybe it was at one point.

I believe this should work, but not home to test it.

Oh, I see. :thinking:

Yes, The usual examples under the old architecture were for motion sensors, which would be active for a period where sunrise/sunset was only one of the endpoints. That’s how ours worked with the porch light.

I agree, I think if you wanted two actions, turn on, and then turn off later, it always required two automations, one to turn on, and then another to turn off.

Funny, how people approach things differently. We don’t use any motion lighting, so for me the only sunset/sunrise rules I create are time based (sometimes with mode overrides). So I read the above “it turns on” as “it will turn on” vs “it can turn on”. :slight_smile:

1 Like