BetterHeating_nocci/blueprint.yaml

171 lines
No EOL
5.4 KiB
YAML

blueprint:
name: Better Thermostat Multi-Mode Controller (Window Aware)
description: Steuert Better Thermostat mit Fenster-Check, Sommer/Winter, Schedule und Urlaub.
domain: automation
input:
better_thermostat_entity:
name: Better Thermostat Entity
description: Die BT Entität (muss Fenstersensoren in BT konfiguriert haben!)
selector:
entity:
domain: climate
integration: better_thermostat
schedule_entity:
name: Heizzeitplan Schedule
selector:
entity:
domain: schedule
vacation_helper:
name: Urlaubsmodus Helper
selector:
entity:
domain: input_boolean
weather_entity:
name: Wettervorhersage
selector:
entity:
domain: weather
summer_temp_threshold:
name: Sommer-Schwellwert (°C)
default: 22
selector:
number:
min: 15
max: 30
step: 1
winter_temp_threshold:
name: Winter-Schwellwert (°C)
description: Unter dieser Temp wird geheizt.
default: 18
selector:
number:
min: 10
max: 25
step: 1
eco_temp:
name: Eco Temperatur (°C)
default: 16
selector:
number:
min: 10
max: 18
step: 0.5
comfort_temp:
name: Komfort Temperatur (°C)
default: 21
selector:
number:
min: 18
max: 24
step: 0.5
trigger:
- platform: state
entity_id: !input schedule_entity
- platform: state
entity_id: !input vacation_helper
- platform: state
entity_id: !input weather_entity
attribute: temperature # Nur triggern, wenn sich die Temperatur ändert, nicht bei jedem Wetter-Update
- platform: time_pattern
minutes: "/30"
# Wir triggern auch, wenn BT sich ändert (z.B. Fenster geht zu), um sofort wieder zu heizen
- platform: state
entity_id: !input better_thermostat_entity
attribute: window_open
condition: []
action:
- variables:
bt_entity: !input better_thermostat_entity
weather_entity: !input weather_entity
schedule_entity: !input schedule_entity
vacation_entity: !input vacation_helper
summer_threshold: !input summer_temp_threshold
winter_threshold: !input winter_temp_threshold
eco_temperature: !input eco_temp
comfort_temperature: !input comfort_temp
- variables:
weather_temp: '{{ state_attr(weather_entity, "temperature") | float(15) }}'
# Prüfen, ob BT sagt, dass ein Fenster offen ist
is_window_open: '{{ state_attr(bt_entity, "window_open") | bool(false) }}'
is_summer: "{{ weather_temp > summer_threshold }}"
# Winter ist alles, was NICHT Sommer ist (um Lücken zu vermeiden), oder explizit definiert
is_heating_season: "{{ weather_temp < winter_threshold }}"
is_vacation: "{{ states(vacation_entity) == 'on' }}"
schedule_active: "{{ states(schedule_entity) == 'on' }}"
- choose:
# Priorität 0: FENSTER OFFEN -> Sofort Stop, nichts tun.
# Better Thermostat kümmert sich um das Abschalten. Wir verhindern nur das Anschalten.
- conditions:
- condition: template
value_template: "{{ is_window_open }}"
sequence:
- stop: "Fenster ist offen - Automation bricht ab und lässt BT die Kontrolle."
# Priorität 1: Sommer-Modus (Heizung aus)
- conditions:
- condition: template
value_template: "{{ is_summer }}"
sequence:
- service: climate.set_hvac_mode
target:
entity_id: !input better_thermostat_entity
data:
hvac_mode: "off"
# Priorität 2: Urlaubsmodus (Eco)
- conditions:
- condition: template
value_template: "{{ is_vacation }}"
sequence:
- service: climate.set_hvac_mode
target:
entity_id: !input better_thermostat_entity
data:
hvac_mode: "heat"
- service: climate.set_temperature
target:
entity_id: !input better_thermostat_entity
data:
temperature: "{{ eco_temperature }}"
# Priorität 3: Heizsaison + Schedule aktiv (Komfort)
- conditions:
- condition: template
value_template: "{{ is_heating_season and schedule_active }}"
sequence:
- service: climate.set_hvac_mode
target:
entity_id: !input better_thermostat_entity
data:
hvac_mode: "heat"
- service: climate.set_temperature
target:
entity_id: !input better_thermostat_entity
data:
temperature: "{{ comfort_temperature }}"
# Priorität 4: Heizsaison ohne Schedule (Absenkung)
- conditions:
- condition: template
value_template: "{{ is_heating_season and not schedule_active }}"
sequence:
- service: climate.set_hvac_mode
target:
entity_id: !input better_thermostat_entity
data:
hvac_mode: "heat"
- service: climate.set_temperature
target:
entity_id: !input better_thermostat_entity
data:
temperature: "{{ eco_temperature }}"
# Habe "+ 2" entfernt, da es unklar war. Lieber "Eco" nehmen oder eine eigene Variable "Comfort_Eco" einführen.
default: []
mode: restart
max: 10