refactoring: use sections and use choose instead of if
This commit is contained in:
@@ -5,15 +5,28 @@ blueprint:
|
||||
An automation to set Bosch TRV radiator valve to a desired temperature.
|
||||
domain: automation
|
||||
author: Me
|
||||
input:
|
||||
radiator_section:
|
||||
name: Radiator Konfiguration
|
||||
description: Konfiguration für den Bosch BTH-RA Radiator
|
||||
collapsed: false
|
||||
input:
|
||||
radiator_entity:
|
||||
name: Thermostat
|
||||
description: Thermostat muss ein Bosch BTH-RA sein
|
||||
selector:
|
||||
entity:
|
||||
device:
|
||||
multiple: false
|
||||
filter:
|
||||
- domain: climate
|
||||
- integration: MQTT
|
||||
- manufacturer: Bosch
|
||||
- model_id: BTH-RA
|
||||
window_section:
|
||||
name: Fenster-/Türsensor Konfiguration
|
||||
description: Konfiguration für den Fenster-/Türsensor.
|
||||
collapsed: true
|
||||
input:
|
||||
window_sensor:
|
||||
name: Fenster-/Türsensor (oder Gruppe)
|
||||
selector:
|
||||
@@ -43,6 +56,11 @@ blueprint:
|
||||
max: 3600.0
|
||||
unit_of_measurement: seconds
|
||||
step: 1.0
|
||||
remaining_section:
|
||||
name: Weitere Konfiguration
|
||||
description: Sonstige Konfigurationen für die Automation
|
||||
collapesed: true
|
||||
input:
|
||||
temperature_sensor:
|
||||
name: Temperatursensor
|
||||
selector:
|
||||
@@ -104,9 +122,8 @@ variables:
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{{ window_detection_entity_id.id }}
|
||||
current_temperature: !input temperature_sensor
|
||||
current_temperature_entity_id: !input temperature_sensor
|
||||
scheduled_temperature: >
|
||||
{% set schedules = ['switch.schedule_bed7e4', 'switch.schedule_28375d', 'switch.schedule_0cc5de'] %}
|
||||
{% set ns = namespace(current_temperature = none) %}
|
||||
{% for schedule in schedules %}
|
||||
{% if states(schedule) == 'on' and state_attr(schedule, 'current_slot') is not none %}
|
||||
@@ -124,37 +141,38 @@ variables:
|
||||
{{ ns.current_temperature }}
|
||||
|
||||
actions:
|
||||
- if:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id:
|
||||
- FENSTER_OPEN
|
||||
then:
|
||||
sequence:
|
||||
- service: switch.turn_on
|
||||
target:
|
||||
entity_id: "{{ window_detection_entity }}"
|
||||
alias: Setze Fenster auf offen
|
||||
- if:
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id:
|
||||
- FENSTER_CLOSED
|
||||
then:
|
||||
sequence:
|
||||
- service: switch.turn_off
|
||||
target:
|
||||
entity_id: "{{ window_detection_entity }}"
|
||||
alias: Setze Fenster auf geschlossen
|
||||
# temperature sensor sync
|
||||
- if:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id:
|
||||
- FENSTER_OPEN
|
||||
- FENSTER_CLOSED
|
||||
- SYNC_TEMPERATURE
|
||||
- TEMP_CHANGED
|
||||
then:
|
||||
sequence:
|
||||
- service: number.set_value
|
||||
data:
|
||||
value: "{{ states(current_temperature) | float }}"
|
||||
value: "{{ states(current_temperature_entity_id) | float }}"
|
||||
target:
|
||||
entity_id: "{{ remote_temperature_entity }}"
|
||||
alias: Sync remote temperature sensor
|
||||
alias: Synce Temperatur zum TRV
|
||||
Reference in New Issue
Block a user