Having a brain fart I guess

Trying to modify a rule so a switch is turned on only if it's well before sunrise. If it's within about 10 minutes of sunrise I don't care. I can test for Sunrise +/- specific minutes but short of putting 10 tests in what would be the easiest way to facilitate this? Do I setup another rule that sets a variable if we are in that window and then resets that variable at sunrise? I can then modify my rule to use that variable. Or am I missing something? Thanks!

Can you not use a required expression with either one time period that spans midnight (not sure if that would work) or two time periods, one leading up to midnight and one for the morning.

Otherwise, yes I think a variable would also do the trick.

Variable seems the quick and easy way. I'll just do that. Thanks for a quick reply.

1 Like

Come think of it, you could use the private variable for the main rule. You would still need another rule to manage adjusting it, but it would at least make it a little cleaner.

Why not just use a simple Conditional statement to check the time relative to Sunrise? Here is a quick example I just put together that may do what you want with the need for any variables or additional rules.

In this example, I used a Periodic Trigger, as I had no idea what your actual trigger would be. It only has one Action, however you could add other actions that are not time dependent to the same rule if desired.

1 Like

See .... brain fart! :stuck_out_tongue_winking_eye:

2 Likes