From 1f0a485b89fc435a2a40a7cb8acfb46b72de5942 Mon Sep 17 00:00:00 2001 From: Pierre Eisenbrandt Date: Mon, 24 Nov 2025 18:29:07 +0100 Subject: [PATCH] adjust structure --- Climate/bosch_bth-ra_control.yaml | 144 +++++++++++++++--------------- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/Climate/bosch_bth-ra_control.yaml b/Climate/bosch_bth-ra_control.yaml index 0f82a31..513ce10 100644 --- a/Climate/bosch_bth-ra_control.yaml +++ b/Climate/bosch_bth-ra_control.yaml @@ -51,77 +51,77 @@ blueprint: - domain: sensor device_class: temperature - triggers: - - trigger: state - entity_id: - - !input window_sensor - from: "off" - to: "on" - for: !input window_delay_open - id: FENSTER_OPEN - - trigger: state - entity_id: - - !input window_sensor - from: "on" - to: "off" - for: !input window_delay_close - id: FENSTER_CLOSED - - platform: time_pattern - minutes: '29' - id: SYNC_TEMPERATURE +triggers: + - trigger: state + entity_id: + - !input window_sensor + from: "off" + to: "on" + for: !input window_delay_open + id: FENSTER_OPEN + - trigger: state + entity_id: + - !input window_sensor + from: "on" + to: "off" + for: !input window_delay_close + id: FENSTER_CLOSED + - platform: time_pattern + minutes: '29' + id: SYNC_TEMPERATURE - variables: - trv: !input radiator_entity - remote_temperature_entity: > - {% set entities = device_entities(device_id(trv)) %} - {% set remote_temperature_entity_id = namespace(id='') %} - {% for s in entities %} - {% if 'remote_temperature' in s %} - {% set remote_temperature_entity_id.id = s %} - {% endif %} - {% endfor %} - {{ remote_temperature_entity_id.id }} - window_detection_entity: > - {% set entities = device_entities(device_id(trv)) %} - {% set window_detection_entity_id = namespace(id='') %} - {% for s in entities %} - {% if 'window_detection' in s %} - {% set window_detection_entity_id.id = s %} - {% endif %} - {% endfor %} - {{ window_detection_entity_id.id }} - current_temperature: !input temperature_sensor +variables: + trv: !input radiator_entity +remote_temperature_entity: > + {% set entities = device_entities(device_id(trv)) %} + {% set remote_temperature_entity_id = namespace(id='') %} + {% for s in entities %} + {% if 'remote_temperature' in s %} + {% set remote_temperature_entity_id.id = s %} + {% endif %} + {% endfor %} + {{ remote_temperature_entity_id.id }} +window_detection_entity: > + {% set entities = device_entities(device_id(trv)) %} + {% set window_detection_entity_id = namespace(id='') %} + {% for s in entities %} + {% if 'window_detection' in s %} + {% set window_detection_entity_id.id = s %} + {% endif %} + {% endfor %} + {{ window_detection_entity_id.id }} +current_temperature: !input temperature_sensor - actions: - - if: - - condition: trigger - id: - - FENSTER_OPEN - then: - - service: switch.turn_on - target: - entity_id: "{{ window_detection_entity }}" - alias: Setze Fenster auf offen - - if: - - condition: trigger - id: - - FENSTER_CLOSED - then: - - service: switch.turn_off - target: - entity_id: "{{ window_detection_entity }}" - alias: Setze Fenster auf geschlossen - # temperature sensor sync - - if: - - condition: trigger - id: - - FENSTER_OPEN - - FENSTER_CLOSED - - SYNC_TEMPERATURE - then: - - service: number.set_value - data: - value: "{{ states(current_temperature) | float }}" - target: - entity_id: "{{ remote_temperature_entity }}" - alias: Sync remote temperature sensor \ No newline at end of file +actions: +- if: + - condition: trigger + id: + - FENSTER_OPEN + then: + - service: switch.turn_on + target: + entity_id: "{{ window_detection_entity }}" + alias: Setze Fenster auf offen +- if: + - condition: trigger + id: + - FENSTER_CLOSED + then: + - service: switch.turn_off + target: + entity_id: "{{ window_detection_entity }}" + alias: Setze Fenster auf geschlossen + # temperature sensor sync +- if: + - condition: trigger + id: + - FENSTER_OPEN + - FENSTER_CLOSED + - SYNC_TEMPERATURE + then: + - service: number.set_value + data: + value: "{{ states(current_temperature) | float }}" + target: + entity_id: "{{ remote_temperature_entity }}" + alias: Sync remote temperature sensor \ No newline at end of file