-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathesp-lg-simulator.yaml
358 lines (350 loc) · 8.78 KB
/
esp-lg-simulator.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
substitutions:
device_name: esp-lg-simulator
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("Initialiseren");
packages:
config_values: !include lg-heatpump-control/config/config_simulator.yaml
lg_modbus: !include lg-heatpump-control/sim/lg-fake-modbus.yaml #include file with simulated modbus sensors
# Enable logging. Disable modbus controller debug messages
logger:
logs:
esp32.preferences: WARN
sensor: WARN
text_sensor: WARN
number: WARN
number:
- platform: template
name: "Stooklijn offset Sim"
id: wp_stooklijn_offset
min_value: -5
max_value: 5
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 Sim"
min_value: -6
max_value: 6
step: 0.5
restore_value: yes
initial_value: 1
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 Sim"
min_value: -25
max_value: 0
step: 1
restore_value: yes
initial_value: -8
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 Sim"
min_value: 20
max_value: 60
step: 1
restore_value: yes
initial_value: 45
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 Sim"
min_value: 20
max_value: 40
step: 1
restore_value: yes
initial_value: 27
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 Sim"
min_value: 0
max_value: 20
step: 1
restore_value: yes
initial_value: 11
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: "Minimum run time Sim"
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 Sim"
min_value: 0
max_value: 60
step: 1
restore_value: yes
initial_value: 10
unit_of_measurement: "min"
optimistic: true
icon: mdi:timer-cog-outline
- platform: template
id: oat_silent_always_off
name: "Outside-temp silent always off Sim"
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 Sim"
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 Sim"
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 Sim"
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 Sim"
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 Sim"
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 SIM"
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 Sim"
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 Sim"
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();
switch:
- platform: template
name: "Termostat On Sim"
id: thermostat_signal
optimistic: true
- platform: template
name: "External pump relay Sim"
id: "relay_pump"
optimistic: true
- platform: template
name: "Heat relay Sim"
id: "relay_heat"
optimistic: true
- platform: template
name: "Backup_heat relay Sim"
id: "relay_backup_heat"
optimistic: true
icon: mdi:gas-burner
- platform: restart
name: "ESP WP Control Restart Sim"
- platform: template
name: "Temperature Boost Sim"
id: boost_switch
optimistic: true
icon: mdi:thermometer-plus
- platform: template
name: "Enable Silent After Defrost Sim"
id: silent_after_defrost
restore_mode: RESTORE_DEFAULT_OFF
optimistic: true
icon: mdi:snowflake-melt
- platform: template
name: "Change Target during Stall Sim"
id: change_target_stall
restore_mode: RESTORE_DEFAULT_OFF
optimistic: true
icon: mdi:target-variant
interval:
- interval: 10s
id: state_machine
then: !include { file: lg-heatpump-control/lg-heatpump-state-machine.yaml }
- interval: 20s
id: simulation
then: !include { file: lg-heatpump-control/sim/lg-heatpump-simulation-script.yaml }
sensor:
- platform: template
name: "Stooklijn Watertemp Target Sim"
id: watertemp_target
unit_of_measurement: "°C"
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: "Delta T Sim"
id: wp_delta_t
unit_of_measurement: "°C"
accuracy_decimals: 1
lambda: |-
return (float)((id(water_temp_aanvoer).state)-(id(water_temp_retour).state));
update_interval: 30s
icon: mdi:delta
- platform: template
name: "Derivative Sim"
id: derivative_value
accuracy_decimals: 1
unit_of_measurement: "°C/h"
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 Sim"
id: controller_state
update_interval: never
icon: mdi:state-machine
- platform: template
name: "Controller info Sim"
id: controller_info
update_interval: never
icon: mdi:memory