Description
When the window opens, lower the temperature of a climate entity instead of changing its HVAC mode.
It stores the original state of the climate entity in a Scene before reducing the temperature so it can restore it after the window is closed.
Ensure to input a unique scene name to avoid overriding an existing one.
I created this blueprint because I have a Danfoss Ally (Zigbee), and this TRV has only one HVAC mode: “heat”.
Tested devices
- Danfoss Ally TRV integrated in HASS via Zigbee2Mqtt
The blueprint
blueprint:
name: Lower temperature when a window opens
description: Lower the HVAC temperature when a window opens. Restart the previous temperature when it closes.
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
climate_target:
description: The climate entity that is controlled by the window sensor
name: Climate Device
selector:
entity:
domain: climate
multiple: false
minimum_open_time:
description: Time in seconds to wait until the automation is triggered
name: Minimum open time
default: 10
selector:
number:
min: 0.0
max: 59.0
unit_of_measurement: seconds
step: 1.0
mode: slider
off_temperature:
description: Temperature to set when the window is open
name: Open window temperature
default: 5
selector:
number:
min: 0.0
max: 21.0
unit_of_measurement: degrees
step: 1.0
mode: slider
scene_id:
name: Scene name to store the initial climate state
selector:
text:
multiline: false
mode: single
variables:
scene_id: !input scene_id
trigger:
- platform: state
entity_id: !input window_entity
to: "on"
for: !input minimum_open_time
action:
- service: scene.create
data:
snapshot_entities: !input climate_target
scene_id: !input scene_id
- service: climate.set_temperature
data:
temperature: !input off_temperature
target:
entity_id: !input climate_target
- wait_for_trigger:
- platform: state
entity_id: !input window_entity
to: "off"
- service: scene.turn_on
target:
entity_id: "scene.{{ scene_id }}"