Files
home-assistant/blueprints/automation/homeassistant/heat_save.yaml

90 lines
2.4 KiB
YAML

blueprint:
name: climate_heat_save
description: Turn off climate (thermostat) because of open window
domain: automation
author: Tiziano Trabattoni
input:
window_sensor:
name: Window Status
description: Identifies the Window Sensor Device for Opened Status
selector:
entity:
filter:
- device_class: door
domain: binary_sensor
climate_target:
name: Termostat Control
description: Identifies the Thermostat climate to control
selector:
entity:
filter:
- domain: climate
ext_temp_limit:
name: Temperature range active
description: Identifies the temperature max that enable the saving
default: 18
selector:
number:
min: 0
max: 30
# binary_sensor.bagnoovest_finestra_contact
triggers:
- trigger: state
entity_id: !input window_sensor
for: 00:00:30
trigger_variables:
sensor_status: !input window_sensor
conditions:
- condition: numeric_state
entity_id: sensor.esterno_temperature
below: !input ext_temp_limit
actions:
- choose:
# if finestra is open
- conditions: >
{{ is_state( sensor_status, 'on' ) }}
sequence:
- action: climate.set_hvac_mode
metadata: {}
data:
hvac_mode: "off"
target:
entity_id: !input climate_target
- action: notify.mobile_app_ttrabatt_iphone15
metadata: {}
data:
message: >
Thermostat OFF
title: HA template 'heat_save' DEBUG
# if finestra is closed
- conditions: >
{{ is_state( sensor_status, 'off') }}
sequence:
- action: climate.set_hvac_mode
metadata: {}
data:
hvac_mode: "heat"
target:
entity_id: !input climate_target
- action: notify.mobile_app_ttrabatt_iphone15
metadata: {}
data:
message: >
Thermostat HEAT
title: HA template 'heat_save' DEBUG
default:
sequence:
- action: notify.mobile_app_ttrabatt_iphone15
metadata: {}
data:
title: HA template 'heat_save' ERROR
message: >
Bad Conditions state {{ states( sensor_status ) }}