diff --git a/blueprint.yaml b/blueprint.yaml index 80f78ea..622d545 100644 --- a/blueprint.yaml +++ b/blueprint.yaml @@ -1,54 +1,50 @@ blueprint: - name: Better Thermostat Multi-Mode Controller - description: Steuert Better Thermostat mit Sommer/Winter (Wetterbasiert), Schedule und Urlaubs-Button + 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: z.B. climate.wohnzimmer_bt + description: Die BT Entität (muss Fenstersensoren in BT konfiguriert haben!) selector: entity: domain: climate + integration: better_thermostat schedule_entity: name: Heizzeitplan Schedule - description: z.B. schedule.heizzeitplan_wohnzimmer selector: entity: domain: schedule vacation_helper: name: Urlaubsmodus Helper - description: input_boolean für Urlaub selector: entity: domain: input_boolean weather_entity: name: Wettervorhersage - description: z.B. weather.openweathermap selector: entity: domain: weather summer_temp_threshold: name: Sommer-Schwellwert (°C) - description: Wenn Vorhersage über dieser Temp, Heizung aus - default: 25 + default: 22 selector: number: - min: 20 - max: 35 + min: 15 + max: 30 step: 1 winter_temp_threshold: name: Winter-Schwellwert (°C) - description: Wenn Vorhersage unter dieser Temp, Winter-Modus - default: 10 + description: Unter dieser Temp wird geheizt. + default: 18 selector: number: - min: 0 - max: 20 + min: 10 + max: 25 step: 1 eco_temp: name: Eco Temperatur (°C) - description: Temperatur bei Abwesenheit/Urlaub - default: 15 + default: 16 selector: number: min: 10 @@ -56,7 +52,6 @@ blueprint: step: 0.5 comfort_temp: name: Komfort Temperatur (°C) - description: Temperatur wenn Schedule aktiv default: 21 selector: number: @@ -71,13 +66,19 @@ trigger: 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 @@ -87,14 +88,24 @@ action: comfort_temperature: !input comfort_temp - variables: - weather_temp: '{{ state_attr(weather_entity, ''temperature'') | float(15) }}' + 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 }}" - is_winter: "{{ weather_temp < winter_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 @@ -122,10 +133,10 @@ action: data: temperature: "{{ eco_temperature }}" - # Priorität 3: Winter + Schedule aktiv (Komfort) + # Priorität 3: Heizsaison + Schedule aktiv (Komfort) - conditions: - condition: template - value_template: "{{ is_winter and schedule_active }}" + value_template: "{{ is_heating_season and schedule_active }}" sequence: - service: climate.set_hvac_mode target: @@ -138,10 +149,10 @@ action: data: temperature: "{{ comfort_temperature }}" - # Priorität 4: Winter ohne Schedule (reduzierte Temp) + # Priorität 4: Heizsaison ohne Schedule (Absenkung) - conditions: - condition: template - value_template: "{{ is_winter and not schedule_active }}" + value_template: "{{ is_heating_season and not schedule_active }}" sequence: - service: climate.set_hvac_mode target: @@ -152,9 +163,9 @@ action: target: entity_id: !input better_thermostat_entity data: - temperature: "{{ eco_temperature + 2 }}" - - default: [] + temperature: "{{ eco_temperature }}" + # Habe "+ 2" entfernt, da es unklar war. Lieber "Eco" nehmen oder eine eigene Variable "Comfort_Eco" einführen. -mode: queued -max: 10 + default: [] +mode: restart +max: 10 \ No newline at end of file