merge temp schedule change #1
@@ -178,6 +178,21 @@ variables:
|
||||
{% else %}
|
||||
{{ away_temperature }}
|
||||
{% 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:
|
||||
- platform: state
|
||||
@@ -257,7 +272,7 @@ actions:
|
||||
- if:
|
||||
- condition: template
|
||||
value_template: >
|
||||
{{ target_temperature is not none and target_temperature | is_number }}
|
||||
{{ is_valid_temperature }}
|
||||
then:
|
||||
- service: climate.set_temperature
|
||||
target:
|
||||
@@ -314,7 +329,7 @@ actions:
|
||||
- if:
|
||||
- condition: template
|
||||
value_template: >
|
||||
{{ target_temperature is not none and target_temperature | is_number }}
|
||||
{{ is_valid_temperature }}
|
||||
then:
|
||||
- service: climate.set_temperature
|
||||
target:
|
||||
@@ -378,13 +393,29 @@ actions:
|
||||
- if:
|
||||
- condition: template
|
||||
value_template: >
|
||||
{{ target_temperature is not none and target_temperature | is_number }}
|
||||
{{ is_valid_temperature }}
|
||||
then:
|
||||
- service: climate.set_temperature
|
||||
target:
|
||||
entity_id: !input trv
|
||||
data:
|
||||
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: Solltemperatur bei Änderungen
|
||||
alias: Aktionen während Heizperiode
|
||||
|
||||
Reference in New Issue
Block a user