Understanding time ranges in RM 4.0

Before in Rule 2.5 and 3 we could say
"Between two times"
True - do this
False do that

Now I understand things are triggered and I would do
At first time - do this
wait until second time
do that

I have a couple cases where I manually or algorithmically execute rules periodically... to update a few things that might have otherwise changed.

So for example-- I can trigger my old rule a few times during that time range and make sure things get to the state I want them again even if they had been changed by another means

Will this same thing still happen with Rule 4.0? In other words, if I manually change a switch after the start time, and then trigger the rule somehow... will it update like it knows there is such a thing as a "range of time" or will it just do nothing since the trigger event has passed.


1 Like

Sure here is an example.

1 Like

What are you frying tonight? And what time should I come over?


Ha ha ha, brilliant. Now I'm feeling hungry too!

Thanks for your fryer example... but how would I do something like that for a time period between Sunset and 930pm?

What would I use as the trigger condition in that case? Do you know what I mean?

Instead of my example of between 5:00 PM and 7:30 PM, you would have from Sunset to 9:30 PM

You would use whatever switch you want to run the rule with as the trigger. Having the rule set like my example means that when that switch operates during that specified time, then the rule runs whichever actions you tell it to.

yeah but... there is always a "yeah but" aye?

I am not running the rule with a switch like you did... I want a bunch of lights to just turn on at Sunset and off at 930pm.

Not super liking the triggered only rules at this point... I guess I don't understand the paradigm yet...

Break this up into 2 rules. Each of them will use "Certain Time" as a trigger.

Rule 1:
Certain Time: Sunset
Turn on: Lights

Rule 2:
Certain Time: 9:30 PM
Turn off: Lights

I misunderstood your question as you stated manually changing a switch to perform the action not an action based only on the time of day.

I use a rule that changes mode manager setting for this but you can do it like this

You would perform that like this (if i'm understanding correctly)

1 Like

I like that.

No offense to you... but I don't like it (so far) :slight_smile: For example... and here is where the comment for the "manual switch" comes in.

If the rule is only evaluated at two points, sunset and 930pm- then that is a significant difference (it seems to me) from what used to be done in Rule 2 and 3. There the rules seemed to be evaluated truly during the entire time range- not just at the beginning and ending fo the range.

For example, I have this rule that turns things on between sunset and 930 pm right? But if the kids manually shut the porch light switch off... I have another rule that tells hubitat to "re-evaluate" this rule every 30 minutes.... that means that all my lights will be guarantee'd to be golden every 30 minutes or whenever I re-evaluate the sunset to 930 rule.

Here is another way to say it.

Let's say I create the rule after sunset and before 930pm. When I push DONE... will the rule actually DO ANYTHING at that point or will it sit there waiting for 930pm to come along...

A little more context each time is helping explain what you are looking for. (I think)

So you would add the switches in question to the triggers as if they (change) which would re-evaluate the rule during that time and run the actions again.

Like this.

1 Like

OK I like what you are saying here.

I also think this might work well enough for me... trying it now

I do like yours better though... ok thanks very much!!!

With you using that trigger of every 10 minutes your ELSE turn everything off will run every 10 minutes when the time is NOT Sunset to 930PM

1 Like

Yeah- I am ok with that though... every now and then I have lights come on and go off on their own... this irritates the wife when she comes home and lights are on in the middle of the day for no apparent reason... so this helps reset everything periodically. I could easily set it to 30 minutes and be happy too... maybe I'll do that.

I must be missing something, Rule4.0 doesn't have "Time Between" as a condition, I have "Time of Day" or "Between two Dates". Or am I looking at the wrong spot? I'm looking at "Manage or Create Conditions" and I'm sure I've seen the Time Between with 3.0.

Any help on this will be gratefully received.

Welcome to the community!
From 'Manage or Create Conditions', chose 'Time of day' and then click 'Time is...".
There is a toggle to change 'time of day' to 'between two times'.

It then turns into this:


How stupid does one feel after missing the obvious. Thanks heaps for pointing this out to me.

1 Like

I wouldn't say it's obvious. Approaching it from Manage and Create side requires you to click on the 'time is' section, whereas when building a conditional statement, the option pops up sooner. :grinning:


I found this thread b/c I'm looking to create a rule that only works between 2 times (basically, play a little tune if the door opens in the middle of the night).

Anyway, I don't see the switch you're referring to on my screen. Am I in the right place?