92 lines
2.4 KiB
YAML
92 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
|
|
|
|
variables:
|
|
thermostat_name: !input climate_target
|
|
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_tiziano_iphone15pro
|
|
# metadata: {}
|
|
# data:
|
|
# message: >
|
|
# {{ thermostat_name }} - OFF
|
|
# title: Heat Save Control
|
|
# 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_tiziano_iphone15pro
|
|
# metadata: {}
|
|
# data:
|
|
# message: >
|
|
# {{ thermostat_name }} - ON
|
|
# title: Heat Save Control
|
|
|
|
default:
|
|
sequence:
|
|
- action: notify.mobile_app_tiziano_iphone15pro
|
|
metadata: {}
|
|
data:
|
|
title: Heat Save Control ERROR
|
|
message: >
|
|
Bad Conditions state {{ states( sensor_status ) }}
|