SmartLighting - Sunrise/Sunset - Lights On/Off

So, I have two routines in SmartLighting that I’d like to see if I can combine into one SharpTools Rule. One routine turns my outdoor garage door lights on at Sunset and off at Sunrise. The other rule turns the lights off at 1130 pm and on at 5 am. This way they aren’t on all night long. I had to do it in two rules in SmartLighting to get it to work (and for all I know, I could have done it in one rule in SmartLighting, but I don’t think so).

Anyway, SharpTools has sunrise/sunset as triggers. But what would be the triggers/flow if I wanted to recreate the above in one rule? Is it even possible? I think I have part of the logic cause I can test for Sunrise/Sunset and create a flow, but the time triggers are an issue…

Later: As I was typing this, I was creating a rule. I think the logic will work. I wish I could turn off a SmartLighting rule to test, but I have to delete it instead. Anyway, should my logic below work (if anyone has time to glance through it; if not, I’ll test this evening). Thanks! (Sometimes it just helps to figure something out by typing the question; and usually something comes to me right after I hit send. Ha).

In the current configuration, it looks like the rules would be turned ‘off’ twice at 11:30 PM and turned ‘on’ twice at 5:00 AM.

Since 11:30 PM is also after Sunset, it will match the first IF Condition’s requirements and turn the lights off… then it will match the second to last IF condition for 11:30 PM and turn the lights off again. In theory, turning the lights on or off twice wouldn’t hurt anything and is just redundant.

I suspect you could get away with just adding the 11:30 PM and 5:00 AM triggers to the rule and your other IF conditions around sunrise and sunset would already handle things. (Of course, that assumes that 11:30 PM is always after sunset and 5:00 AM is always before sunrise in your location – if you’re living in Alaska during June, that might not be the case!)

OK, I’ll re-check my logic. My intent is:

  • Sunset – Lights On
  • 1130 PM – Lights Off
  • 5 AM – Lights On
  • Sunrise – Lights Off

I was using “after” sunset and sunrise in case it triggers at sunset (e.g., 8.42 pm) and then goes to the Flow and it’s not exactly sunset but a few seconds (or a split second) later…


P.S. And now that I look at it again, I couldn’t use Sunrise etc. in the Flow. I had to use before or after or pick specific times… I’ll keep looking (although I’m supposed to be on a business call now…).

P.S.S. - Maybe I can’t do this with one rule and need 4? Or just 2? Hmm…

Ah, I see, I misread the rule originally.

You could try adding additional conditions to meet your needs.

IF time is after Sunset and time is before 9:00 PM
IF time is after 11:29 PM
IF time is before 5:01 AM
IF time is after Sunrise and time is before 9:00 AM

Basically conditioning the sunset/sunrise part to stay within a reasonable window so it doesn’t overlap your 11:30 PM trigger later.

OK, great. I was trying to get my thoughts together on something similar, but they wouldn’t gel. :stuck_out_tongue_winking_eye:

1 Like

By the way, it shouldn’t matter in which order the conditions are set in the Flow, right? Because I don’t think I can move them around easily…

Right. The order should not matter for this case.

1 Like

I’ll be testing it tonight…

1 Like

Rule seems to be working well. Yay! :laughing: