diff --git a/Climate/bosch_bth-ra_control.yaml b/Climate/bosch_bth-ra_control.yaml index 0d530b1..9d1bfd6 100644 --- a/Climate/bosch_bth-ra_control.yaml +++ b/Climate/bosch_bth-ra_control.yaml @@ -1,6 +1,6 @@ mode: single blueprint: - name: Bosch BTH-RA Radiator Control + name: Bosch BTH-RA Radiator Control - DEV homeassistant: min_version: "2024.6.0" description: > @@ -16,6 +16,14 @@ blueprint: multiple: false filter: - domain: climate + temperature_sensor: + name: Temperatursensor + selector: + entity: + multiple: false + filter: + - domain: sensor + device_class: temperature window_section: name: Fenster-/Türsensor Konfiguration description: Konfiguration für den Fenster-/Türsensor. @@ -50,19 +58,11 @@ blueprint: max: 3600.0 unit_of_measurement: seconds step: 1.0 - remaining_section: - name: Weitere Konfiguration - description: Sonstige Konfigurationen für die Automation + schedule_section: + name: Heizplan Konfiguration + description: Konfiguration der Heizpläne die für den Radiator berücksichtigt werden sollen collapsed: false input: - temperature_sensor: - name: Temperatursensor - selector: - entity: - multiple: false - filter: - - domain: sensor - device_class: temperature radiator_schedules: name: Heizpläne description: Alle Heizpläne die für den Radiator berücksichtigt werden sollen. Sind mehrere Schedules aktiv, wird der erste mit einem gültigen Slot verwendet. @@ -72,11 +72,38 @@ blueprint: multiple: true filter: - domain: switch + away_section: + name: Konfiguration für Abwesenheitsmodus + description: Konfiguration für das Absenken der Heizung im Abwesenheitsmodus eines Alarmsystems + collapsed: false + input: + alarm_control_panel: + name: Alarm Control Panel + description: Optional - Alarm Control Panel um Heizung abzusenken, wenn Alarm im Abwesendmodus ist + default: null + selector: + entity: + multiple: false + filter: + - domain: alarm_control_panel + away_temperature: + name: Abwesenheitstemperatur + description: Temperatur die eingestellt wird, wenn der Alarm im Abwesendmodus ist (Default = 18°C) + default: 18 + selector: + number: + mode: box + min: 15.0 + max: 25.0 + unit_of_measurement: "°C" + step: 0.5 variables: trv: !input trv - radiator_schedules: !input radiator_schedules temperature_sensor: !input temperature_sensor + radiator_schedules: !input radiator_schedules + away_temperature: !input away_temperature + alarm_control_panel: !input alarm_control_panel remote_temperature_entity: > {% set entities = device_entities(device_id(trv)) %} {% set remote_temperature_entity_id = namespace(id='') %} @@ -103,7 +130,7 @@ variables: {% set actions = state_attr(schedule, 'actions') %} {% if actions is not none and actions | length > current_slot %} {% set action = actions[current_slot] %} - {% if action.data.temperature is defined %} + {% if action.data.temperature is defined and action.data.temperature | is_number %} {% set ns.current_temperature = action.data.temperature %} {% break %} {% endif %} @@ -111,16 +138,24 @@ variables: {% endif %} {% endfor %} {{ ns.current_temperature }} + target_temperature: > + {% if alarm_control_panel and is_state(alarm_control_panel, 'armed_away') %} + {{ away_temperature }} + {% elif scheduled_temperature is not none %} + {{ scheduled_temperature }} + {% else %} + {{ away_temperature }} + {% endif %} triggers: - - trigger: state + - platform: state entity_id: - !input window_sensor from: "off" to: "on" for: !input window_delay_open id: FENSTER_OPEN - - trigger: state + - platform: state entity_id: - !input window_sensor from: "on" @@ -134,8 +169,18 @@ triggers: - platform: state entity_id: !input temperature_sensor id: TEMP_CHANGED + - platform: state + entity_id: !input alarm_control_panel + to: "armed_away" + id: ALARM_ARMED_AWAY + - platform: state + entity_id: !input alarm_control_panel + from: "armed_away" + to: "disarmed" + id: ALARM_DISARMED_AWAY actions: + # setze Fenster auf offen/geschlossen - choose: - conditions: - condition: trigger @@ -163,13 +208,13 @@ actions: - if: - condition: template value_template: > - {{ scheduled_temperature is not none }} + {{ target_temperature is not none and target_temperature | is_number }} then: - - action: climate.set_temperature + - service: climate.set_temperature target: entity_id: !input trv data: - temperature: "{{ scheduled_temperature | float }}" + temperature: "{{ target_temperature | float }}" alias: Setze Fenster auf geschlossen und setze Solltemperatur auf Wert aus Zeitplan (wenn vorhanden) # temperature sensor sync - choose: @@ -178,10 +223,32 @@ actions: id: - SYNC_TEMPERATURE - TEMP_CHANGED + - condition: template + value_template: > + {{ temperature_sensor is defined and states(temperature_sensor) | is_number }} sequence: - service: number.set_value data: value: "{{ states(temperature_sensor) | float }}" target: entity_id: "{{ remote_temperature_entity }}" - alias: Synchronisiere Temperatur am TRV \ No newline at end of file + alias: Synchronisiere Temperatur am TRV + # setze Solltemperatur basierend auf Alarm-Status + - choose: + - conditions: + - condition: trigger + id: + - ALARM_ARMED_AWAY + - ALARM_DISARMED_AWAY + sequence: + - if: + - condition: template + value_template: > + {{ target_temperature is not none and target_temperature | is_number }} + then: + - service: climate.set_temperature + target: + entity_id: !input trv + data: + temperature: "{{ target_temperature | float }}" + alias: Setze Solltemperatur basierend auf Alarm-Status \ No newline at end of file