-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTRVZB Offset.yaml
59 lines (59 loc) · 1.96 KB
/
TRVZB Offset.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
blueprint:
name: TRVZB Offset
description: Automation to set an offset for your radiator valve in conjunction with Versatile Thermostat
Thermostat PID (available from HACS)
domain: automation
input:
thermostat_value:
name: Thermostat Value
selector:
entity:
filter:
- domain:
- input_number
multiple: false
max_valve_opening:
name: Max Valve Opening Position
selector:
entity:
filter:
- domain:
- number
multiple: false
max_valve_closing:
name: Max Valve Closing Position
selector:
entity:
filter:
- domain:
- number
multiple: false
thermostat_offset:
name: Thermostat Offset
selector:
number:
min: 0
max: 100
step: 1
mode: slider
source_url: https://github.com/Riot2891/Home-Assistant-Blueprints/blob/main/TRVZB%20Offset.yaml
variables:
thermostat_value: !input thermostat_value
thermostat_offset: !input thermostat_offset
triggers:
trigger: state
entity_id: !input thermostat_value
actions:
- action: number.set_value
data:
value: "{% if (states(thermostat_value) | float + (thermostat_offset) | float) > 100 %}\n 0 \n {% elif (states(thermostat_value) | float + (thermostat_offset) | float) == (thermostat_offset) | float %}\n 100 \n {% else %}\n {{100.0 - (states(thermostat_value)|
float+(thermostat_offset) | float)}}\n{% endif %}"
target:
entity_id: !input max_valve_closing
- action: number.set_value
data:
value: "{% if (states(thermostat_value) | float + (thermostat_offset) | float) > 100 %}\n 100 \n {% elif (states(thermostat_value) | float + (thermostat_offset) | float) == (thermostat_offset) | float %}\n 0 \n {% else %}\n {{states(thermostat_value)|
float+(thermostat_offset) | float}}\n{% endif %}"
target:
entity_id: !input max_valve_opening
mode: single