-
Notifications
You must be signed in to change notification settings - Fork 0
/
heater_setpoint_compute.yaml
194 lines (185 loc) · 5.41 KB
/
heater_setpoint_compute.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
blueprint:
name: Room heating setpoint compute
description: Compute heating setpoint based on planning °C, Confort & Eco °C and manually set °C
domain: automation
source_url: https://github.com/francois09/HA_blueprints/heater_setpoint_compute.yaml
input:
climate_valve:
name: Climate valve
description: Room TRV (viewed as Climate)
selector:
entity:
domain: climate
comfort_temp:
name: Comfort T° of the room
description: The comfort T° selected for the room
selector:
entity:
domain: input_number
eco_temp:
name: Eco T° of the room
description: The eco T° selected for the room
selector:
entity:
domain: input_number
schedule:
name: Planning of the room
description: The schedule T° of the room
selector:
entity:
domain: schedule
manual_boolean:
name: Manual mode switch
description: Switch indicating if the room is in manual or automated mode
selector:
entity:
domain: input_boolean
setpoint:
name: Selected °C setpoint
description: Setpoint value of the room
selector:
entity:
domain: input_number
winter_mode_boolean:
name: Winter switch
description: Global switch to say it's winter or not.
selector:
entity:
domain: input_boolean
occupancy_boolean:
name: Occupancy
description: Room helper for occupancy. If on, room will follow schedule. If off, always Eco T°.
selector:
entity:
domain: input_boolean
debounce_boolean:
name: Debounce valve update
description: Room debounce boolean flag
selector:
entity:
domain: input_boolean
mode: queued
max_exceeded: silent
variables:
local_comfort_temp: !input comfort_temp
local_eco_temp: !input eco_temp
local_setpoint: !input setpoint
local_climate_valve: !input climate_valve
trigger:
- platform: state
entity_id: !input comfort_temp
- platform: state
entity_id: !input eco_temp
- platform: state
entity_id: !input schedule
- platform: state
entity_id: !input manual_boolean
- platform: state
entity_id: !input occupancy_boolean
condition:
- condition: state
entity_id: !input winter_mode_boolean
state: 'on'
action:
- choose:
#
# When no occupancy, set eco temp
#
- conditions:
- condition: state
entity_id: !input occupancy_boolean
state: 'off'
sequence:
- service: input_number.set_value
data_template:
value: '{{ states(local_eco_temp) }}'
entity_id: !input setpoint
- if:
- condition: template
value_template: '{{ state_attr(local_climate_valve, ''temperature'')|float != states(local_setpoint)|float }}'
then:
- service: input_boolean.turn_on
data: {}
target:
entity_id: !input debounce_boolean
- service: climate.set_temperature
data_template:
temperature: '{{ states(local_setpoint) }}'
entity_id: !input climate_valve
#
# When manual, send local setpoint to the valve (used in case of restarting valve for example)
#
- conditions:
- condition: state
entity_id: !input manual_boolean
state: 'on'
sequence:
- if:
- condition: template
value_template: '{{ state_attr(local_climate_valve, ''temperature'')|float != states(local_setpoint)|float }}'
then:
- service: input_boolean.turn_on
data: {}
target:
entity_id: !input debounce_boolean
- service: climate.set_temperature
data_template:
temperature: '{{ states(local_setpoint) }}'
entity_id: !input climate_valve
#
# When auto, and schedule is on, set comfort t°
#
- conditions:
- condition: state
entity_id: !input manual_boolean
state: 'off'
- condition: state
entity_id: !input schedule
state: 'on'
- condition: state
entity_id: !input occupancy_boolean
state: 'on'
sequence:
- service: input_number.set_value
data_template:
value: '{{ states(local_comfort_temp) }}'
entity_id: !input setpoint
- if:
- condition: template
value_template: '{{ state_attr(local_climate_valve, ''temperature'')|float != states(local_setpoint)|float }}'
then:
- service: input_boolean.turn_on
data: {}
target:
entity_id: !input debounce_boolean
- service: climate.set_temperature
data_template:
temperature: '{{ states(local_setpoint) }}'
entity_id: !input climate_valve
#
# When auto, and schedule is off, set eco t°
#
- conditions:
- condition: state
entity_id: !input manual_boolean
state: 'off'
- condition: state
entity_id: !input schedule
state: 'off'
sequence:
- service: input_number.set_value
data_template:
value: '{{ states(local_eco_temp) }}'
entity_id: !input setpoint
- if:
- condition: template
value_template: '{{ state_attr(local_climate_valve, ''temperature'')|float != states(local_setpoint)|float }}'
then:
- service: input_boolean.turn_on
data: {}
target:
entity_id: !input debounce_boolean
- service: climate.set_temperature
data_template:
temperature: '{{ states(local_setpoint) }}'
entity_id: !input climate_valve