RM 4.0 Rule Questions and Optimizations


See, that’s what happens if you make a logical explanation without looking at it... :stuck_out_tongue_winking_eye:


It's Certain Time and Time of Day. Certain Time is a trigger event -- it happens at a specified time. Time of Day is a condition that involves a span of time. It is true between (inclusively) the two times given. So that difference in nomenclature is necessary to avoid mistaking one for the other. You will never see Certain Time offered as a condition, and you will never see Time of Day offered as a trigger event.


If you ever want this to become more mainstream and get out of the geeky circles, you need to start thinking as your users, not as nerdy techies.
No average user in his right mind will be searching for Time of Day in the actions right after they found Current Time in the trigger.
You guys just got the best hub title from android police. To grow beyond your current confines you need to think more user friendly.
So far it's been a geekfest (albeit quite enjoyable).


Actually we spend most days thinking of nothing but our users. We are well aware of the need to make Hubitat more accessible to beginners at home automation. That's not an easy task, but it is one we spend a great deal of time and energy on.


I will pipe in and agree that having them both appear in the list under “time” would be more intuitive. I understand the need to differentiate, but new users aren’t looking for “time” in the c’s.


Disagree. And your opinion doesn't necessarily reflect what the mythical "average user" will think or do any more than mine does.


Another argument for an in-built text search for the attribute/trigger/condition you are looking for, similar to the drop-down for driver selection. That way, if someone typed in "time" either would show up.


Really love RM4 for the most part, but I have to agree with this. I couldn’t find “certain time” because I was looking under the Ts. I had to scan the whole list a couple of times before I found it. And my first thought was... what the??? Of course, now I can find it with no problem, and I get the difference. But it was confusing at first.


a search box would be nice.

Although, @bravenel just naming it “time” and something like “time range” would be a bit clearer. just my two cents.


Yay, I get to ask for help this time. :slight_smile:

I have a perfectly working Rule 4.0 rule, but have a question. The rule does this:

  1. Turn ON Elliptical at 830am on S-S, and 4pm on M-F.
  2. Turn OFF Elliptical at 930pm every night.

I made 3 triggers - 830am, 4pm, 930pm.

Is there any way to know WHICH of the 3 triggers started the actions? I didn't know how to do that (if you even can) so added some time between conditions to figure out which one it was.

From an academic standpoint, I'm curious if there is an easier way to do it than the "time between" conditions on the actions?

The working rule:


Couldn't you set a variable in your Action statements? E.G. Trigger = 8

Since the only way to get into that action is through a trigger that met the condition, it follows that the first IF could only be entered if the 8:30 trigger was hit. Thus Trigger = 8 or whatever you choose.

Or am I barking up the wrong tree?


@bravenel An idea on this... When you trigger from a time, it would be cool if that would populate a %value% for the trigger.

Right now when you trigger with a time
%device% = "Triggered"
%value% = nothing/null/empty

What would be useful is if it did the following when triggered at, say 530pm:
%device% = "Triggered"
%value% = "1730"

Then if you had an RM rule like 2 posts above with multiple time triggers, you could just do if %value% = 1730 THEN, instead of doing "time between" conditions which take a lot longer to setup.

If not possible, that's fine. Just an idea.


You have %now% available to give you a formatted time.


Sigh. Yes, that would be easier. I missed the obvious, once again.

Seems like I saw a post in the last week where you went over now in minutes vs hours, etc. I'll go search for it.


EDIT: OK, I wouldn't say it is "easier" than what I proposed, as you have to shove %now% into a variable before you can use it in a comparison, but still - it works and is better than multiple "time between" conditions.

This will work especially well once we have local variables - otherwise to ensure the "TimeNow" globals don't stomp all over each other in different RM rules you would (maybe, maybe not?) end up having to make a bunch of globals (one for each rule), which could get messy.

New rule looks like:


That's awful!

If you want to use multiple time triggers in one rule (why bother?) then why not just test the time in your conditional?

IF(time between 8:30 and 8:30) on: Elliptical


If it were me, I'd just have 3 simple triggers instead of 3-in-one like that. Much easier.


Why not just something like...

IF (variable TimeNow = 9:30 PM THEN
    Off: Elliptical
    On: Eliptical


Why bother with a variable at all?


That's not nice, I worked hard on that. :smile: (just kidding). Obviously it could be 3 simple rules, or 1 more complex rule, either works technically. I do find it handy to have an entire ON-OFF function in 1 rule, but it certainly isn't required. For time based triggers, it is probably just easier to have 3 rules.

Can't as the turn ON time is different on M-F vs S-S.


My point is, you don't need to stuff time in a variable. You can test the time directly.


Not following you there. You can't compare %now% to anything unless it is a variable can you?

Or did you mean that I wouldn't need the comparison at all if I did it in 3 rules like a normal person? (which is obviously true. :slight_smile: )