Refine my AC patio door protection

Hi,
I have this rule that basically turn off my AC whenever the patio door is hold opened for at least 10 minutes. When it's close, it goes back to its previous state (whether is cooling or heating).
The rule works well but it has some quirks. When we close the door after the 10 minutes trigger, I received 3 notifications instead of only 1.
I also would like to update the rule to the latest rule machine 5.1.
I tried using the "wait for condition" but had no success as I had no idea how to use it.

Can you suggest another way to approach my complex rule?

I can't think of a solution right now, but I suspect your use of changed in the triggers and then actions that would cause those triggers may be part of the problem. I would suggest turning on logging for the rule and watch it in action, then you may want to look at introducing a required expression that the AC is on and the trigger just being the contact sensor, though there is probably a few other edge cases in there somewhere.

Off-hand, I'd probably take advantage of Rule Machine's ability to have timed conditions and waits instead of trying to re-enter the rule on triggers caused by the rule's actions. So instead, structure it like this:

  • Required Expression: A/C is active
  • Trigger: Patio door opens and remains open for 8 minutes
  • Actions:
    • Notify phone that A/C will turn off
    • Wait for door close, timeout of 2 minutes
    • If door is still open:
      • Turn off A/C
      • Notify phone that A/C is off
      • Wait until door closes, no timeout
      • Turn on A/C
      • Notify phone that A/C is restored
2 Likes

Oh wow, this is much more elegant.
Yesterday I took the time and redid the whole thing differently... to end up with the same app utilization, but I only received 1 notification.
There is a lot of steps, but most of them are notifications. I also wanted to switch to fan-mode instead of just closing the AC.

BTW, the capture device doesn't seem to work with AC (Sensibo third party).

I'm gonna try your solution!

1 Like

On a subsequent read-through, I notice using the Required Expression has a race condition -- it wouldn't trigger if the A/C turns on after the door opens. If you want to close that, also trigger on A/C turning on, then add as the first statement "If patio door is closed or A/C is off, Exit Rule."

2 Likes

I just tried it and the only quirks left is that, the AC is controlled through Sensibo apps, so every 5 mins, I get the actual value from the AC. Since it's now in Fan Mode, the rule exits.

Then when I finally close the patio door, nothing happens. BUT, if I close the door before the value is updated, then the AC goes back to cooling and it works perfectly.

(Forget the added variable waiting_for_door, it didn't work and I removed it)

First off, I should have explicitly stated to remove the Required Condition -- the first IF block does that job instead. But I'm a little concerned that getting a fanOnly value can trigger the rule -- that isn't one of the triggers you've got set, so it oughtn't do anything. I'm not sure how best to debug that further.

I also notice that this always returns the A/C to cooling, even if it was originally heating.

Yes I'm aware. I want to test the core then add a bit here and there.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.