Feature Request- RM Trigger Earlier of Two Times

Mode manager has a feature to trigger mode change based on the earlier of two times. So, for example, I can have evening start at 5:00pm or Sunset, whatever is earlier.

This would be an awesome trigger for a lighting rule I have and I have made something work, but it feels super clunky to me. If the trigger was available, that would allow me to clean up my rules. I have thought about setting the lights based on the mode, but then it would not work when my mode is set to away and that I want this rule to run independent of mode.

What is your current solution? I can't speak to the likelihood of this being implemented, but perhaps there is something less awkward than what you're doing right now. :slight_smile: (My first thought involves a required expression of private boolean true, setting it false first thing in your actions, and using a wait for event: time is 11:59 PM or similar before setting Private Boolean to true last thing in your rule actions. Yeah, a bit of work, and possibly something you'd need to do differently depending on what else this rule is doing and how it's configured, but in general already do-able.)

There is no need for a new feature to do this, as it is easy already.

Here's how:

Use both times as triggers of the rule. The rule simply only does anything the first time it is triggered, not the second. Then do this in the rule actions:

To do Later of Two Times is just as easy, simply reversing the logic above.


Thank you so much. The previous way I was doing this was to have 2 rules and just limit one to firing off only during a certain time frame. Like I said, it was clunky. But, this is elegant and solves my problem.

Your solution, with a little modification is what @bravenel suggested and it looks like it will work perfectly.

That's actually a good reminder to not get complacent in one's use (and TESTING) of Mode settings -

Day/Evening/Night for Away
vs Day/Evening/Night for Home
vs Day/Evening/Night for BOTH

...this differentiation is warranted for a lot things and I bet there are more than a few folk with rules that have been configured with a quick mode setting decision that would be tripped up by using Away and trusting all-to-be-right.

Quick question, during the first trigger ay 5:00 PM the boolean is set to false so actions are skipped during the second trigger.

What would happen if:

  • There is a power shutdown between triggers and the hub is back online BEFORE the second trigger

  • There is a power shutdown between triggers and the hub is back online AFTER the second trigger

What would happen to the boolean variable value?

Well, clearly, if the hub isn't running when a rule is supposed to run, that's going to throw things off. In the other case, where the hub is down and then back up, no harm is done.

There is a Location event called systemStart that can be used to trigger a rule to clean things up. But it would have to know what to do.

Hi All,

I have been using a later of two times for some time now in several rules, but a recent update it stopped working in one rule, can you review and let me know if I have something wrong or what I should do.


I think I see it now that I posted, Boolean is set incorrectly, I try resetting it