adjust structure

This commit is contained in:
2025-11-24 18:29:07 +01:00
parent 2b6c5b29d9
commit 1f0a485b89

View File

@@ -51,77 +51,77 @@ blueprint:
- domain: sensor - domain: sensor
device_class: temperature device_class: temperature
triggers: triggers:
- trigger: state - trigger: state
entity_id: entity_id:
- !input window_sensor - !input window_sensor
from: "off" from: "off"
to: "on" to: "on"
for: !input window_delay_open for: !input window_delay_open
id: FENSTER_OPEN id: FENSTER_OPEN
- trigger: state - trigger: state
entity_id: entity_id:
- !input window_sensor - !input window_sensor
from: "on" from: "on"
to: "off" to: "off"
for: !input window_delay_close for: !input window_delay_close
id: FENSTER_CLOSED id: FENSTER_CLOSED
- platform: time_pattern - platform: time_pattern
minutes: '29' minutes: '29'
id: SYNC_TEMPERATURE id: SYNC_TEMPERATURE
variables: variables:
trv: !input radiator_entity trv: !input radiator_entity
remote_temperature_entity: > remote_temperature_entity: >
{% set entities = device_entities(device_id(trv)) %} {% set entities = device_entities(device_id(trv)) %}
{% set remote_temperature_entity_id = namespace(id='') %} {% set remote_temperature_entity_id = namespace(id='') %}
{% for s in entities %} {% for s in entities %}
{% if 'remote_temperature' in s %} {% if 'remote_temperature' in s %}
{% set remote_temperature_entity_id.id = s %} {% set remote_temperature_entity_id.id = s %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{{ remote_temperature_entity_id.id }} {{ remote_temperature_entity_id.id }}
window_detection_entity: > window_detection_entity: >
{% set entities = device_entities(device_id(trv)) %} {% set entities = device_entities(device_id(trv)) %}
{% set window_detection_entity_id = namespace(id='') %} {% set window_detection_entity_id = namespace(id='') %}
{% for s in entities %} {% for s in entities %}
{% if 'window_detection' in s %} {% if 'window_detection' in s %}
{% set window_detection_entity_id.id = s %} {% set window_detection_entity_id.id = s %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{{ window_detection_entity_id.id }} {{ window_detection_entity_id.id }}
current_temperature: !input temperature_sensor current_temperature: !input temperature_sensor
actions: actions:
- if: - if:
- condition: trigger - condition: trigger
id: id:
- FENSTER_OPEN - FENSTER_OPEN
then: then:
- service: switch.turn_on - service: switch.turn_on
target: target:
entity_id: "{{ window_detection_entity }}" entity_id: "{{ window_detection_entity }}"
alias: Setze Fenster auf offen alias: Setze Fenster auf offen
- if: - if:
- condition: trigger - condition: trigger
id: id:
- FENSTER_CLOSED - FENSTER_CLOSED
then: then:
- service: switch.turn_off - service: switch.turn_off
target: target:
entity_id: "{{ window_detection_entity }}" entity_id: "{{ window_detection_entity }}"
alias: Setze Fenster auf geschlossen alias: Setze Fenster auf geschlossen
# temperature sensor sync # temperature sensor sync
- if: - if:
- condition: trigger - condition: trigger
id: id:
- FENSTER_OPEN - FENSTER_OPEN
- FENSTER_CLOSED - FENSTER_CLOSED
- SYNC_TEMPERATURE - SYNC_TEMPERATURE
then: then:
- service: number.set_value - service: number.set_value
data: data:
value: "{{ states(current_temperature) | float }}" value: "{{ states(current_temperature) | float }}"
target: target:
entity_id: "{{ remote_temperature_entity }}" entity_id: "{{ remote_temperature_entity }}"
alias: Sync remote temperature sensor alias: Sync remote temperature sensor