-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrilix-heat-pump.yaml
614 lines (568 loc) · 16.9 KB
/
brilix-heat-pump.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
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
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
# This connects to the modbus on the Brilix pool heat pumps.
# Easy connection is to use the display wire, cut it and add this component in series before the display.
# ESPHome basic configuration for T-CAN485 board
# https://www.lilygo.cc/products/t-can485
# Andrew Elwell <[email protected]>, May 2024 with thanks to home assistant community posts and other online sources.
# https://github.com/Elwell/pool-heatpump/
# alternative version https://github.com/rstcologne/ESP-Home-Fairland-Heatpump/blob/main/config/esphome_snippet.yaml
substitutions:
name_prefix: Brilix Heat Pump
esphome:
name: brilix-heat-pump
comment: Modbus interface for pool heatpump
on_boot:
then:
- output.turn_on: bus_power
- output.turn_on: RS485_EN
- output.turn_on: RS485_SE
esp32:
board: esp32dev
framework:
type: esp-idf
version: recommended
#logger:
# level: INFO
# hardware_uart: UART0
#web_server:
# port: 80
#prometheus:
wifi:
ssid: !secret wifi__iot2_ssid
password: !secret wifi_iot2_password
manual_ip:
static_ip: 192.168.2.250
gateway: 192.168.2.1
subnet: 255.255.255.0
#fast_connect: true
enable_btm: true
enable_rrm: true
ap:
ssid: ${name_prefix}
password: !secret wifi_ap_password
captive_portal:
api:
encryption:
key: !secret api_key
ota:
- platform: esphome
password: !secret ota_password
light:
- platform: esp32_rmt_led_strip
rgb_order: GRB
pin: GPIO4
num_leds: 1
rmt_channel: 0
chipset: ws2812
name: "RGB Indicator"
text_sensor:
- platform: wifi_info
ip_address:
name: "${name_prefix} - IP Address"
ssid:
name: "${name_prefix} - Wi-Fi SSID"
bssid:
name: "${name_prefix} - Wi-Fi BSSID"
- platform: version
name: "${name_prefix} - ESPHome Version"
hide_timestamp: true
# ACCESSIBLE GPIOS BESIDE POWER
# GPIO18 - both
# GPIO34 - INPUT ONLY
# GPIO35 - INPUT ONLY
# GPIO5 - outputs PWM signal at boot, strapping pin
# GPIO12 - boot fails if pulled high, strapping pin
# GPIO32 - both
# GPIO33 - both
# GPIO25 - both
# example code implies that the 5V rail is controlled by GPIO16
output:
- platform: gpio
pin: GPIO17
id: RS485_EN
- platform: gpio
pin: GPIO19
id: RS485_SE
- platform: gpio
pin: GPIO16
id: bus_power
# Set up BLE for wifi provisioning
#esp32_improv:
# authorizer: none
# Sets up the improv via serial client for Wi-Fi provisioning
#improv_serial:
# ESPHome doesn't seem to use uSD slot
# sd_mosi: GPIO15
# sd_miso: GPIO2
# sd_sclk: GPIO14
# sd_cs: GPIO13
# RS485 via a MAX13487E
# https://www.analog.com/media/en/technical-documentation/data-sheets/MAX13487E-MAX13488E.pdf
uart:
rx_pin: GPIO21
tx_pin: GPIO22
baud_rate: 9600
id: u_modbus
# RS485_EN GPIO17 # Receiver Output Enable. Drive RE low to enable the RO. Drive RE high to let the AutoDirection circuit control the receiver. RE is a hot-swap input (see the Hot-Swap Capability section for more details).
# RS485_SE GPIO19 # Shutdown. Drive SHDN high to let the device operate in normal operation. Drive SHDN low to put the part in shutdown.
modbus:
uart_id: u_modbus
id: c_modbus
modbus_controller:
- id: heatpump
address: 1
modbus_id: c_modbus
update_interval: 5s
switch:
# Read coils 0 - Power switch & 1 - Defrost
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Power
register_type: coil
address: 0
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Manual Defrost
register_type: coil
address: 1
disabled_by_default: true
binary_sensor:
- platform: status
name: ${name_prefix} Online Status
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Power Status
register_type: discrete_input
address: 0
device_class: power
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Defrost Status
register_type: discrete_input
address: 1
device_class: cold
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} N/C (D1)
register_type: discrete_input
address: 2
disabled_by_default: true
entity_category: diagnostic
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Remote Start (D2)
register_type: discrete_input
address: 3
device_class: running
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Water Flow (D3)
register_type: discrete_input
address: 4
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Low Pressure sw (D4')
register_type: discrete_input
address: 5
entity_category: diagnostic
device_class: problem
filters:
- invert:
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} High Pressure sw (D5')
register_type: discrete_input
address: 6
entity_category: diagnostic
device_class: problem
filters:
- invert:
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} DigOut 1
register_type: discrete_input
address: 7
entity_category: diagnostic
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Digout 2
register_type: discrete_input
address: 8
entity_category: diagnostic
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} DigOut 3
register_type: discrete_input
address: 9
entity_category: diagnostic
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} DigOut 4
register_type: discrete_input
address: 10
entity_category: diagnostic
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} DigOut 5
register_type: discrete_input
address: 11
entity_category: diagnostic
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} DigOut 6
register_type: discrete_input
address: 12
entity_category: diagnostic
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} DigOut 7
register_type: discrete_input
address: 13
entity_category: diagnostic
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} DigOut 8
register_type: discrete_input
address: 14
entity_category: diagnostic
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} DigOut 9
register_type: discrete_input
address: 15
entity_category: diagnostic
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Fault / Error
register_type: discrete_input
address: 16
device_class: problem
entity_category: diagnostic
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Compressor Running
register_type: discrete_input
address: 17
device_class: running
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} E0 (unknown)
register_type: discrete_input
address: 48
force_new_range: true
device_class: problem
entity_category: diagnostic
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} E1 (High Pressure)
register_type: discrete_input
address: 49
device_class: problem
entity_category: diagnostic
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} E2 (Low Pressure)
register_type: discrete_input
address: 50
device_class: problem
entity_category: diagnostic
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} E3 (No Water)
register_type: discrete_input
address: 51
device_class: problem
entity_category: diagnostic
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} E4 (3ph sequence)
register_type: discrete_input
address: 52
device_class: problem
disabled_by_default: true
entity_category: diagnostic
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} E5 (PSU out of range)
register_type: discrete_input
address: 53
device_class: problem
entity_category: diagnostic
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} E6 (Low water flow)
register_type: discrete_input
address: 54
device_class: problem
entity_category: diagnostic
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} E7 (Water outlet temp out of range)
register_type: discrete_input
address: 55
device_class: problem
entity_category: diagnostic
sensor:
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Compressor Speed
unit_of_measurement: '%'
register_type: read
address: 0
value_type: U_WORD
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Compressor target frequency
unit_of_measurement: 'Hz'
register_type: read
address: 1
value_type: U_WORD
device_class: frequency
entity_category: diagnostic
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} PFC Voltage
id: pool_heatpump_pfc_V
unit_of_measurement: 'V'
register_type: read
address: 2
value_type: U_WORD
device_class: voltage
entity_category: diagnostic
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Water Inlet Temperature
unit_of_measurement: '°C'
register_type: read
address: 3
force_new_range: true
value_type: U_WORD
device_class: temperature
filters:
- offset: -60
- multiply: 0.5
accuracy_decimals: 1
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Water Outlet Temperature
unit_of_measurement: '°C'
register_type: read
address: 4
value_type: U_WORD
device_class: temperature
filters:
- offset: -60
- multiply: 0.5
accuracy_decimals: 1
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Ambient Temperature
unit_of_measurement: '°C'
register_type: read
address: 5
value_type: U_WORD
device_class: temperature
filters:
- offset: -60
- multiply: 0.5
accuracy_decimals: 1
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Gas Exhaust Temperature
unit_of_measurement: '°C'
register_type: read
address: 6
force_new_range: true
value_type: U_WORD
device_class: temperature
filters:
- offset: -60
- multiply: 0.5
accuracy_decimals: 1
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Outer Coil Pipe Temperature (evaporator)
unit_of_measurement: '°C'
register_type: read
address: 7
value_type: U_WORD
device_class: temperature
filters:
- offset: -60
- multiply: 0.5
accuracy_decimals: 1
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Gas Return Temperature
unit_of_measurement: '°C'
register_type: read
address: 8
value_type: U_WORD
device_class: temperature
filters:
- offset: -60
- multiply: 0.5
accuracy_decimals: 1
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Inner Coil Pipe Temperature (heat exchanger)
unit_of_measurement: '°C'
register_type: read
address: 9
force_new_range: true
value_type: U_WORD
device_class: temperature
filters:
- offset: -60
- multiply: 0.5
accuracy_decimals: 1
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Compressor Frequency
unit_of_measurement: 'Hz'
register_type: read
address: 10
value_type: U_WORD
device_class: frequency
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Compressor Current
id: pool_heatpump_pfc_A
unit_of_measurement: 'A'
register_type: read
address: 11
value_type: U_WORD
device_class: current
filters:
- multiply: 0.1
accuracy_decimals: 1
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Cooling plate temperature
unit_of_measurement: '°C'
register_type: read
address: 12
force_new_range: true
value_type: U_WORD
device_class: temperature
filters:
- multiply: 0.5
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Expansion Valve opening
unit_of_measurement: '%'
register_type: read
address: 13
value_type: U_WORD
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} DC Fan Motor Speed
unit_of_measurement: 'RPM'
register_type: read
address: 14
value_type: U_WORD
#filters:
# - multiply: 0.1
- platform: uptime
name: Relay Uptime
- platform: wifi_signal
name: Relay WiFi Signal
update_interval: 60s
- platform: template
name: ${name_prefix} Power
id: pool_heatpump_power
device_class: power
unit_of_measurement: 'W'
lambda: |-
if (id(pool_heatpump_pfc_A).state) {
return id(pool_heatpump_pfc_A).state * id(pool_heatpump_pfc_V).state;
} else {
return 0.0;
}
update_interval: 5s
# Discrete Inputs
# 0 - on/off
# 1 - defrosting
# 2-6 DIN1-5
# 7-15 OUT1-9
# 16 - Malfunction / protection indicator
# 17 - Compressor running demands
# 48-59 - E0->Eb
# 61 - Ed
# 64-74 - P0->Pa
# 80-91 - F0->Fb
# Holding Registers
select:
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Function
address: 0
value_type: U_WORD
optionsmap:
'Auto': 0
'Heating': 1
'Cooling': 2
disabled_by_default: true
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Working mode
address: 1
value_type: U_WORD
optionsmap:
'Smart': 0
'Silence': 1
'Super Silent': 2
'Turbo': 3
number:
- platform: modbus_controller
modbus_controller_id: heatpump
name: ${name_prefix} Heat setpoint
unit_of_measurement: "°C"
device_class: temperature
address: 3
force_new_range: true
value_type: U_WORD
min_value: 18 # docs say 12
max_value: 40
lambda: "return (x - 60)/2;"
write_lambda: "return ((x * 2) + 60);"
# *0 - Function [0: Auto, 1*: Heating, 2: Cooling]
# 1 - Working Mode Selection [0:Smart, *1: iSilence, 3: Turbo]
# 2 - Auto Mode temp range [84-140, *112 default, step:2] [type 1]
# *3 - Heating mode Temp range [84-140, *112 default, step:2] [type 1]
# 4 - Cooling mode Temp range [84-140, *112 default, step:2] [type 1]
# 5 - Water pump working mode (P0) - [0* Continuous, 1: Water temp control, 2: Time/Water temp control]
# *6 - Water pump working time setting (P1) 10-120(mins) default: 60, step 5
# 7 - compressor continuously running time be.. (30-90 mins, default: 30, step 1)
# 8 - Defrost start temperature (P3) - (26-60, temp type 1, def = 46, step 2 [-7C]
# *9 - Max defrost time (P4) mins (1-12, def 12, step 1)
# 10 - Defrost exit temp (P5) - type 1 (76-120, step 2, def: 86 = 13c
# 17 (may need to start at *15) -Expansion overheat level - 40-100, temp type 1, srep 2, def = 66 (3C)
#*18 - Expansion overheat level - 40-100, temp type 1, srep 2, def = 64 (2C)
# 25 - Power off restart memory - [0: power off, 1: restore pre-power-down stae]
# Input registers
# 0 - Compressor running speed (%)
# 1 - Compressor target frequency (Hz)
# 2 - PFC Voltage (V)
# *3 - Water inlet temp (AIN1) [type 1]
# 4 - Water outlet temp (AIN2)[type 1]
# 5 - Ambient Temp (AIN7) [type 1]
# *6 - Gas exhaust temp (AIN5) [divide by 2]
# 7 - Outer coil pipe temp (evaporator) AIN3 [type 1]
# 8 - Gas return temp (AIN6) - [type 1]
# *9 - Inner coil pipe temp (Heat exchanger) - AIN4 [type 1]
# 10 - Compressor Frequency (Hz)
# 11 - Compressor Current (x10 A)
#*12 - Cooling plate temp (divide by 2)
# 13 - Elect Expansion Valve Openo
# Temp type 1 conversion:
# Actual = (display - 60)/2, ie '116' = (116-60)/2 = 56/2 = 28C
# CAN interface via a VP231 chip (SN65HVD231)
# https://www.ti.com/lit/ds/symlink/sn65hvd232.pdf
canbus:
- platform: esp32_can
tx_pin: GPIO26
rx_pin: GPIO27
can_id: 1
# GPIO23 seems to be 'RS' - Mode select pin: strong pull down to GND = high speed mode, strong pull up to VCC = low power mode, 10kΩ to 100kΩ pull down to GND = slope control mode