This blueprint takes care about the climate control depending on the status of a window sensor. It checks if a climate device is running 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 on again (to the last active hvac-mode). It also can be used with Air Conditioner and other climate devices.
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!
IMPORTANT notice for HOMEMATIC users
This Blueprint will not work for you!
The Homematic Thermostat HM-CC-RT-DN and prpably other Homematic thermostats as well cannot handle the service climate.turn_on without doing modification. Please see this post 48 for more detailed information as well as a workaround to get it working!
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
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: An automation that turns off a running your climate device for exmple a heater or an air conditioning if a window sensor is open for a specific time. It waits until the window is closed again in order to turn the climate entity on again. domain: automation input: window_entity: name: Window Sensor description: The window sensor that controls the climate entity. selector: entity: domain: binary_sensor device_class: window minimum_open_time: name: Miniumum time the window is open 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 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: - service: climate.turn_off entity_id: !input 'climate_target' - wait_for_trigger: - platform: state entity_id: !input 'window_entity' to: 'off' continue_on_timeout: false - service: climate.turn_on 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.