Rule Advice

This is my first rule using required expressions. its a simple rule but just wanted to get advice as to whether I wrote it simply or could it be simplified further? Or maybe I dont even need the required expression? I noticed there is a toggle for it when you start the rule?

The rule goal is to turn on my boiler between 1202pm and 358pm Mon-Fri.

Would something like this work?

2 Likes

@jasonbalsor since Hubitat is an event driven systems and time triggers are about the simplest events that only fire once a day, you don't need "Time between..." Required Expression. That type of Required Expression would be good for something like a motion or contact sensor that is triggered throughout the day. Here is another example to simplify your rule:

Required Expression
Day in [Monday, Tuesday, Wednesday, Thursday, Friday]

Trigger Events
When time is 12:02 PM

Actions to Run
On: Boiler Enable
Wait for event: When time is 3:58 PM
Off: Boiler Enable

2 Likes

Thanks! I didnt know you could "wait" for a specific time. Cool

What about this one?.....

This is to turn on the boiler between 1102PM and 658AM on weekdays OR if its the weekend

I don't think the boiler would ever turn off...

Trigger 1: The rule will trigger at M-F at 11:02 and the time will always be between 11:02 and 6:58 when the rule triggers.

Trigger 2: The rule will trigger Saturday at 12am and Sunday at 12am. The time will always be between 11:02 and 6:58 when the rule triggers.

At @pseudonym says, the rule is triggered when the event happens. But the event is a point in time, not a period of time. So when the rule is triggered, the IF statement is evaluated AT THAT MOMENT (or technically fractions of a moment later) but not again until the rule is re-triggered.

I'm guessing you could use either the simple automation or basic automation tools to do this without much aggrevation... unless you're just trying to understand RM, which is certainly a worthwhile pursuit!

1 Like

Thanks, I am just playing around to get used to Rule 5.1. I have this working in Rule 2.5..

Gotcha. I am not familiar with rule 2.5 but it does not appear to be event-driven, which of course really makes a huge difference.

It might also be easier to break it out into two RM rules, one for M-F and one for Sat-Sun.

1 Like

Yea that would definitely make for two more simple rules, just playing. :slight_smile:

Sounds good. Cause fixing those head-sized holes in the plaster gets expensive.

1 Like

Adding another trigger at 658AM may be all I need

@jasonbalsor it's been a while since I've looked at a 2.5 rule so let's look at what you want to happen.
Turn on Monday at 11:02 PM then turn off Tuesday at 6:58 AM?
Turn on Tuesday at 11:02 PM then turn off Wednesday at 6:58 AM?
Repeat for Wednesday on / Thursday off?
Repeat for Thursday on / Friday off?
Stay on all day Saturday and on all day Sunday?
Do you want it to go on at 11:02 PM on Friday then turn off Monday at 6:58 AM?

1 Like

Yes to all questions

I think this should achieve what you want.

Trigger Events
On: Mon, Tue, Wed, Thu, Fri at 11:02 PM
OR
On: Mon, Tue, Wed, Thu, Fri at 6:58 AM

Action to Run
IF (Time is 11:02 PM) THEN
    On : Boiler Enable
ELSE-IF (Time is 6:58 AM) THEN --- or you can just use an ELSE here
    Off: Boiler Enable
END-IF

As there is nothing for Saturday or Sunday, Boiler Enable should be On all weekend.

1 Like