How to Fix this Rule?

I have a temperature sensor and 2 heaters that I use to maintain temperatures in an outbuilding. The rule is as follows:


Basically it turns on the heaters if the temp drops below 52F, then waits for it to reach >57F then turns them off.

Now my wife manually turns them on for a few hours to get more heat while she's over there, but sometimes forgets to turn them off. So the heaters run for days until I notice it in the dashboard.

I would like to modify this rule so that if the heaters were turned on manually during the day, then they would turn off at say 6PM. But if it's cold in there, then don't turn off the heaters or perhaps cancel the wait action would have the same effect,

It may be possible somehow to wedge that in this same rule, but it would be much easier just to make a separate rule instead...

For instance, the trigger could be a certain time (6pm, 9pm, whatever) when no one is likely out there manually running the heaters, and then just say "If temp > 57 and both heaters are on, then turn off heaters".

3 Likes

Wouldn't a second rule for when the temp goes over some limit to then turn it off work for you?

Sounds like your #1 concern is not having the heater(s) run too long, regardless of the indoor temp. Have you considered just setting up a simple rule of this form . . .
Trigger: Heater1, Heater2 turns on
Action: Turn Heater1, Heater2 off - Delay = 00:15

That way, if you or your wife (or another rule) turn on the heater(s), neither will go for very long. Regardless, sounds like two rules at minimum are needed to handle all contingencies (one based on temp, another on time) without getting complex.

I think I would modifiy my trigger so the rule looks for the temperature to be changed, instead of looking for it to report less than 52.

Then change the actions to conditional.

IF Temperature of OutBuilding_Temp reports < 52

after that. add in your actions just as you have them now, and then follow them with

ELSE IF
Temperature of OutBuilding_Temp is > 57
Off OutBldg_Heater 1, OutBldg_Heater2
End IF

Yeah, I thought about that too (trigger = temp changed), but I seem to remember Bruce advising at some point that plain changed as a trigger can be a dicey since (depending on what it is), it could be triggering constantly & causing a lot of traffic.

So I'm generally gun-shy about using that as a trigger. But it's certainly an option to consider -- perhaps that concern is unwarranted these days.

ETA -- I just remembered the other reason I dismissed that route -- perhaps the person working out there wants the temp to get above 57 for comfort while they're out there -- that wouldn't be possible if 57 is set to always be the hard cap.

1 Like

I use changed in temp for some rules and haven't experienced a noticable impact from it. In regard to the temp, I get your point, but I'm a heat miser :wink:

What they could do is add a physical button that could be pushed, that triggers a secondary rule that disables the primary rule for x minutes and turns the heaters on. When time runs out, the primary rule resumes and would shut them off.

But, certain time as you suggested would do the trick too.

1 Like

You’ll need a second trigger of either heater turning on and then a conditional action to combine everything. I’d set it up this way:

Triggers
Temperature below 52 degrees
or
Heater 1/2 turn on (any turn on)

Actions
If temperature is below 52 degrees, turn on both heaters. Wait for temperature to be greater than 57 degrees, turn off heaters
Else
Wait for Event certain time 6pm
Off both heaters
End-If

Basically, your triggers need to be the two events that determine to run the rule (temperature or manual on). Then, define the actions using a conditional to specify what should happen for each trigger.

Thanks for all the great suggestions. I decided to do a second rule based on your suggestions:

I don't think this will conflict with the "wait for event" part of the first rule shown above. I think this will work. Does this look okay?

It won’t necessarily conflict with the first wait, but it would turn off the heat on your wife if she goes in with a temperature below 57 and it reaches 58. Not necessarily a bad thing as she could just manually turn on the heaters again.

The only real issue is that at 6:05pm, if the temperature is above 57 and below 60, is that the heat will not turn off. Your heaters would keep running until the following day when 6:05pm comes around again. At that point, the temperature should be above 60 and turn off the heaters. To fix this, set the temperature to above 57.

I dare say that the revised Rule seems like it would not turn the heaters off if only one was operating at 6:05pm. But that may be your intent?

Here's an option

Trigger events
Temperature of Outbuilding_Temp reports < 52.0
OR
Time is 6:05 PM

Actions to Run
IF (Temperature of Outbuilding_Temp is < 52.0) THEN
    On: OutBldg_Heater1
    Wait 0:00:15
    On: OutBldg_Heater2
END-IF
Wait for Expression: Temperature of OutBuilding_Temp is > 57.0
Off: OutBldg_Heater1, OutBldg_Heater2
1 Like

Nice! Another solid win there from the RM jedi :+1:

1 Like

Keep your exiting logic and add the app Auto off: and just make it turn off after X minutes or hours if left on.