It is a simple and useful automation. After a defined delay it turns off a running climate entity and waits for the window to be closed again (also with a delay) until it turns the device back to the previous set HAVC mode. If you need you can optionally also define custom actions for opening and closing e.g. for notifications, blind/ cover control, etc.
Reduce heating costs
It prevents the entity of excessive heating and/or cooling while a window is open and also helps to reduce CO2 and your carbon dioxid footprint. I primary use it to reduce costs and raise thermal efficiency as well as personal comfort.
Supported modes
It checks if a climate device is running in any mode (not “off”) - in other words it triggers if any of the following modes is active: automatic, auto heat, heat_cool, dry and fan_only. Therefore, it is not limited to heat devices and also works with Air Conditioner, Air Ventilation and other climate devices.
Delay
You can also set a minimum open time
and a minimum close time
before the automation triggers and moves on to the next step.
Optional: Custom actions
Some of you have the need to perform additional actions like notification, adjusting the light, setting timer etc. Thanks for the feedback - this feature is also availible now!
Custom action example: Blind control
In this post I have explained how you additionaly can control your blinds. The blinds are opened after the window has been opened and closes again to the previous position (but you need an additional helper) Window open, climate off - #154 by SmartLiving.Rocks
More than one window sensor?
Use Group Helper!
Now you can use helpers in order to create a group sensor. Go to Helpers (you can use the link to navigate there). In the lower right corner you choose Create Helper
, then you choose Group
and then you click on Binary Sensor group
and add all the needed window sensors. Click Submit
and it will create a new window group sensor that can be used with this Blueprint
Use yaml!
If you want to use yaml see this post here how to create a group sensor: Window open, climate off - #88 by SmartLiving.Rocks
Important
This blueprint only works for Home Assistant 2022.4 and later. For users running an earlier version, you need to import it from GitHub.
IMPORTANT notice for HomematicIP users - HomematicIP Blueprint from @sota - click here!
HomematicIP uses a service call homematic.set_device_value to set the WINDOW_STATE parameter directly, so it emulates the operation of HomematicIP door/window sensor. Thanks to @sota
UPDATED Version: Now it supports different HAVC modes: automatic, auto heat, heat_cool, dry, fan_only and off - if you need more please let me know
Changelog and information for Homematic Users
IMPORTANT notice for HOMEMATIC and TADO users this modified version of the blueprint now works right away also for you. No need to import it from GitHub! Tado Blueprint on Github - click here!
Important notice: If you have to restart Home Assistant for any reasons it will probably kill the automation. “Delay” and “Wait for” triggers will not be recognized after a restart and it can result in a strange behavior as @NicoLeOca has experienced and described in his post!
UPDATE: Thanks to @Soccs we have added a condition that checks if the climate device is running before the automation triggers! It is not specific for MELCloud users as some other climate devices also have more active states!
UPDATE: Now you can also define a minimum time in seconds before the automation is triggered. Good idea from @ferryhel ! Thanks
Blueprint
Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)
Or import this Blueprint by using the forum topic URL:
blueprint:
name: Window open, climate off after a defined time
description: 'Climate device like heating and cooling devices (if active) are turned
off and go back to the previous set stage after the windows is closed again. You can also define a time before the
climate device turns back to its previous state. Now it supports several heating modes and different vendors like Tado. The supported
HAVC modes are: automatic, auto, heat, heat_cool and off. If you need more please
let me know. Happy automating!'
domain: automation
input:
window_entity:
name: Window Sensor
description: The window sensor that controls the climate entity. If you have
more window sensors please make a group sensor.
selector:
entity:
domain: binary_sensor
device_class: window
multiple: false
minimum_open_time:
name: Miniumum open time
description: Time in seconds to wait until the automation is triggered
default: 12
selector:
number:
min: 0.0
max: 120.0
unit_of_measurement: seconds
mode: slider
step: 1.0
minimum_close_time:
name: Miniumum close time
description: Time in seconds to wait until the climate entity is turned on again
default: 12
selector:
number:
min: 0.0
max: 300.0
unit_of_measurement: seconds
mode: slider
step: 1.0
climate_target:
name: Climate Device
description: The climate entity that is controlled by the window sensor.
selector:
entity:
domain: climate
multiple: false
open_action:
name: Additional Open Action (Optional)
description: Action to perform if the door/window sensor is opened (e.g. open
blind, tts announcement)
default: []
selector:
action: {}
close_action:
name: Additional Close Action (Optional)
description: Action to perform if the door/window sensor is cloed again (e.g.
close blind, tts announcement)
default: []
selector:
action: {}
variables:
open_action: !input open_action
close_action: !input close_action
mode: single
trigger:
- platform: state
entity_id: !input window_entity
to: 'on'
for: !input minimum_open_time
condition:
- condition: not
conditions:
- condition: state
entity_id: !input climate_target
state: 'off'
action:
- choose:
- conditions:
- condition: state
entity_id: !input climate_target
state: cool
sequence:
- service: climate.turn_off
target:
entity_id: !input climate_target
- choose:
- conditions: '{{ open_action is defined and open_action|length > 0 }}'
sequence: !input open_action
- wait_for_trigger:
- platform: state
entity_id: !input window_entity
to: 'off'
continue_on_timeout: false
- delay: !input minimum_close_time
- choose:
- conditions: '{{ close_action is defined and close_action|length > 0 }}'
sequence: !input close_action
- service: climate.set_hvac_mode
target:
entity_id: !input climate_target
data:
hvac_mode: cool
- conditions:
- condition: state
entity_id: !input climate_target
state: heat_cool
sequence:
- service: climate.turn_off
target:
entity_id: !input climate_target
- choose:
- conditions: '{{ open_action is defined and open_action|length > 0 }}'
sequence: !input open_action
- wait_for_trigger:
- platform: state
entity_id: !input window_entity
to: 'off'
continue_on_timeout: false
- delay: !input minimum_close_time
- choose:
- conditions: '{{ close_action is defined and close_action|length > 0 }}'
sequence: !input close_action
- service: climate.set_hvac_mode
target:
entity_id: !input climate_target
data:
hvac_mode: heat_cool
- conditions:
- condition: state
entity_id: !input climate_target
state: heat
sequence:
- service: climate.turn_off
target:
entity_id: !input climate_target
- choose:
- conditions: '{{ open_action is defined and open_action|length > 0 }}'
sequence: !input open_action
- wait_for_trigger:
- platform: state
entity_id: !input window_entity
to: 'off'
continue_on_timeout: false
- delay: !input minimum_close_time
- choose:
- conditions: '{{ close_action is defined and close_action|length > 0 }}'
sequence: !input close_action
- service: climate.set_hvac_mode
data:
hvac_mode: heat
target:
entity_id: !input climate_target
- conditions:
- condition: state
entity_id: !input climate_target
state: automatic
sequence:
- service: climate.turn_off
target:
entity_id: !input climate_target
- choose:
- conditions: '{{ open_action is defined and open_action|length > 0 }}'
sequence: !input open_action
- wait_for_trigger:
- platform: state
entity_id: !input window_entity
to: 'off'
continue_on_timeout: false
- delay: !input minimum_close_time
- choose:
- conditions: '{{ close_action is defined and close_action|length > 0 }}'
sequence: !input close_action
- service: climate.set_hvac_mode
data:
hvac_mode: automatic
target:
entity_id: !input climate_target
- conditions:
- condition: state
entity_id: !input climate_target
state: auto
sequence:
- service: climate.turn_off
target:
entity_id: !input climate_target
- choose:
- conditions: '{{ open_action is defined and open_action|length > 0 }}'
sequence: !input open_action
- wait_for_trigger:
- platform: state
entity_id: !input window_entity
to: 'off'
continue_on_timeout: false
- delay: !input minimum_close_time
- choose:
- conditions: '{{ close_action is defined and close_action|length > 0 }}'
sequence: !input close_action
- service: climate.set_hvac_mode
data:
hvac_mode: auto
target:
entity_id: !input climate_target
- conditions:
- condition: state
entity_id: !input climate_target
state: dry
sequence:
- service: climate.turn_off
target:
entity_id: !input climate_target
- choose:
- conditions: '{{ open_action is defined and open_action|length > 0 }}'
sequence: !input open_action
- wait_for_trigger:
- platform: state
entity_id: !input window_entity
to: 'off'
continue_on_timeout: false
- delay: !input minimum_close_time
- choose:
- conditions: '{{ close_action is defined and close_action|length > 0 }}'
sequence: !input close_action
- service: climate.set_hvac_mode
data:
hvac_mode: dry
target:
entity_id: !input climate_target
- conditions:
- condition: state
entity_id: !input climate_target
state: fan_only
sequence:
- service: climate.turn_off
target:
entity_id: !input climate_target
- choose:
- conditions: '{{ open_action is defined and open_action|length > 0 }}'
sequence: !input open_action
- wait_for_trigger:
- platform: state
entity_id: !input window_entity
to: 'off'
continue_on_timeout: false
- delay: !input minimum_close_time
- choose:
- conditions: '{{ close_action is defined and close_action|length > 0 }}'
sequence: !input close_action
- service: climate.set_hvac_mode
data:
hvac_mode: fan_only
target:
entity_id: !input climate_target