Can someone verify (or correct) this rule?

I'm working on moving my rules from Simple Automation Rules to Rule Machine as a learning opportunity, but there's one that I don't want to have to wait until next winter or concoct hokey conditions to test. Hoping someone more experienced can tell me if I'm on the right track.

In a nutshell, we use a wood stove in our lower-level family room during the winter. When the room reaches 75F, a simple automation turns on a fan to push heat upstairs until the room eventually drops below 72F (usually overnight). To avoid running the fan when the room gets warm during other times of the year, I currently disable the automation in the spring and turn it on again when snow arrives.

The simple automation works great, but I'd like to add another sensor to the logic so the fan will only run automatically if it's below 40F outside; then I wouldn't have to enable/disable the rule seasonally (and I'll learn something as well). Will this do it, or have I got it completely wrong?

Thanks in advance for any guidance!

~Brent

That will work if you add a trigger to run it when temp inside get too warm.
And you need to add the END-IF.

More “elegant” approach would to use a required condition to disable the rule when it’s warm outside.

3 Likes

@TArman is correct. Using a required expression would probably be a better approach. With your current setup, the rule will always trigger when the temperature reaches 75 degrees. Your actions will prevent things from happening causing no harm. However, if you put a required expression, your rule would not trigger at all unless the outside temperature was met:

Required Expression
Temperature < 40

Trigger
Family Room Temperature >= 75

Actions
On Fan
Wait for Event - Family Room Temperature < 72
Off Fan

2 Likes

Thanks to both @TArman and @JB10 for your input. I think I've got a handle on this. Hadn't even seen the required expression option. This is what I've got now:

Look right? Thanks again!

Not quite -- you set up a conditional trigger, but didn't provide a condition for it, so that's why it says False in you trigger

Conditional triggers are a pretty new feature... Painting with a broad brush, you typically would use either Reqd Expression or a Conditional Trigger, but not usually both.

In this case, I'm thinking you don't need the conditional trigger -- just use sensor temp ≥ 75 alone.

ETA a few tips...

Triggers are always events, and Conditions are always states.

A Required Expression is kind of like a gatekeeper to the rule -- when it's false, the trigger won't fire even when that event occurs. So the rule is only "alive" when the RE is True, and it's dormant when False.

A Conditional Trigger is evaulated every time the event happens -- if the Condition is True at the time of the event, the rule fires. So here, the rule is always alive.

That may seem like a minor nuance (and it likely is in many cases), but for events that happen a lot, a Required Expression can really help keep traffic & noise better under control.

1 Like

Whoops! I posted the wrong screenshot. I actually caught that when I was cropping the image and went back and changed it but then proceeded to post the old screenshot anyway. :man_facepalming::sweat_smile:

Thanks just the same for noticing and providing the detailed explanation. I'm here to learn, so it's much appreciated.

1 Like

Taking you to your word, here is a technical detail to be aware of (or not - your rule will work fine as it is) : nothing currently stops the rule from re-triggering with every new incoming temperature reading >= 75 (and therefore cancelling your wait and executing actions again, from the top). This is covered in the documentation.

Given how simple your rule is, that won't have any material impact. If you end up doing something more complex in the actions (e.g. add a notification, Log or Speak Message action), you might want to consider

  • making the trigger conditional on the fan being off
  • replacing the wait in this rule with a trigger in a second rule, therefore having one rule that determines when the fan should be turned on, and another that determines when it should be turned off
  • simply enable the "Ignore trigger events while running" slider.

If nothing ever controls the fan except for this rule, then I think the third option would be fine.

2 Likes

Your mention of a second rule made me realize I was both overcomplicating this and missing something basic: the ”off” rule you mentioned. Previously, there was nothing to turn the fan off automatically were it turned on manually. While I've learned something in the process and will undoubtedly apply it later, I was making this unnecessarily complicated

I therefore created a new rule that turns the fan off (only if it's on) at 72F, then simplified the ”on” rule so it turns the fan on only if it's below 40F outside and the fan is off. There no need for the wait/off actions as that's now handled by the other rule.

Now the fan should turn on automatically (only if it's off AND it's below 40F outside) when the room reaches 75F and turn off (only if it's on) when the room drops below 72F, regardless of how it got turned on.

Thanks again!