Add sunset/sunrise and offset to specific time choice in routine conditions?

When setting up a few routines to replace my Smart Lights, I have a couple that I would like to start at sunset or a specific offset + or - sunset up to when I typically go to bed and consequently a different routine to run from bed time to sunrise the next morning.

For example: I run my porch light at 10% brightness from Sunset to 10PM on weeknights and if motion is detected brighten it up to 100%. Then, on a different routine when motion is not detected for 5 minutes, it changes the brightness from 100% back to 10%.

After 10PM on weeknights up until sunrise, should motion happen, turn on the porch light to 100% and then another routine to shut that off after 5 minutes of no motion from 10PM to sunrise.

I checked all over when I tried to build the routine and my choices were at a specific time, during a specific time or between something like sunset and sunrise and the offset there…I could not combine the two.

You need 2 routines. 1 to turn on at sunset and 1 to turn it off at a set time like 11pm.

2 Likes

I use a virtual switch to serve as a variable to track a time interval that includes a specific time and a relative time. So, I have a virtual switch I call “Nighttime” that turns on at 10:00 pm and turns off at sunrise. I use that as a precondition in a routine to alter the behavior of the motion and button triggers for some motion/dimmers.

2 Likes

I have requested this a few times by emailing smart things support. Although you can’t do it with automations, you can do it with smart lighting


E

Thank you, everyone. I have something temporarily in place but I still think this option is a feature request Samsung should consider.

It’s a no-win situation. So with a Routine, you have no way to set a static stop time if you use Sunset as the start, but you have the option for auto off after specified duration. If you use smart lighting you can use sunset with a static stop time, but then you have no auto off as I don’t want the light to stay in for more than 5 minutes at a sensor detection. Basically, each method has what I want, but not both like Rule Machine on Hubitat. I was trying to move back to Smarthings after 5 years seeing many improvements, but I’m not sure I can.

Many people use a virtual device to represent the time period between a relative time (sunrise/sunset) and a specific time. That virtual device is then used as a precondition in a Routine along with whatever trigger is desired. So, three Routines:

If Sunset
  then
Turn on Virtual Device

If 11:30pm
  then
Turn off Virtual Device

If Virtual Device is On (precondition)
  Motion is detected
  then
Turn on light with auto-off 5 mins

So you want the light to be turned off five minutes after a sensor detection regardless of how long ago the detection stopped or if it is ongoing? I guess they didn’t consider that scenario in SmartThings Lighting.

Another option would be to use Smartlighting to turn on the light between Sunset and fixed time when motion is detected and then use a Routine like the following to turn it off:

Right. Basically, it’s a very primary function in lighting. Especially when for example you want the kitchen lights to come on when you enter the room. So after detection, turning on the lights for 5 minutes and then shutting off, is perfect. This way, if you remain in the kitchen, say for cooking etc, it would reset the 5 minutes auto shutoff as you continue to move. Over 5+ years of this using Hubitat, it’s been what great automation should be. And energy friendly.

Best,
Bob

What you don’t want, is to become a worker out of bad automation. That simply defeats the purpose. I originally created the long running Smarthings user group that grew into 100k members, and I’ve seen it all through the years. Many miss the point and set up tablets and Voice commands and essentially make more work than any of its worth in that case. I believe good automation covers a high percentage of autonomy. There will always be exceptions and voice and button controllers work well in those situations. That’s when you know automation is helping you and not putting you to more work than physical switches that were less work to begin with. :slight_smile:

Thank you. I will look into that :slightly_smiling_face:

Ah right. I wasn’t expecting that as Routines never used be able to handle that situation. Once the auto turn-off was triggered that light was going to get turned off five minutes later whether you liked it or not.

I always use motion deactivation as the trigger for the light being switched off. As it happens my current motion sensors have a three minute delay before deactivating and that is all I want, but previously I added a delay on. It’s a very popular two Routine approach, and is also the one offered by Smart Lighting as a one automation solution.

I was able to accomplish what I described all in smart lighting. I created sunset to 10:30pm to turn the light on at 50% brightness. Then another in smart lighting for the same time frame to detect if the light is on, to turn it off after X time. :slight_smile: should just have the auto off option but this will do. Back when I left SmartThings 5 years ago, it had Bruce’s Rule Machine. So I followed Bruce to Hubitat. (For the backstory). Cheers!