refactoring and warning notification
This commit is contained in:
@@ -178,6 +178,21 @@ variables:
|
|||||||
{% else %}
|
{% else %}
|
||||||
{{ away_temperature }}
|
{{ away_temperature }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
is_valid_temperature: >
|
||||||
|
{{ target_temperature is not none and target_temperature | is_number }}
|
||||||
|
scheduler_mismatch: >
|
||||||
|
{% set selected_friendly_name = states(active_scheduler_selector) %}
|
||||||
|
{% if selected_friendly_name not in ['unknown', '', none] %}
|
||||||
|
{% set found = namespace(value=false) %}
|
||||||
|
{% for schedule in radiator_schedules %}
|
||||||
|
{% if state_attr(schedule, 'friendly_name') == selected_friendly_name %}
|
||||||
|
{% set found.value = true %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
{{ not found.value }}
|
||||||
|
{% else %}
|
||||||
|
false
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
triggers:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
@@ -257,7 +272,7 @@ actions:
|
|||||||
- if:
|
- if:
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: >
|
value_template: >
|
||||||
{{ target_temperature is not none and target_temperature | is_number }}
|
{{ is_valid_temperature }}
|
||||||
then:
|
then:
|
||||||
- service: climate.set_temperature
|
- service: climate.set_temperature
|
||||||
target:
|
target:
|
||||||
@@ -314,7 +329,7 @@ actions:
|
|||||||
- if:
|
- if:
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: >
|
value_template: >
|
||||||
{{ target_temperature is not none and target_temperature | is_number }}
|
{{ is_valid_temperature }}
|
||||||
then:
|
then:
|
||||||
- service: climate.set_temperature
|
- service: climate.set_temperature
|
||||||
target:
|
target:
|
||||||
@@ -378,13 +393,29 @@ actions:
|
|||||||
- if:
|
- if:
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: >
|
value_template: >
|
||||||
{{ target_temperature is not none and target_temperature | is_number }}
|
{{ is_valid_temperature }}
|
||||||
then:
|
then:
|
||||||
- service: climate.set_temperature
|
- service: climate.set_temperature
|
||||||
target:
|
target:
|
||||||
entity_id: !input trv
|
entity_id: !input trv
|
||||||
data:
|
data:
|
||||||
temperature: "{{ target_temperature | float }}"
|
temperature: "{{ target_temperature | float }}"
|
||||||
|
# Notification bei Scheduler-Mismatch
|
||||||
|
- if:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ scheduler_mismatch and trigger.id == 'SCHEDULER_CHANGED' }}"
|
||||||
|
then:
|
||||||
|
- service: persistent_notification.create
|
||||||
|
data:
|
||||||
|
title: "⚠️ Radiator Control - Scheduler nicht gefunden"
|
||||||
|
message: >
|
||||||
|
Der ausgewählte Scheduler '{{ states(active_scheduler_selector) }}' wurde nicht in der
|
||||||
|
Scheduler-Liste gefunden.
|
||||||
|
|
||||||
|
TRV '{{ state_attr(trv, 'friendly_name') }}' nutzt Fallback-Temperatur: {{ away_temperature }}°C
|
||||||
|
|
||||||
|
Bitte Konfiguration überprüfen.
|
||||||
|
notification_id: "radiator_control_scheduler_mismatch_{{ trv }}"
|
||||||
alias: Setze Solltemperatur
|
alias: Setze Solltemperatur
|
||||||
alias: Solltemperatur bei Änderungen
|
alias: Solltemperatur bei Änderungen
|
||||||
alias: Aktionen während Heizperiode
|
alias: Aktionen während Heizperiode
|
||||||
|
|||||||
Reference in New Issue
Block a user