Add notification when humidity is already OK or window is open
This commit is contained in:
parent
7e0d6193ad
commit
5300c9cf3c
1 changed files with 91 additions and 60 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue