Combining functions into a single routine? (Light on at sunset, off 2 hours later)

I am really not sure if this belongs here.

I was wondering if there is a way that you can set up a routine that will perform 2 tasks at different time.

What I want to do is have a routine that will turn the outside lights on at sunset but only for a certain period of time. So basically have it turn on the outside light at sunset and then turn it off 2 hours later but be able to combine this into a single routine.

1 Like

If you use a smart lighting automation and turn it on at a specific time you can also have it turn off two hours later.

but I think if you use sunset as the trigger in the standard features, the only second trigger you get is sunrise.

I’m sure someone has custom code that could do this, though. Hopefully they’ll chime in. :sunglasses:

@rushboys Of course you could do this by implementing two instances of Smart Lighting, One to trigger on the light at Sunset and a second instance of Smart Lighting to trigger off the light two hours later by using an offset of 120 minutes from Sunset. Just curious why you wanted to do it with only one instance? [quote=“JDRoberts, post:2, topic:45878”]
I think if you use sunset as the trigger in the standard features, the only second trigger you get is sunrise.
[/quote]

But maybe this technique would be adequate for you since Smart Lighting allows you to make a +/- offset change to the Sunset and Sunrise times in minutes. So what you might consider is triggering on the light at Sunset and use Sunrise time to turn it off using a large offset that approximates the couple of hours of ON time you wanted. Of course the length of ON time will slowly change by a couple minutes a day but maybe for your purposes that could be acceptable and maybe even desirable if it’ll keep the potential burglars on their toes seeing it isn’t a perfectly set OFF time each day. :smile:

And if by any chance you loaded Rule Machine by @bravenel (before it was pulled) this kind of automation is child’s play

@JDRoberts I’ve tried to set up a single routine in the past to have a bedroom light to come on at 9 and then shut off at 9:45 but it wouldn’t allow me to do it in the same routine. In had to create 2 sepcerate routines. One for each function. So I have a Good night for turning on and Goodnight ii for tuning off. Where ideally l would like to have this combined into a single routine.

That is also what I want to with the outside Light as well. Seems that there is something I’m missing or this is a limitations or Smartthings to allow for complex routines

A routine cannot do it, but if you use Smart Lighting you can. (This is an official feature.)

Open the mobile app.

Go to the marketplace (all the apps there are free at this time), which is the *Icon in the lower right.

Choose smart apps

Choose either smart things recommended or lighting

Choose smart lighting and create a rule (which smartthings calls an automation)

Select the light you want to have come on

Say that you want to trigger it with a specific time

You will then also be given an option to have it turn off, in your example 45 minutes after it comes on.

I can’t give you the screenshot because since the last iOS mobile app update for SmartThings it is no longer navigable by voice over, but maybe someone else can. :sunglasses:

So you can do it with one smart lighting automation as long as it is based on a specific time. But you still can’t do it based on sunset except with the suggestion that @dalec made previously.

The following might be of interest:

1 Like

@JDRoberts thanks for the instructions and tips. I think I have one set up now so will see tonight.

1 Like