homeassistant/blueprints/automation/klima_dry_control.yaml

245 lines
7.9 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

blueprint:
name: Raum entfeuchten (Klimaanlage Dry-Modus)
description: >
Schaltet eine Klimaanlage für eine einstellbare Zeit in den Dry-Modus,
wenn ein Helfer-Schalter aktiviert wird. Startet nur bei ausreichender
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, Ende und wenn die Entfeuchtung nicht nötig ist.
domain: automation
input:
dehumidify_switch:
name: Entfeuchten-Schalter
description: input_boolean, der die Entfeuchtung startet (z. B. input_boolean.schlafzimmer_entfeuchten)
selector:
entity:
domain: input_boolean
climate_entity:
name: Klimaanlage
description: Climate-Entität, die in den Dry-Modus geschaltet wird
selector:
entity:
domain: climate
humidity_sensor:
name: Luftfeuchtigkeitssensor
description: Sensor mit device_class humidity (Wert in %)
selector:
entity:
domain: sensor
device_class: humidity
humidity_threshold:
name: Feuchtigkeitsgrenzwert (%)
description: Entfeuchtung startet nur, wenn die Luftfeuchtigkeit diesen Wert überschreitet
default: 60
selector:
number:
min: 30
max: 100
step: 1
unit_of_measurement: "%"
mode: slider
contact_sensors:
name: Fenster- und Türsensoren
description: Alle Sensoren müssen geschlossen sein (off = geschlossen). Bei geöffnetem Sensor wird abgebrochen.
selector:
entity:
domain: binary_sensor
device_class:
- window
- door
- opening
multiple: true
duration_minutes:
name: Laufzeit (Minuten)
description: Wie lange die Klimaanlage im Dry-Modus laufen soll
default: 10
selector:
number:
min: 1
max: 60
step: 1
unit_of_measurement: min
mode: slider
cancel_delay_seconds:
name: Verzögerung beim Abbruch (Sekunden)
description: >
Wie lange der Schalter auf ON bleibt, bevor er bei "nicht nötig" oder
"Fenster offen" zurückgesetzt wird. Gibt dem Nutzer Zeit, den Status zu sehen.
default: 5
selector:
number:
min: 0
max: 60
step: 1
unit_of_measurement: s
mode: slider
room_name:
name: Raumname
description: Wird in der Push-Nachricht angezeigt (z. B. Schlafzimmer)
default: Raum
selector:
text:
notify_target_1:
name: Benachrichtigungsgerät 1 (optional)
description: Erstes Gerät für Push-Nachrichten. Leer lassen für keine Benachrichtigung.
default: ""
selector:
notify:
notify_target_2:
name: Benachrichtigungsgerät 2 (optional)
description: Zweites Gerät für Push-Nachrichten (optional).
default: ""
selector:
notify:
variables:
dehumidify_switch: !input dehumidify_switch
climate_entity: !input climate_entity
humidity_sensor: !input humidity_sensor
humidity_threshold: !input humidity_threshold
contact_sensors: !input contact_sensors
duration_minutes: !input duration_minutes
cancel_delay_seconds: !input cancel_delay_seconds
room_name: !input room_name
notify_target_1: !input notify_target_1
notify_target_2: !input notify_target_2
notify_target: >
{{ [notify_target_1, notify_target_2] | select('ne', '') | list }}
previous_mode: "{{ state_attr(climate_entity, 'hvac_mode') | default(states(climate_entity)) }}"
start_humidity: "{{ states(humidity_sensor) | round(1) }}"
trigger:
- platform: state
entity_id: !input dehumidify_switch
to: "on"
action:
- choose:
- conditions:
- condition: template
value_template: >
{{ states(humidity_sensor) | float(0) <= humidity_threshold | float(0) }}
sequence:
- if:
- condition: template
value_template: "{{ notify_target | length > 0 }}"
then:
- service: notify.send_message
target:
entity_id: "{{ notify_target }}"
data:
title: "👍 Entfeuchtung nicht nötig"
message: >
{{ room_name }}: Luftfeuchtigkeit ist in Ordnung ({{ states(humidity_sensor) | round(1) }} % — Grenzwert {{ humidity_threshold }} %).
- delay:
seconds: "{{ cancel_delay_seconds }}"
- service: input_boolean.turn_off
target:
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 | length > 0 }}"
then:
- service: notify.send_message
target:
entity_id: "{{ 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) }} %
- delay:
seconds: "{{ cancel_delay_seconds }}"
- 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: dry
- if:
- condition: template
value_template: "{{ notify_target | length > 0 }}"
then:
- service: notify.send_message
target:
entity_id: "{{ 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'] }}
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 | length > 0 }}"
then:
- service: notify.send_message
target:
entity_id: "{{ notify_target }}"
data:
title: "✅ Entfeuchtung beendet"
message: >
{{ room_name }}: Klimaanlage wurde zurückgesetzt.
Vorher: {{ start_humidity }} % → Jetzt: {{ states(humidity_sensor) | round(1) }} %
({{ '%+.1f' | format(states(humidity_sensor) | float - start_humidity | float) }} %)
- service: input_boolean.turn_off
target:
entity_id: !input dehumidify_switch
mode: single
max_exceeded: silent