diff --git a/blueprints/automation/klima_dry_control.yaml b/blueprints/automation/klima_dry_control.yaml index 7ce89c4..52dce79 100644 --- a/blueprints/automation/klima_dry_control.yaml +++ b/blueprints/automation/klima_dry_control.yaml @@ -6,7 +6,7 @@ blueprint: Luftfeuchtigkeit und geschlossenen Fenstern/Türen. Bricht ab, sobald ein Fenster oder eine Tür geöffnet wird, und setzt die Klimaanlage danach auf den vorherigen Modus zurück. Optional: Push-Benachrichtigung - beim Start und Ende mit aktuellem Feuchtigkeitswert. + beim Start, Ende und wenn die Entfeuchtung nicht nötig ist. domain: automation input: dehumidify_switch: @@ -99,79 +99,110 @@ trigger: entity_id: !input dehumidify_switch to: "on" -condition: - - condition: template - value_template: > - {{ states(humidity_sensor) | float(0) > humidity_threshold | float(0) }} - - - condition: template - value_template: > - {{ expand(contact_sensors) - | selectattr('state', 'eq', 'on') - | list - | count == 0 }} - action: - - service: climate.set_hvac_mode - target: - entity_id: !input climate_entity - data: - hvac_mode: dry - - - if: - - condition: template - value_template: "{{ notify_target != '' }}" - then: - - service: "{{ notify_target }}" - data: - title: "💧 Entfeuchtung gestartet" - message: > - {{ room_name }}: Klimaanlage läuft im Dry-Modus für {{ duration_minutes }} Minuten. - Aktuelle Luftfeuchtigkeit: {{ states(humidity_sensor) | round(1) }} % - - - wait_for_trigger: - - platform: template - value_template: > - {{ expand(contact_sensors) - | selectattr('state', 'eq', 'on') - | list - | count > 0 }} - timeout: - minutes: !input duration_minutes - continue_on_timeout: true - - choose: + - conditions: - condition: template value_template: > - {{ previous_mode in ['off', 'heat', 'cool', 'heat_cool', 'auto', 'fan_only'] }} + {{ states(humidity_sensor) | float(0) <= humidity_threshold | float(0) }} sequence: - - service: climate.set_hvac_mode + - if: + - condition: template + value_template: "{{ notify_target != '' }}" + then: + - service: "{{ notify_target }}" + data: + title: "👍 Entfeuchtung nicht nötig" + message: > + {{ room_name }}: Luftfeuchtigkeit ist in Ordnung ({{ states(humidity_sensor) | round(1) }} % — Grenzwert {{ humidity_threshold }} %). + - service: input_boolean.turn_off target: - entity_id: !input climate_entity - data: - hvac_mode: "{{ previous_mode }}" + entity_id: !input dehumidify_switch + + - conditions: + - condition: template + value_template: > + {{ expand(contact_sensors) + | selectattr('state', 'eq', 'on') + | list + | count > 0 }} + sequence: + - if: + - condition: template + value_template: "{{ notify_target != '' }}" + then: + - service: "{{ notify_target }}" + data: + title: "🪟 Entfeuchtung abgebrochen" + message: > + {{ room_name }}: Fenster oder Tür ist geöffnet – Entfeuchtung nicht gestartet. + Aktuelle Luftfeuchtigkeit: {{ states(humidity_sensor) | round(1) }} % + - service: input_boolean.turn_off + target: + entity_id: !input dehumidify_switch + default: - service: climate.set_hvac_mode target: entity_id: !input climate_entity data: - hvac_mode: "off" + hvac_mode: dry - - if: - - condition: template - value_template: "{{ notify_target != '' }}" - then: - - service: "{{ notify_target }}" - data: - title: "✅ Entfeuchtung beendet" - message: > - {{ room_name }}: Klimaanlage wurde zurückgesetzt. - Aktuelle Luftfeuchtigkeit: {{ states(humidity_sensor) | round(1) }} % + - if: + - condition: template + value_template: "{{ notify_target != '' }}" + then: + - service: "{{ notify_target }}" + data: + title: "💧 Entfeuchtung gestartet" + message: > + {{ room_name }}: Klimaanlage läuft im Dry-Modus für {{ duration_minutes }} Minuten. + Aktuelle Luftfeuchtigkeit: {{ states(humidity_sensor) | round(1) }} % - - service: input_boolean.turn_off - target: - entity_id: !input dehumidify_switch + - wait_for_trigger: + - platform: template + value_template: > + {{ expand(contact_sensors) + | selectattr('state', 'eq', 'on') + | list + | count > 0 }} + timeout: + minutes: !input duration_minutes + continue_on_timeout: true + + - choose: + - conditions: + - condition: template + value_template: > + {{ previous_mode in ['off', 'heat', 'cool', 'heat_cool', 'auto', 'fan_only'] }} + sequence: + - service: climate.set_hvac_mode + target: + entity_id: !input climate_entity + data: + hvac_mode: "{{ previous_mode }}" + default: + - service: climate.set_hvac_mode + target: + entity_id: !input climate_entity + data: + hvac_mode: "off" + + - if: + - condition: template + value_template: "{{ notify_target != '' }}" + then: + - service: "{{ notify_target }}" + data: + title: "✅ Entfeuchtung beendet" + message: > + {{ room_name }}: Klimaanlage wurde zurückgesetzt. + Aktuelle Luftfeuchtigkeit: {{ states(humidity_sensor) | round(1) }} % + + - service: input_boolean.turn_off + target: + entity_id: !input dehumidify_switch mode: single max_exceeded: silent