-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathremeha-avanta.yaml
361 lines (343 loc) · 9.55 KB
/
remeha-avanta.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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
substitutions:
device_name: "heating-controller"
device_friendly_name: "Heating Controller"
device_description: "QuinLED-ESP32 - DIYLESS Master OpenTherm Shield"
time_timezone: "Europe/Amsterdam"
# The minimum boiler temperature for central heating
boiler_ch_setpoint_min: "20"
# The maximum boiler temperature for central heating
# Efficiency can be gained by reducing this, depending on home insulation.
boiler_ch_setpoint_max: "60"
esphome:
name: $device_name
friendly_name: $device_friendly_name
comment: $device_description
name_add_mac_suffix: false
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
level: INFO
# Enable Home Assistant API
api:
encryption:
key: !secret home_assistant_key
ota:
platform: esphome
password: !secret ota_password
# Configure WiFi
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: $device_friendly_name
password: !secret wifi_fallback_password
ap_timeout: 2min
captive_portal:
# These pinouts are default for the DIYLess OpenTherm Shield
# https://diyless.com/product/master-opentherm-shield
opentherm:
in_pin: 21 #D2
out_pin: 22 #D1
output:
- platform: opentherm
t_set:
id: boiler_ch_setpoint
min_value: $boiler_ch_setpoint_min
max_value: $boiler_ch_setpoint_max
zero_means_zero: true
number:
# PID factors need to be tweaked to your home.
# Find factors with quick response times and minimal overshoot.
- platform: template
id: p_factor
name: "PID P-factor"
entity_category: "config"
unit_of_measurement: "%"
icon: mdi:gauge
mode: box
optimistic: true
restore_value: True
initial_value: 49.460
min_value: 0
max_value: 10000
step: 0.001
on_value:
then:
- climate.pid.set_control_parameters:
id: central_heating
kp: !lambda "return id(p_factor).state;"
ki: !lambda "return id(i_factor).state;"
kd: !lambda "return id(d_factor).state;"
- platform: template
id: i_factor
name: "PID I-factor"
entity_category: "config"
unit_of_measurement: "%"
icon: mdi:gauge
mode: box
optimistic: true
restore_value: True
initial_value: 0.487
min_value: 0
max_value: 10000
step: 0.001
on_value:
then:
- climate.pid.set_control_parameters:
id: central_heating
kp: !lambda "return id(p_factor).state;"
ki: !lambda "return id(i_factor).state;"
kd: !lambda "return id(d_factor).state;"
- platform: template
id: d_factor
name: "PID D-factor"
entity_category: "config"
unit_of_measurement: "%"
icon: mdi:gauge
mode: box
optimistic: true
restore_value: True
initial_value: 1256.301
min_value: 0
max_value: 10000
step: 0.001
on_value:
then:
- climate.pid.set_control_parameters:
id: central_heating
kp: !lambda "return id(p_factor).state;"
ki: !lambda "return id(i_factor).state;"
kd: !lambda "return id(d_factor).state;"
sensor:
# Use a Home Assistant temperature sensor to measure our room
- platform: homeassistant
entity_id: sensor.living_room_climate_temperature
id: living_room_temperature
name: "Room temperature"
internal: False
device_class: "temperature"
state_class: "measurement"
unit_of_measurement: "°C"
accuracy_decimals: 2
filters:
# Push room temperature every second to update PID parameters
- heartbeat: 1s
# Smooth out noise
- exponential_moving_average:
alpha: 0.01
send_every: 5
send_first_at: 1
- platform: homeassistant
entity_id: sensor.living_room_climate_humidity
id: living_room_humidity
name: "Room humidity"
internal: False
device_class: "humidity"
state_class: "measurement"
unit_of_measurement: "%"
accuracy_decimals: 0
- platform: opentherm
rel_mod_level:
name: "Modulation"
t_boiler:
name: "Boiler temperature"
t_ret:
name: "Boiler return temperature"
burner_starts:
name: "Burner starts"
entity_category: diagnostic
t_dhw_set_ub:
name: "Boiler max hot water setpoint"
entity_category: diagnostic
accuracy_decimals: 0
disabled_by_default: True
t_dhw_set_lb:
name: "Boiler min hot water setpoint"
entity_category: diagnostic
accuracy_decimals: 0
disabled_by_default: True
t_dhw_set:
name: "Boiler hot water setpoint"
accuracy_decimals: 0
max_t_set_ub:
name: "Max central heating setpoint upper bound"
entity_category: diagnostic
accuracy_decimals: 0
disabled_by_default: True
max_t_set_lb:
name: "Max central heating setpoint lower bound"
entity_category: diagnostic
accuracy_decimals: 0
disabled_by_default: True
max_t_set:
name: "Max central heating setpoint"
entity_category: diagnostic
accuracy_decimals: 0
disabled_by_default: True
# Get the boiler setpoint in celcius
- platform: template
id: boiler_setpoint_temperature
name: "Boiler central heating setpoint"
lambda: |-
return id(boiler_ch_setpoint).state;
update_interval: 1s
unit_of_measurement: "°C"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 2
- platform: pid
type: KP
name: "PID P-factor"
accuracy_decimals: 3
disabled_by_default: True
- platform: pid
type: KI
name: "PID I-factor"
accuracy_decimals: 3
disabled_by_default: True
- platform: pid
type: KD
name: "PID D-factor"
accuracy_decimals: 3
disabled_by_default: True
- platform: pid
type: HEAT
name: "PID heat output"
accuracy_decimals: 3
disabled_by_default: True
- platform: pid
type: ERROR
name: "PID error"
accuracy_decimals: 3
disabled_by_default: True
- platform: pid
type: PROPORTIONAL
name: "PID P-term"
accuracy_decimals: 3
disabled_by_default: True
- platform: pid
type: INTEGRAL
name: "PID I-term"
accuracy_decimals: 3
disabled_by_default: True
- platform: pid
type: DERIVATIVE
name: "PID D-term"
accuracy_decimals: 3
disabled_by_default: True
- platform: pid
type: RESULT
name: "PID result"
accuracy_decimals: 3
disabled_by_default: True
binary_sensor:
- platform: opentherm
ch_active:
name: "Boiler central heating"
dhw_active:
name: "Boiler hot water"
flame_on:
name: "Boiler flame"
fault_indication:
name: "Boiler fault"
entity_category: diagnostic
diagnostic_indication:
name: "Boiler diagnostic"
entity_category: diagnostic
service_request:
name: "Boiler diagnostic"
entity_category: diagnostic
switch:
- platform: opentherm
ch_enable:
name: "Boiler central heating"
restore_mode: RESTORE_DEFAULT_ON
dhw_enable:
name: "Boiler hot water"
restore_mode: RESTORE_DEFAULT_OFF
button:
- platform: template
name: "Integral reset"
entity_category: "config"
on_press:
- climate.pid.reset_integral_term: central_heating
- platform: template
name: "PID climate autotune"
entity_category: "config"
on_press:
- climate.pid.set_control_parameters:
id: central_heating
kp: 0
ki: 0
kd: 0
- climate.control:
id: central_heating
mode: HEAT
target_temperature: 21
- climate.pid.autotune:
id: central_heating
noiseband: 0.05
positive_output: 1
negative_output: 0
climate:
- platform: pid
id: central_heating
name: "Central heating"
internal: True
visual:
min_temperature: 12
max_temperature: 25
temperature_step: 0.1
heat_output: boiler_ch_setpoint
default_target_temperature: 16
sensor: living_room_temperature
control_parameters:
kp: 0
ki: 0
kd: 0
max_integral: 1 # Prevent I-term windup
min_integral: -1 # Prevent I-term winddown
output_averaging_samples: 1 # smooth the output
derivative_averaging_samples: 1 # smooth the derivative
#deadband_parameters:
#threshold_high: 0.05°C
#threshold_low: -0.05°C
#kp_multiplier: 0.05 # proportional gain turned off inside deadband
#ki_multiplier: 0.05 # integral accumulates at only 5% of normal ki
#kd_multiplier: 0.0 # derviative is turned off inside deadband
#deadband_output_averaging_samples: 15 # average the output over 15 samples within the deadband
- platform: thermostat
id: living_room_thermostat
name: "Living room thermostat"
sensor: living_room_temperature
idle_action:
- logger.log: "Idle"
heat_action:
- logger.log: "Heat"
min_heating_run_time: 200s
min_heating_off_time: 200s
min_idle_time: 200s
default_preset: Home
on_boot_restore_from: memory
visual:
min_temperature: 10
max_temperature: 23
temperature_step: 0.1
preset:
- name: Home
default_target_temperature_low: 20
- name: Away
default_target_temperature_low: 10
- name: Sleep
default_target_temperature_low: 14
- name: Eco
default_target_temperature_low: 19
on_state:
- climate.control:
id: central_heating
mode: !lambda "return id(living_room_thermostat).mode;"
target_temperature: !lambda "return id(living_room_thermostat).target_temperature;"