When configuring a routine, is each trigger an AND or an OR

Hi, I want to set a routine that turns on the living room lights when anyone in my family is the first one home and it’s past sunset.

How exactly would I accomplish this? I see triggers for presence and for time but I am not sure if they act as AND (Mary comes home and it’s 6PM) or OR (Turn on lights if Mary comes home or it’s 6pm (whether or not she’s around))?

Furthermore I don’t want lights switching on if someone else is already home or if the lights are already on. Can this be done in a single routine?

As with most things in the SmartThings world, there is more than one way to skin a cat. There is a smart app called Sunrise/Sunset that I use to turn certain lights on if no one is home. I use a separate instance of that app to turn on the first set of lights plus additional if someone is home. Then is have an instance of the Smartlighting app to turn on the additional lights if either presence sensor arrives after sunset.

Now it is possible that one of the more complex rules apps out there like Simple Rules may be able to handle this all in one rule. I’m sure someone else will contribute to this thread and offer additional suggestions.

1 Like

Just curious why you didn’t want to use SmartLighting all by itself to do the sunrise/sunset along with the presence instead of using two smartapps?

I have found that its gets a little darker inside than I would like prior to sunrise and sunset. This particular app allows me to have it’s actions take place at a specified number of minutes prior to sunset and after sunrise.

I’m right there with you, I have a stairwell that is the same way and I need to have turn on at a different time than sunset/sunrise. I’m kind of new to SmartThings so they probably updated the SmartLighting app since the last time you looked at it but they have that now. You can add an offset in minutes to both sunset and sunrise now. :slight_smile: Just like you said in SmartThings there is more than one way to skin a cat, that’s what I like about it.

Yep, I would never tell anyone that my way of setting up an automation is the only way. Three people are likely to find 3 different ways to set up automations for the same result.

Also the official features evolve over time. Quite often there is something missing from an official feature, a community-created smart app is introduced to fill the gap, and then later the same functionality is added into The official feature. Those already using the community app are unlikely to change it at that point. :wink:

1 Like

Back to the original question:

[quote=“sygyzy, post:1, topic:49601, full:true”]
Hi, I want to set a routine that turns on the living room lights when anyone in my family is the first one home and it’s past sunset.

How exactly would I accomplish this? I see triggers for presence and for time but I am not sure if they act as AND (Mary comes home and it’s 6PM) or OR (Turn on lights if Mary comes home or it’s 6pm (whether or not she’s around))?[/quote]

In routines it’s an AND. All the conditions have to be true.

The easiest way to do this is with mode. Basically you have a Mode which means “someone is already home.”

You set up one routine for each person which will only run if the mode is not “someone is already home”. when the person arrives, turn on the lights and change the mode to “someone is already home.” That way when the next person arrives, their turn-on-the-lights routine will not run because of the mode.

There are other ways to do this that don’t require mode, but this is probably the simplest.

Hi JDRoberts,

This didn’t work for me when i created a routine. I tried building a routine to turn on a lamp when my phone is not present AND when it is after sunset.

I see that the routine says when either trigger occurs, so therefore i believe it is not an AND.

I have posted this other question here: How to turn on a light when 2 triggers happen not one OR the other?.

I am having trouble with doing this simple routine that i think should be straightforward but i’m sure that i am missing something obvious. I am not sure if i am suppose to code this instead of using the app or what.

Any advise would be greatly appreciated.

Thanks

Angel

I’m going to answer you in your other thread because it just gets confusing when we have duplicate posts in two places.