Hi - I am trying to have lights come on when I come home after dark, either with a Routine or by setting something in SmartLighting. I don’t know which one to use. When I try with a Routine I don’t know how to set it for after sunset. When I try through SmartLighting my “More options” are grayed out (I cleared the cache). I have no clue how to do this. Any help would be greatly appreciated! Thanks!
Try a Routine. Set an additional condition and use time and set it as a precondition. The routine will only run when the precondition is true. May try the range in the time.
Thank you for your reply. I’m looking for a way to have the lights come on after sunset and as that is a time that fluctuates I wanted to use a “Sunset” condition. How would I do that?
Thank you for your reply. I actually need the lights to turn on any time I come home and it’s between sunset and sunrise. How would I do that?
- Add condition. Location Mode. Home. Done
- Add condition. Time. Time period. Night. Done
- Add action. Turn on your light.
Thank you for your reply. I think I figured it out (time will tell). I have If Time is Sunset, and I’m home, turn on lights. Not sure on this but we will see.
That’s not what you want, do it exactly like the 3 points written earlier.
Ok thanks!
Reading through helper’s and OP’s responses, I think two routines are in order. One for when OP returns home and one for when OP is at home at sunset. What would be helpful is what other sensors OP has. Are they using a phone that is sharing location with Smartthings? Is there a door sensor on the door they come in, etc.
I am going to make the assumption that OP is using their phone as a presence sensor. As it also seems that OP is new to this, I’ll try to make it very detailed.
One thing that must be remembered is that you can only have one trigger (If) item that is not a precondition. Everything else in the IF section should be a precondition. If you have two triggers, it is highly unlikely that the routine will run because the two triggers would have to fire at exactly the same time. I have routines with 3+ items in the IF section, but only one is not marked as a precondition.
Routine 1: Arriving Home
IF
- Time is between sunset and sunrise - Use as a precondition. Routine will only run if it is between these times.
- Member Location: Every time anyone arrives. This is the actual trigger. You arrive home. The precondition of sunset to sunrise is met, and the action will take place.
Then
- Control Devices. Add the light(s) you want on. Set them to turn on.
Routine 2: Already home at sunset
If
- Member Location: Every time anyone arrives. Use as a precondition. This should set that you are home. As I don’t ever use this, I am not sure it will work. It might need to use a virtual device or mode set (Home/Away) to work correctly.
- Time Of Day: Sunset. This is the trigger.
Then
- Tun on light
The 2nd routine isn’t really necessary. Just check “run at beginning of time period if other conditions are true” in the precondition of the first one.
Thanks for your help Ken and Peter!
I didn’t know that was a thing. Thanks!
This is not true. You have as many as the editor allows. The ALL or ANY groupings would be pointless otherwise.
Only one trigger event can happen at a time and that will suffice to ‘run’ the Routine, by which I mean consider the current value of every precondition and condition in the appropriate logical combination and determine whether to execute the actions in the ‘then’ section.
SmartThings, and the app in particular, can make things sound like events in a misleading fashion. For example the Member Location uses terms like arrives and departs/leaves but the conditions are actually considering the resulting presence. So ‘Someone arrives’ can actually be true after someone has just left because it tests if anyone is present.
Thank you for your reply!
