Turn a light on when mode changes to home, but only after sunset?

Can’t figure out how to get this one to fire

I’ve tried in Smart lighting, but it doesn’t seem to run when the mode changes.

Thanks for suggestions.

After sunset until when? If you want sunset to sunrise, then this Routine will do it:

If Sunset-Sunrise (precondition)
Location Mode is <mode or modes>
Turn on whatever light it is

If you want sunset to some specific time like sunset to 11pm, you have two options:


Device to control
Location mode
<whatever mode(s)>
Only during this time
Sunset - 11:00pm


2 Routines to be used to set the bounding pre-condition using a virtual switch we’ll call Nighttime
If Sunset
then Turn on Nighttime

If 11:00pm
then Turn off Nighttime

If Nighttime is On (precondition)
Location mode <Mode or Modes you desire>
then Turn on <light>

I haven’t tried it but the ‘Device to control’ should be your light, the ‘Action’ should be turn on, and the ‘Device condition’ should be ‘Location mode’ set to home.

Then in the ‘More options’ section you set ‘Only during this time’ starting at sunset and finishing whenever.

Won’t that turn on while I am home at sunset? I am trying to trigger when the mode changes from Away to Home, but yes basically Sunset to Sunrise

That is what I tried first but it doesn’t turn on when I arrive. And will only turn on while I am home at sunset

No, trigger conditions are only evaluated when there is an event/state change and preconditions are bounding conditions that are evaluated when the event occurs. So, this Routine will do it.

If Sunset-Sunrise (precondition)
Location Mode is Home
Turn on whatever light it is


Ok. I’ll give it a shot. Thanks

1 Like