Turn off HVAC/thermostat when window/ door open

For me, the best option it is what you prefer, and if you want to do separately for me it would be perfect.

Thank you for asking this

This is fantastic! Thanks so much for posting it. Iā€™m very new to HA and this has helped tremendously.

Quick question is it possible to have the automation continually monitor the thermostats and turn them off more if they are turned on while the doors are still open?

Iā€™m using this in a vacation rental and guests will often leave the door to the pool open all day and crank the air condition to keep the house cool. Of course when they feel itā€™s warm in the house they lower the temp on the thermostat while keeping the door open.

Hello,
I have tried adding this (would be fantastic as I am migrating to HomeAssistant and it would replicate some logic i had in SmartThings) - however i run into a ā€˜no matching entities foundā€™ for the door and window sensor field.
I initially thought the blueprint simply did not like individual entities, so i created a ā€˜windowsā€™ group with the appropriate sensors in it, but still no joy.
Any thoughts on what i might be missing?

Try following this post replacing the binary_sesnsor entities with your own.

Is it possible to have 2 thermostats change based on group sensor?

I ended up creating 2 blueprints with separate climate_snapshot entities and that solved the problem.

This automation has been great and a previous version of it was working fine for my setup (ecobee thermostat, manual group of binary sensors in YAML for the sensor).

Iā€™m not sure whatā€™s changed, but recently Iā€™m finding my thermostat at odd temperatures or still off despite the time lapsing from what is set to resume.

I just ran two manual tests where I opened one of the doors/windows on the sensor, let it sit 5 min to turn the thermostat off, which it should. But then after closing the door/windows and waiting the 30 seconds, Iā€™m not seeing it kick the system back on correctly.

And then when I wasnā€™t doing actual tests, Iā€™d come back to my thermostat and find it at 2+ degrees and holding over what the normal routine is, even though those values have not been set by the ecobee system or home assistant. There also isnā€™t anything obvious in the logbook that I can find to help this.

Any suggestions or thoughts on how to get this to resume properly? Iā€™m thankful that it stops my system, but I want it to resume after the set period. Iā€™m trying everything to figure out what is wrong and havenā€™t found the solution yet. Any suggestions or ideas would be appreciated. Thanks.

I have noticed this as well. I think it has to do with the snapshot and what can be restored. I donā€™t know if it would be better to create a binary_sensor (heat on/cool off) and an input_select of your comfort settings. I have some off comfort settings, one for workday which would not run on the weekends.

Do we know if this snapshot is really the fault and/or if thereā€™s a known workaround?

Now that itā€™s summer, Iā€™d like to use thisā€¦but trying to figure out how best to make this fool proof and not find myself in a house 5-10 degrees hotter than I want it because it didnā€™t reactivate the system when the door/window was closed. Maybe another automation to check and then re-enable would help?

Is everyone here using an ecobee device? I have tried recreating the problems you are experiencing (Iā€™m also using an ecobee 4) and I am not having any troubles with this. I am updated to the latest version of home assistant.
The only other issue I can think of is if you are restarting home assistant while the automation is in the paused state. Then it will not resume upon re-closure of your door or window.

If using ecobee are you using the ecobee integration or are you using the HomeKit integration to control your ecobee? Iā€™d recommend using the homekit integration as that allows local control as opposed to using cloud control via the ecobee integration.

Iā€™m using an ecobee 3 lite via the ecobee integration, not homekit. Interesting, will try homekit and see how that goes.

The reboot hypothesis doesnā€™t work for my scenario because I was deliberately testing and waiting to see what would happen and reproduced the system not turning back on like it should.

Let me know how that works for you. When I first started using this a couple years ago I had a lot of trouble with the ecobee integration due to the long delays caused by it going through the cloud. Using homekit makes this work almost instantaneously.

The only trouble Iā€™m finding now is it wonā€™t let you select ā€˜0ā€™ for the number inputs with the newer version of home assistant. Iā€™ve already made an updated version with the ā€˜durationā€™ input method I can upload if you can get that working.

Ok, Iā€™ve set it up and will be testing over the next few days.

Question regarding Homekit - did you connect Ecobee to Homekit first and then connect that entity to HA? Or did you setup Ecobee via Homekit directly in HA?

I did the latter, but Iā€™ve noticed some interesting differences already between the ecobee integration and the homekit setup I did, such as the current temperature reported in the climate entity does not show decimal degrees via Homekit, but it does via the direct integration.

I set up the Ecobee via HomeKit directly in HA. Mine also does not display decimals in the temperature, however for me that is a non issue. Also direct from the ecobee support website ā€œThe ecobee temperature sensor has a +/- 1.0F accuracyā€, so I wouldnā€™t trust it myself for anything useful.

Interesting. So what temperature sensor do you use to help regulate your climate that ecobee is trying to maintain?

Perhaps I worded that poorly. I use the ecobee and the ecobee remote sensors for monitoring temperature, but I would not attempt to control to within a tenth of a degree considering the accuracy is +/- 1.0

This looks pretty nice, thanks for posting, Iā€™m going to give it a try. One thing I think Iā€™m going to add in as well is pushing a notification to the Ecobee screen itself. Iā€™ve done this manually before when my wife leaves the windows open and tries to run the AC. I remotely turn it off and send: ā€œAC or Windows, pick one!ā€ which results in sensor.wife_amusement=0

Something like that would also be useful in a VRBO where the tourons are oblivious.

Update: Looks like this doesnā€™t work with the ā€œNew style groupsā€ in HA which can be managed via the UI or YAML.

This integration will only detect " Old style groups" via yaml, and I was able to get this working using something like this in my configuration.yaml.

group:
  climate_impacting_doors_and_windows:
    name: "Climate impacting doors and windows"
    entities:
      - binary_sensor.front_door_sensor_2
      ...

Docs on this topic: Group - Home Assistant

Is there anyway to make this persist across restarts?

I like to update home assistant while I am home and available, and today I had the windows open all day and it didnā€™t resume when I closed in the evening.

Is this a general home assistant state issue with automations or specifically this blueprint?

Seems like my code is starting to become datedā€¦ I havenā€™t been messing with home assistant too much so Iā€™ll look into the new style groups from your previous comment. As far as making it persistent across restarts unless there has been some updates that make it easier there is not really a nice way to make it persistent using a blueprint. To make it persistent you would have to create a couple state values that track the status of the HVAC system and last time I checked I canā€™t include that in a blueprint. I have done it that way and can help you, itā€™s just a lot more custom and not terribly user friendly. Iā€™ll also look into the newer versions of home assistant and see if maybe something was added that lets me create a simple blueprint you can download.

Edit: Unfortunately looking through the updates it appears the same problem exists if you are updating or restarting home assistant. The problem is the automations and created scenes are not persistent through a restart but adding the variables is still a usable workaround it just canā€™t be included directly in the blueprint. This is an excerpt from the scenes documentation that highlights the issues. (Also they have a new example of doing what my blueprint does that wasnā€™t there before, kind of funny.)

" Create a new scene without having to configure it by calling the scene.create service. This scene will be discarded after reloading the configuration."