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
This blueprint takes care about the climate control depending on the status of a window sensor and the HAVC (Heat, Air Ventilation, and Cooling) mode. It checks if a climate device is running in any mode (not “off”) before the automation is triggered.
It is a simple and useful automation. It turns off a running climate entity and waits for the window to be closed again until it turns the device back to the previous set HAVC mode. Therefore, it is not limited to heat devices and also works with Air Conditioner, Air Ventilation and other climate devices.
Modified Version with custom actions
Some of you have the need to perform additional actions like notification, adjusting the light, setting timer etc. Here is a version with the ability to define custom opening and closing actions.
This blueprint only works for Home Assistant 2022.4 and later. For users running an earlier version, you need to import it from GitHub.
More than one sensor?
If you have more than one window sensor in a room that should control the climate entity, please see here how you can group sensors.
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
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. 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
climate_target:
name: Climate Device
description: The climate entity that is controlled by the window sensor.
selector:
entity:
domain: climate
multiple: false
source_url: https://community.home-assistant.io/t/window-open-climate-off/257293
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'
- wait_for_trigger:
- platform: state
entity_id: !input 'window_entity'
to: 'off'
continue_on_timeout: false
- 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'
- wait_for_trigger:
- platform: state
entity_id: !input 'window_entity'
to: 'off'
continue_on_timeout: false
- 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'
- wait_for_trigger:
- platform: state
entity_id: !input 'window_entity'
to: 'off'
continue_on_timeout: false
- 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'
- wait_for_trigger:
- platform: state
entity_id: !input 'window_entity'
to: 'off'
continue_on_timeout: false
- 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'
- wait_for_trigger:
- platform: state
entity_id: !input 'window_entity'
to: 'off'
continue_on_timeout: false
- 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'
- wait_for_trigger:
- platform: state
entity_id: !input 'window_entity'
to: 'off'
continue_on_timeout: false
- 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'
- wait_for_trigger:
- platform: state
entity_id: !input 'window_entity'
to: 'off'
continue_on_timeout: false
- service: climate.set_hvac_mode
data:
hvac_mode: fan_only
target:
entity_id: !input 'climate_target'
It prevents the entity of excessive heating and/or cooling while a window is open. Some people say it helps to reduce CO2. I primary use it to reduce costs and raise thermal efficiency as well as my personal comfort.
Let me know your thoughts on this and in what situations you could imagine using it.