-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathesphome-circulation-pump-controller.yaml
More file actions
589 lines (530 loc) · 14.1 KB
/
esphome-circulation-pump-controller.yaml
File metadata and controls
589 lines (530 loc) · 14.1 KB
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
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
substitutions:
devicename: wh-circulation-
upper_devicename: Water Heater Circulation
econet_update_interval: 30s
sensor_power_filters_lambda: return x;
external_components_source: github://esphome-econet/esphome-econet@main
esphome:
name: "wh-circulation"
esp32:
board: esp32dev
framework:
type: esp-idf
# Enable logging
#logger:
logger:
baud_rate: 0 # Disable UART logger if using UART0 (pins 1,3)
level: INFO
tx_buffer_size: 2000
# Enable Home Assistant API
api:
encryption:
key: "D1XBLdjCVQMNj3YrrlzBsB64H7lh5HwXzpJKhMLg/4E="
services:
- service: motion_detected
then:
- if:
condition:
and:
- switch.is_on: circulationpumpmotion
- lambda: 'return id(motiontimerreset) == true;'
then:
- logger.log: "Motion Pump Run"
- lambda: 'id(motiontimerreset) = false;'
- script.execute: pump_run
- if:
condition:
and:
- switch.is_on: circulationpumpmotiononce
- lambda: 'return id(motiontimerreset) == true;'
then:
- logger.log: "Motion Pump Run"
- lambda: 'id(motiontimerreset) = false;'
- script.execute: pump_run
ota:
- platform: esphome
password: "4c6230961f157cc5cd0ee0518d5a87b6"
wifi:
ssid: !secret wifi_ssid_redbullnointernet
password: !secret wifi_password_redbullnointernet
fast_connect: true
power_save_mode: none
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "WH Circulation Hotspot"
password: "im3A50bgmTfv"
captive_portal:
external_components:
- source: github://esphome-econet/esphome-econet
globals:
- id: motiontimerreset
type: bool
restore_value: False
uart:
id: uart_0
rx_pin: GPIO23
tx_pin: GPIO22
baud_rate: 38400 # 38400 for econet
econet:
src_address: 0x1280
uart_id: uart_0
update_interval: ${econet_update_interval}
climate:
- platform: econet
name: "Water Heater"
id: econet_climate
visual:
min_temperature: "110 °F"
max_temperature: "140 °F"
temperature_step:
target_temperature: "1.0 °F"
current_temperature: "0.1 °F"
current_temperature_datapoint: UPHTRTMP
target_temperature_datapoint: WHTRSETP
mode_datapoint: WHTRENAB
modes:
0: "OFF"
1: "HEAT"
custom_preset_datapoint: WHTRCNFG
custom_presets:
0: "Off"
1: "Eco Mode"
2: "Heat Pump"
3: "High Demand"
4: "Electric"
one_wire:
- pin: GPIO2
platform: gpio
sensor:
- platform: dallas_temp
address: 0x9f021319f117aa28
name: Water In Temperature
id: 'water_in_temp'
- platform: dallas_temp
address: 0x570120598a043e28
name: Water Loop Temperature
id: 'water_return_temp'
- platform: dallas_temp
address: 0x803c01f095189328
name: Garage Outside Temperature
id: 'garage_outside_temp'
filters:
- sliding_window_moving_average:
window_size: 30
send_every: 1
send_first_at: 1
- platform: dallas_temp
address: 0x113c01f095473228
name: Garage WH Exhaust
- platform: dallas_temp
address: 0x043c01f0955d7a28
name: Garage WH Temperature
- platform: econet
name: "Hot Water"
sensor_datapoint: HOTWATER
unit_of_measurement: "%"
accuracy_decimals: 0
device_class: "moisture"
state_class: "measurement"
- platform: econet
name: "Ambient Temperature"
sensor_datapoint: AMBIENTT
unit_of_measurement: "°F"
accuracy_decimals: 1
device_class: "temperature"
state_class: "measurement"
entity_category: "diagnostic"
- platform: econet
name: "Lower Tank Temperature"
sensor_datapoint: LOHTRTMP
unit_of_measurement: "°F"
accuracy_decimals: 1
device_class: "temperature"
state_class: "measurement"
entity_category: "diagnostic"
- platform: econet
name: "Upper Tank Temperature"
sensor_datapoint: UPHTRTMP
unit_of_measurement: "°F"
accuracy_decimals: 1
device_class: "temperature"
state_class: "measurement"
entity_category: "diagnostic"
- platform: econet
name: "Power"
sensor_datapoint: POWRWATT
unit_of_measurement: "W"
accuracy_decimals: 3
device_class: "power"
state_class: "measurement"
entity_category: "diagnostic"
filters:
- lambda: ${sensor_power_filters_lambda}
- platform: econet
name: "Evaporator Temperature"
sensor_datapoint: EVAPTEMP
unit_of_measurement: "°F"
accuracy_decimals: 1
device_class: "temperature"
state_class: "measurement"
entity_category: "diagnostic"
- platform: econet
name: "Suction Temperature"
sensor_datapoint: SUCTIONT
unit_of_measurement: "°F"
accuracy_decimals: 1
device_class: "temperature"
state_class: "measurement"
entity_category: "diagnostic"
- platform: econet
name: "Discharge Temperature"
sensor_datapoint: DISCTEMP
unit_of_measurement: "°F"
accuracy_decimals: 1
device_class: "temperature"
state_class: "measurement"
entity_category: "diagnostic"
- platform: wifi_signal
name: "WiFi Signal Strength"
entity_category: "diagnostic"
text_sensor:
- platform: econet
name: "Fan Speed"
sensor_datapoint: FAN_CTRL
icon: "mdi:fan"
- platform: econet
name: "Heating Element State"
sensor_datapoint: HEATCTRL
icon: "mdi:heating-coil"
binary_sensor:
- platform: template
name: "Pump Running"
id: pumprunning
lambda: |-
if (id(pump_run).is_running() || id(pump_run_long).is_running()) {
return true;
} else {
return false;
}
- platform: template
name: "Outside Freeze"
id: "outside_freeze"
lambda: |-
if (id(garage_outside_temp).state <= 1) {
return true;
} else {
return false;
}
- platform: template
name: "Outside Deep Freeze"
id: "outside_deep_freeze"
lambda: |-
if (id(garage_outside_temp).state <= -6) {
return true;
} else {
return false;
}
- platform: econet
name: "Compressor"
sensor_datapoint: COMP_RLY
device_class: "running"
switch:
- platform: econet
name: "Beep On Alarm"
id: alarm_beep
switch_datapoint: ALRMBEEP
request_mod: 2
icon: "mdi:alarm-note"
entity_category: "config"
- platform: econet
name: "Screen Adjustment Lock"
id: screen_lock
switch_datapoint: SCRNLOCK
request_mod: 2
icon: "mdi:gesture-tap-button"
entity_category: "config"
- platform: econet
name: "Screen Unit in °C"
id: display_unit
switch_datapoint: DISPUNIT
request_mod: 2
icon: "mdi:temperature-celsius"
entity_category: "config"
- platform: econet
id: resetdev
switch_datapoint: RESETDEV
request_mod: none
internal: true
- platform: econet
id: alreset
switch_datapoint: ALRESET
request_mod: none
internal: true
- platform: econet
id: alhisclr
switch_datapoint: ALHISCLR
request_mod: none
internal: true
- platform: template
name: "Water Heater Pump"
id: circulationpumpon
restore_mode: RESTORE_DEFAULT_OFF
turn_on_action:
- logger.log: "Circulation On"
- script.execute: pump_run
- switch.template.publish:
id: circulationpumpon
state: ON
# should only have 1 of the 3 switches one. Turn others off.
- switch.template.publish:
id: circulationpumpmotion
state: OFF
- switch.template.publish:
id: circulationpumpmotiononce
state: OFF
turn_off_action:
- logger.log: "Circulation Off"
- script.stop: pump_run
- script.execute: pump_off
- switch.template.publish:
id: circulationpumpon
state: OFF
lambda: |-
if (id(circulationpumpon).state) {
return true;
} else {
return false;
}
- platform: template
name: "Water Heater Pump Motion"
id: circulationpumpmotion
restore_mode: RESTORE_DEFAULT_OFF
turn_on_action:
- logger.log: "Circulation On"
#- script.execute: pump_run
- lambda: 'id(motiontimerreset) = true;'
- switch.template.publish:
id: circulationpumpmotion
state: ON
# should only have 1 of the 3 switches one. Turn others off.
- switch.template.publish:
id: circulationpumpon
state: OFF
- switch.template.publish:
id: circulationpumpmotiononce
state: OFF
turn_off_action:
- logger.log: "Circulation Off"
- script.stop: pump_run
- script.execute: pump_off
- switch.template.publish:
id: circulationpumpmotion
state: OFF
lambda: |-
if (id(circulationpumpmotion).state) {
return true;
} else {
return false;
}
- platform: template
name: "Water Heater Pump Motion Once"
id: circulationpumpmotiononce
restore_mode: RESTORE_DEFAULT_OFF
turn_on_action:
- logger.log: "Circulation On"
#- script.execute: pump_run
- lambda: 'id(motiontimerreset) = true;'
- switch.template.publish:
id: circulationpumpmotiononce
state: ON
# should only have 1 of the 3 switches one. Turn others off.
- switch.template.publish:
id: circulationpumpon
state: OFF
- switch.template.publish:
id: circulationpumpmotion
state: OFF
turn_off_action:
- logger.log: "Circulation Off"
- script.stop: pump_run
- script.execute: pump_off
- switch.template.publish:
id: circulationpumpmotiononce
state: OFF
lambda: |-
if (id(circulationpumpmotiononce).state) {
return true;
} else {
return false;
}
- platform: template
name: "Force Valve Open"
id: forcevaleopen
restore_mode: RESTORE_DEFAULT_OFF
turn_on_action:
#- script.execute: pump_run
- output.turn_on: relayk1
- output.turn_on: relayk2
- switch.template.publish:
id: forcevaleopen
state: ON
turn_off_action:
- output.turn_off: relayk1
- output.turn_off: relayk2
- switch.template.publish:
id: forcevaleopen
state: OFF
lambda: |-
if (id(forcevaleopen).state) {
return true;
} else {
return false;
}
- platform: econet
name: "Water Heater Enabled"
switch_datapoint: 0
id: wh_enabled_switch
button:
- platform: template
name: Circulation Pump 15 Mins
id: btnCirculateLong
# Optional variables:
icon: "mdi:water-pump"
on_press:
- logger.log: "Button pressed"
- script.execute: pump_run_long
- platform: template
name: Circulation Pump Off
id: btnCirculateOff
# Optional variables:
icon: "mdi:water-pump"
on_press:
- logger.log: "Button pressed"
- script.stop: pump_run
- script.stop: pump_run_long
- script.execute: pump_off
- platform: template
name: Circulation Pump Once
id: btnCirculateOnce
# Optional variables:
icon: "mdi:water-pump"
on_press:
- logger.log: "Button pressed"
- script.execute: pump_run
- platform: restart
name: "Restart ESP"
id: restart_esp
icon: "mdi:restart"
entity_category: "config"
- platform: template
name: "Restart Microcontroller"
id: restart_mcu
icon: "mdi:restart"
entity_category: "config"
on_press:
- switch.turn_on: resetdev
- delay: 1s
- switch.turn_off: resetdev
- platform: template
name: "Alarm Reset"
id: alarm_reset
icon: "mdi:restart-alert"
entity_category: "config"
on_press:
- switch.turn_on: alreset
- delay: 1s
- switch.turn_off: alreset
- platform: template
name: "Alarm History Reset"
id: alarm_history_reset
icon: "mdi:restart-alert"
entity_category: "config"
on_press:
- switch.turn_on: alhisclr
- delay: 1s
- switch.turn_off: alhisclr
# Status LED
status_led:
pin: GPIO25
script:
- id: pump_run_long
mode: restart
then:
- output.turn_on: relayk1
- output.turn_on: relayk2
- delay: 5s
- output.turn_on: relayk3
- delay: 15min
- output.turn_off: relayk1
- output.turn_off: relayk2
- output.turn_off: relayk3
- id: pump_run
mode: restart
then:
- output.turn_on: relayk1
- output.turn_on: relayk2
- delay: 5s
- output.turn_on: relayk3
- delay: 3min
- output.turn_off: relayk1
- output.turn_off: relayk2
- output.turn_off: relayk3
- if:
condition:
switch.is_on: circulationpumpmotiononce
then:
- switch.template.publish:
id: circulationpumpmotiononce
state: OFF
- id: pump_off
mode: restart
then:
- output.turn_off: relayk1
- output.turn_off: relayk2
- output.turn_off: relayk3
interval:
# for pump switch (normal pump run or deep freeze)
- interval: 18min
then:
if:
condition:
or:
- switch.is_on: circulationpumpon
- binary_sensor.is_on: outside_deep_freeze
then:
- logger.log: "Interval Fire"
- script.execute: pump_run
# for pump motion switch (run pump only when motion)
- interval: 18min
then:
if:
condition:
or:
- switch.is_on: circulationpumpmotion
then:
- logger.log: "Interval Motion Reset"
- lambda: 'id(motiontimerreset) = true;'
# for freeze protection (run every 30 mins)
- interval: 30min
then:
if:
condition:
and:
- binary_sensor.is_off: outside_deep_freeze
- binary_sensor.is_on: outside_freeze
then:
- logger.log: "Interval Fire"
- script.execute: pump_run
output:
- platform: gpio
id: relayk1
pin: GPIO21
- platform: gpio
id: relayk2
pin: GPIO19
- platform: gpio
id: relayk3
pin: GPIO18
- platform: gpio
id: relayk4
pin: GPIO05