Automatic AC Control via Window Sensors


New to Hubitat, I had this automation working in WebCore under ST, but looking for advice.

I want my AC to turn to "off" any time a door/window is open for 1 minute. If all doors/windows close for 1 minute+, I want the AC to be back on "auto".

Here's what I have, that seemed to briefly work, but my bug is that if I go outside, it starts the timer down and will quickly trigger off/auto. i.e. it's waiting one minute to turn off and then runs immediately and turns back on.

In WebCore I used "for" (if blah blah is open for xx minutes) with my if/then statements. How can I achieve that with RM?



Still getting my head wrapped around RM4. But I believe the following should work.

Change your Actions to Run as follows:

IF (any contacts open) THEN
    Cancel Delayed Actions
    Set Thermostat mode to OFF -> after a delay of 00:01:00 (cancel)
ELSE // All contacts are closed
    Cancel Delayed Actions
    Set Thermostat mode to AUTO -> after a delay of 00:01:00 (cancel)

Each time the rule is triggered, it first cancels any delayed action, and then schedules a delayed action (thermostat mode change) to run in one minute, with cancel.


Edit: Didn't get the cancel flag set... Trying again.

Yep, that appears to work. I opened a window for less than one minute, and my system stayed running (it did re-issue the "auto" command, but that is OK)


Here's how it looks if anyone comes across this in the future.


Just be careful....if your thermostat doesn't have a "compressor save" or "minimum off time" function then it's possible to cycle the compressor so quickly that it can damage the unit. Most companies say if you turn off the AC it should be off for a minimum of 5 mins before turning it back on again. You might want to lengthen that delay on the else part of your rule.


Noted. This thermostat should have a 4 minute compressor cycle, but I did notice that during this it was changing so fast from Auto > Off > Auto that it wasn't waiting the 4 minutes.

I will delay the ELSE to 4 minutes, ensuring it turns off quickly, but waits 5 minutes (+1) to turn back on.