upload
This commit is contained in:
199
dynamic_valve_test.yaml
Normal file
199
dynamic_valve_test.yaml
Normal file
@@ -0,0 +1,199 @@
|
||||
blueprint:
|
||||
name: Dynamic Radiator Valve – Pro Configurator
|
||||
description: >
|
||||
Automatyczne sterowanie zaworem grzejnika na podstawie temperatury,
|
||||
różnicy temperatur oraz statusu okna.
|
||||
domain: automation
|
||||
|
||||
input:
|
||||
radiator_climate:
|
||||
name: Radiator (Climate)
|
||||
description: Wybierz urządzenie klimatyczne (np. termostat grzejnika)
|
||||
selector:
|
||||
entity:
|
||||
domain: climate
|
||||
|
||||
temperature_sensor:
|
||||
name: Temperature Sensor
|
||||
description: Sensor aktualnej temperatury w pomieszczeniu
|
||||
selector:
|
||||
entity:
|
||||
domain: sensor
|
||||
|
||||
window_sensor:
|
||||
name: Window Sensor / Input Boolean
|
||||
description: Określ czujnik stanu okna lub pomocniczy input boolean
|
||||
selector:
|
||||
entity:
|
||||
domain: - binary_sensor
|
||||
- input_boolean
|
||||
|
||||
valve_closing_number:
|
||||
name: Valve Closing Number
|
||||
description: Number entity służąca do ustawiania poziomu zamknięcia zaworu
|
||||
selector:
|
||||
entity:
|
||||
domain: number
|
||||
|
||||
valve_opening_number:
|
||||
name: Valve Opening Number (optional)
|
||||
description: (opcjonalnie) number entity do otwierania zaworu
|
||||
default: null
|
||||
selector:
|
||||
entity:
|
||||
domain: number
|
||||
|
||||
difference_text:
|
||||
name: Temperature Difference (optional)
|
||||
description: (opcjonalnie) input_text do zapisywania aktualnej różnicy
|
||||
default: null
|
||||
selector:
|
||||
entity:
|
||||
domain: input_text
|
||||
|
||||
# Advanced Options
|
||||
min_diff_threshold:
|
||||
name: Min Difference Threshold
|
||||
description: Minimalna różnica względem target do otwarcia zaworu
|
||||
default: 0.0
|
||||
selector:
|
||||
number:
|
||||
unit_of_measurement: '°C'
|
||||
min: -5
|
||||
max: 5
|
||||
step: 0.1
|
||||
|
||||
max_diff_threshold:
|
||||
name: Max Difference Threshold
|
||||
description: Maksymalna różnica do pełnego zamknięcia zaworu
|
||||
default: 2.0
|
||||
selector:
|
||||
number:
|
||||
unit_of_measurement: '°C'
|
||||
min: 0
|
||||
max: 10
|
||||
step: 0.1
|
||||
|
||||
window_override:
|
||||
name: Window Open Override
|
||||
description: Gdy okno otwarte, czy zawory powinny zostać zamknięte?
|
||||
default: true
|
||||
selector:
|
||||
boolean: {}
|
||||
|
||||
weekdays:
|
||||
name: Operate on Weekdays
|
||||
description: Wybierz dni, w których automatyka ma działać
|
||||
default: ['mon','tue','wed','thu','fri','sat','sun']
|
||||
selector:
|
||||
select:
|
||||
multiple: true
|
||||
options:
|
||||
- label: Monday
|
||||
value: mon
|
||||
- label: Tuesday
|
||||
value: tue
|
||||
- label: Wednesday
|
||||
value: wed
|
||||
- label: Thursday
|
||||
value: thu
|
||||
- label: Friday
|
||||
value: fri
|
||||
- label: Saturday
|
||||
value: sat
|
||||
- label: Sunday
|
||||
value: sun
|
||||
|
||||
active_time:
|
||||
name: Active Time Range
|
||||
description: Określ ramy czasowe działania automatyki (opcjonalne)
|
||||
selector:
|
||||
time:
|
||||
start: true
|
||||
end: true
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: !input radiator_climate
|
||||
- platform: state
|
||||
entity_id: !input temperature_sensor
|
||||
- platform: state
|
||||
entity_id: !input window_sensor
|
||||
- platform: time_pattern
|
||||
minutes: "/1"
|
||||
|
||||
condition:
|
||||
- condition: time
|
||||
weekday: !input weekdays
|
||||
- condition: template
|
||||
value_template: >
|
||||
{{ states(!input radiator_climate) not in ['unavailable','unknown'] }}
|
||||
|
||||
action:
|
||||
- variables:
|
||||
climate_entity: !input radiator_climate
|
||||
temp_entity: !input temperature_sensor
|
||||
window_entity: !input window_sensor
|
||||
closing_entity: !input valve_closing_number
|
||||
opening_entity: !input valve_opening_number
|
||||
diff_text_entity: !input difference_text
|
||||
min_diff: !input min_diff_threshold
|
||||
max_diff: !input max_diff_threshold
|
||||
override_open: !input window_override
|
||||
|
||||
- variables:
|
||||
target_temp: "{{ state_attr(climate_entity,'temperature')|float(0) }}"
|
||||
current_temp: "{{ states(temp_entity)|float(0) }}"
|
||||
diff: "{{ current_temp - target_temp }}"
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: >
|
||||
{{ override_open and (states(window_entity) in ['on','true','open']) }}
|
||||
sequence:
|
||||
- variables:
|
||||
closing_degree: 0
|
||||
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: >
|
||||
{{ diff >= max_diff }}
|
||||
sequence:
|
||||
- variables:
|
||||
closing_degree: 100
|
||||
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: >
|
||||
{{ diff <= min_diff }}
|
||||
sequence:
|
||||
- variables:
|
||||
closing_degree: 30
|
||||
|
||||
default:
|
||||
- variables:
|
||||
closing_degree: >
|
||||
{{ ((diff - min_diff) / (max_diff - min_diff) * 100) | round(0) }}
|
||||
|
||||
- service: number.set_value
|
||||
data:
|
||||
value: "{{ closing_degree }}"
|
||||
target:
|
||||
entity_id: >
|
||||
{% if opening_entity %}
|
||||
[{{ closing_entity }}, {{ opening_entity }}]
|
||||
{% else %}
|
||||
{{ closing_entity }}
|
||||
{% endif %}
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: "{{ diff_text_entity != None }}"
|
||||
sequence:
|
||||
- service: input_text.set_value
|
||||
data:
|
||||
value: "{{ diff }}"
|
||||
target:
|
||||
entity_id: "{{ diff_text_entity }}"
|
||||
Reference in New Issue
Block a user