-
Notifications
You must be signed in to change notification settings - Fork 7
/
esp-lg-control.yaml
382 lines (373 loc) · 10.1 KB
/
esp-lg-control.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
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
substitutions:
device_name: esp-wp-control
packages:
config_values: !include lg-heatpump-control/config/config.yaml
lg_modbus: !include lg-heatpump-control/sensors/lg-heatpump-modbus.yaml #include file with modbus sensors
lg_dallas_temp: !include lg-heatpump-control/sensors/lg-dallas-temp.yaml #optional file with dallas temp probes (disable if not used)
#Choose correct version of below two files. Always enable (by uncommenting) only one of the two
#*****
with_external_thermostat: !include lg-heatpump-control/sensors/lg-with-external-thermostat.yaml #use external thermostat connected to GPIO pin
#without_external_thermostat: !include lg-heatpump-control/sensors/lg-without-external-thermostat.yaml #Replace external thermostat by an on/off switch
#*****
#Again Choose correct version of below two files. Always enable (by uncommenting) only one of the two
#*****
with_external_relays: !include lg-heatpump-control/sensors/lg-with-external-relays.yaml #use external thermostat connected to GPIO pin
#without_external_relays: !include lg-heatpump-control/sensors/lg-without-external-relays.yaml #Replace external thermostat by an on/off switch
#*****
esphome:
name: "${device_name}"
includes:
- lg-heatpump-control/lg-heatpump-state-machine.h
on_boot:
priority: 200
then:
lambda: !lambda |-
//instant on (in case of controller restart during run)
id(relay_backup_heat).turn_off();
if(id(thermostat_signal).state) {
id(relay_pump).turn_on();
id(relay_heat).turn_on();
} else {
id(relay_pump).turn_off();
id(relay_heat).turn_off();
}
id(controller_state).publish_state("Init");
id(controller_info).publish_state("Initializing");
# Enable logging. Disable modbus controller debug messages
logger:
logs:
modbus_controller.sensor: WARN
modbus_controller.output: WARN
modbus.number: WARN
esp32.preferences: WARN
sensor: WARN
text_sensor: WARN
dallas.temp.sensor: WARN #disable if dallas is not used
number: WARN
number:
- platform: template
name: "Stooklijn offset"
id: wp_stooklijn_offset
min_value: -10
max_value: 10
initial_value: 0
step: 1
restore_value: yes
unit_of_measurement: "°C"
optimistic: true
icon: mdi:plus-minus-variant
set_action:
then:
lambda: !lambda |-
fsm.update_stooklijn();
- platform: template
id: stooklijn_curve
name: "Stooklijn Curve"
min_value: -6
max_value: 6
step: 0.5
restore_value: yes
initial_value: 0
optimistic: true
icon: mdi:chart-bell-curve-cumulative
set_action:
then:
lambda: !lambda |-
fsm.update_stooklijn();
- platform: template
id: stooklijn_min_oat
name: "Stooklijn Minimum Outside-temp"
min_value: -25
max_value: 0
step: 1
restore_value: yes
initial_value: -5
unit_of_measurement: "°C"
optimistic: true
icon: mdi:download-circle-outline
set_action:
then:
lambda: !lambda |-
fsm.update_stooklijn();
- platform: template
id: stooklijn_max_wtemp
name: "Stooklijn Maximum Water-temp"
min_value: 20
max_value: 60
step: 1
restore_value: yes
initial_value: 44
unit_of_measurement: "°C"
optimistic: true
icon: mdi:waves-arrow-right
set_action:
then:
lambda: !lambda |-
fsm.update_stooklijn();
- platform: template
id: stooklijn_min_wtemp
name: "Stooklijn Minimum Water-temp"
min_value: 20
max_value: 40
step: 1
restore_value: yes
initial_value: 24
unit_of_measurement: "°C"
optimistic: true
icon: mdi:waves-arrow-left
set_action:
then:
lambda: !lambda |-
fsm.update_stooklijn();
- platform: template
id: stooklijn_max_oat
name: "Stooklijn Start Outside-temp"
min_value: 0
max_value: 20
step: 1
restore_value: yes
initial_value: 20
unit_of_measurement: "°C"
optimistic: true
icon: mdi:waves-arrow-left
set_action:
then:
lambda: !lambda |-
fsm.update_stooklijn();
- platform: template
id: minimum_run_time
name: "Minimale run tijd"
min_value: 0
max_value: 60
step: 1
restore_value: yes
initial_value: 30
unit_of_measurement: "min"
optimistic: true
icon: mdi:timer-sync-outline
- platform: template
id: external_pump_runover
name: "External pump overrun"
min_value: 0
max_value: 60
step: 1
restore_value: yes
initial_value: 20
unit_of_measurement: "min"
optimistic: true
icon: mdi:timer-cog-outline
- platform: template
id: oat_silent_always_off
name: "Outside-temp silent always off"
min_value: -20
max_value: 10
step: 1
restore_value: yes
initial_value: 2
unit_of_measurement: "°C"
optimistic: true
icon: mdi:volume-plus
- platform: template
id: oat_silent_always_on
name: "Outside-temp silent always on"
min_value: -20
max_value: 20
step: 1
restore_value: yes
initial_value: 6
unit_of_measurement: "°C"
optimistic: true
icon: mdi:volume-off
- platform: template
id: thermostat_off_delay
name: "Thermostat off delay"
min_value: 0
max_value: 10
step: 1
restore_value: yes
initial_value: 1
unit_of_measurement: "min"
optimistic: true
icon: mdi:timer-off-outline
- platform: template
id: thermostat_on_delay
name: "Thermostat on delay"
min_value: 0
max_value: 10
step: 1
restore_value: yes
initial_value: 0
unit_of_measurement: "min"
optimistic: true
icon: mdi:timer
- platform: template
id: boost_time
name: "Boost duration"
min_value: 0
max_value: 180
step: 1
restore_value: yes
initial_value: 60
unit_of_measurement: "min"
optimistic: true
icon: mdi:timer-plus-outline
- platform: template
id: backup_heater_active_temp
name: "Outside-temp backup heater active"
min_value: -30
max_value: 20
step: 1
restore_value: yes
initial_value: 2
optimistic: true
icon: mdi:gas-burner
- platform: template
id: backup_heater_always_on_temp
name: "Outside-temp backup heater always on"
min_value: -30
max_value: 20
step: 1
restore_value: yes
initial_value: -6
optimistic: true
icon: mdi:gas-burner
select:
- platform: template
name: "Automatic Boost"
id: automatic_boost
options:
- "OFF"
- "After Defrost"
- "After DHW"
- "After Defrost/DHW"
restore_value: true
optimistic: true
on_value:
then:
lambda: !lambda |-
fsm.proces_selects();
- platform: template
name: "Backup Heat Auto On"
id: backup_heat_mode
options:
- "OFF"
- "During Defrost"
- "During DHW"
- "During Low Temperature"
- "During Stall"
- "During DHW/Defrost"
- "During Stall/Low Temperature"
- "During All Above Cases"
restore_value: true
optimistic: true
on_value:
then:
lambda: !lambda |-
fsm.proces_selects();
- platform: template
name: "Backup Heat: Disable HP"
id: backup_heat_only_mode
options:
- "Do not disable HP"
- "Disable HP during Low Temp when Backup Heat runs"
- "Disable HP now and run Backup Heat"
restore_value: true
optimistic: true
on_value:
then:
lambda: !lambda |-
fsm.proces_selects();
switch:
- platform: template
name: "Enable Silent After Defrost"
id: silent_after_defrost
restore_mode: RESTORE_DEFAULT_OFF
optimistic: true
icon: mdi:snowflake-melt
- platform: template
name: "Change Target during Stall"
id: change_target_stall
restore_mode: RESTORE_DEFAULT_OFF
optimistic: true
icon: mdi:target-variant
- platform: restart
name: "ESP WP Control Restart"
- platform: template
name: "Temperature Boost"
id: boost_switch
optimistic: true
icon: mdi:thermometer-plus
#if this switch is enabled target changes are not sent to HP
- platform: template
name: "Disable Target Setting"
id: disable_switch
restore_mode: RESTORE_DEFAULT_OFF
optimistic: true
icon: mdi:power
interval:
- interval: 30s
id: state_machine
then: !include { file: lg-heatpump-control/lg-heatpump-state-machine.yaml }
sensor:
- platform: template
name: "Stooklijn Watertemp Target"
id: watertemp_target
device_class: "temperature"
unit_of_measurement: "°C"
state_class: "measurement"
update_interval: never
icon: mdi:home-thermometer-outline
- platform: wifi_signal
name: "${device_name} WiFi Signal"
update_interval: 120s
accuracy_decimals: 0
- platform: uptime
name: "${device_name} Uptime"
unit_of_measurement: d
device_class: "duration"
update_interval: 3600s
accuracy_decimals: 1
filters:
- multiply: 0.000011574
- platform: template
name: "Derivative"
id: derivative_value
accuracy_decimals: 1
unit_of_measurement: "°C/h"
update_interval: never
icon: mdi:sigma
- platform: template
name: "Stooklijn Error degree minutes"
id: wp_stooklijn_error_integral
accuracy_decimals: 1
unit_of_measurement: "degree minutes"
update_interval: never
icon: mdi:sigma
- platform: template
name: "Target Error degree minutes"
id: wp_target_error_integral
accuracy_decimals: 1
unit_of_measurement: "degree minutes"
update_interval: never
icon: mdi:sigma
# Sensors for ESP version and WIFI information
text_sensor:
- platform: version
name: "${device_name} ESPHome Version"
- platform: wifi_info
ip_address:
name: "${device_name} ip"
icon: mdi:ip-network
ssid:
name: "${device_name} ssid"
icon: mdi:wifi-marker
- platform: template
name: "Controller state"
id: controller_state
update_interval: never
icon: mdi:state-machine
- platform: template
name: "Controller info"
id: controller_info
update_interval: never
icon: mdi:memory