forked from syssi/esphome-seplos-bms
-
Notifications
You must be signed in to change notification settings - Fork 1
/
esp32-s3-ruixu-multiple-example.yaml
784 lines (709 loc) · 30.3 KB
/
esp32-s3-ruixu-multiple-example.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
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
substitutions:
name: bms
friendly_name: bms # this will be appended before the entitiy names as per newer ESPhome standard - leave "bms" to work with my dashboards by default
batt_0: "batt 0"
batt_1: "batt 1"
batt_2: "batt 2"
batt_3: "batt 3"
device_description: "Monitor and control a Ruixu BMS via RS485 (Modbus) with M5Stack Atomic ESP32 S3 lite"
tx_pin: GPIO2 # M5stack Atom S3 + Atomic RS485 base = GPIO6 | Isolated RS485 Grove module = GPIO2
rx_pin: GPIO1 # M5stack Atom S3 + Atomic RS485 base = GPIO5 | Isolated RS485 Grove module = GPIO1
external_components_source: github://easybotics/esphome-ruixu-bms@main
esphome:
name: ${name}
friendly_name: ${friendly_name}
comment: ${device_description}
min_version: 2024.6.0
project:
name: "syssi.esphome-seplos-bms"
version: 1.2.0
external_components:
- source: ${external_components_source}
refresh: 0s
preferences:
flash_write_interval: 24h # prevent the flash from wearing out
esp32:
board: esp32-s3-devkitc-1 # m5stack-atoms3 #hardware is M5stack Atom S3 Lite with Atomic RS485 base - but the closest define with this version of platformio is the esp32-s3-devkitc-1
variant: esp32s3
framework:
type: arduino
# Enable logging
logger:
#level: VERBOSE
baud_rate: 921600 # faster logging
# Enable Home Assistant API
api:
encryption:
key: ""
ota:
- platform: esphome
password: ""
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
time:
- platform: homeassistant
id: esptime
uart:
- id: uart_0
baud_rate: 9600
tx_pin: ${tx_pin}
rx_pin: ${rx_pin}
#debug:
# direction: BOTH
# dummy_receiver: false
# after:
# delimiter: "0x16"
# sequence:
# - lambda: |-
# UARTDebug::log_string(direction, bytes); // both of these data types are useful for debugging issues or reverse engineering protocols
# UARTDebug::log_hex(direction, bytes, ' '); // cyber chef is also very nice https://gchq.github.io/CyberChef/#recipe=From_Base(16)Multiply('Line%20feed')From_Charcode('Space',16/disabled)&input=NkQ2MA
seplos_modbus:
id: modbus0
uart_id: uart_0
rx_timeout: 150ms
# RS485 transceiver should only be connected to the master BMS OUT port - the same one going to the inverter - it will not work correctly on any other battery or port!!
# the master battery CAN lines (middle pair) go to the inverter - the last pair (brown) go to the RS485 transceiver
# it will NOT work correclty on the extra port on the last slave battery.
# the Ruixu BMS seems sensitive to when the data is sent - if the logs show only 1 battery data being received try adjusting the interval or just restarting the ESP32
seplos_bms:
- id: bms0
address: 0x00 # master BMS
protocol_version: 0x21 # Known protocol versions: 0x20 (Seplos), 0x26 (Boqiang), 0x21 (Ruixu)
seplos_modbus_id: modbus0
update_interval: 4.5s # it seems that offsetting these intervals helps with making sure all 3 battery requests dont interfere with eachother.
- id: bms1
address: 0x01 # slave #1
protocol_version: 0x21 # Known protocol versions: 0x20 (Seplos), 0x26 (Boqiang), 0x21 (Ruixu)
seplos_modbus_id: modbus0
update_interval: 5s
- id: bms2
address: 0x02 # slave #2
protocol_version: 0x21 # Known protocol versions: 0x20 (Seplos), 0x26 (Boqiang), 0x21 (Ruixu)
seplos_modbus_id: modbus0
update_interval: 5.5s
- id: bms2
address: 0x02 # slave #3
protocol_version: 0x21 # Known protocol versions: 0x20 (Seplos), 0x26 (Boqiang), 0x21 (Ruixu)
seplos_modbus_id: modbus0
update_interval: 5.9s
binary_sensor:
- platform: status # exposes the node state in HA
name: "Node Status"
id: system_status
text_sensor:
- platform: wifi_info # exposes the node IP in HA
ip_address:
name: ESP IP Address
id: ip_address
sensor:
# these sensors calcualte kWh (energy) and are very useful - the separate IN / OUT sensors are necessary for the HA default power monitoring and the https://github.com/slipx06/sunsynk-power-flow-card which is highly recommended
- { power_id: batt_0_power_net, platform: total_daily_energy, method: left, accuracy_decimals: 2, unit_of_measurement: 'kWh', id: batt_0_energy_net, name: "${batt_0} daily energy net"}
- { power_id: batt_0_power_in, platform: total_daily_energy, method: left, accuracy_decimals: 2, unit_of_measurement: 'kWh', id: batt_0_energy_in, name: "${batt_0} daily energy in"}
- { power_id: batt_0_power_out, platform: total_daily_energy, method: left, accuracy_decimals: 2, unit_of_measurement: 'kWh', id: batt_0_energy_out, name: "${batt_0} daily energy out"}
- { power_id: batt_1_power_net, platform: total_daily_energy, method: left, accuracy_decimals: 2, unit_of_measurement: 'kWh', id: batt_1_net_energy_net, name: "${batt_1} daily energy net"}
- { power_id: batt_1_power_in, platform: total_daily_energy, method: left, accuracy_decimals: 2, unit_of_measurement: 'kWh', id: batt_1_energy_in, name: "${batt_1} daily energy in"}
- { power_id: batt_1_power_out, platform: total_daily_energy, method: left, accuracy_decimals: 2, unit_of_measurement: 'kWh', id: batt_1_energy_out, name: "${batt_1} daily energy out"}
- { power_id: batt_2_power_net, platform: total_daily_energy, method: left, accuracy_decimals: 2, unit_of_measurement: 'kWh', id: batt_2_energy_net, name: "${batt_2} daily energy net"}
- { power_id: batt_2_power_in, platform: total_daily_energy, method: left, accuracy_decimals: 2, unit_of_measurement: 'kWh', id: batt_2_energy_in, name: "${batt_2} daily energy in"}
- { power_id: batt_2_power_out, platform: total_daily_energy, method: left, accuracy_decimals: 2, unit_of_measurement: 'kWh', id: batt_2_energy_out, name: "${batt_2} daily energy out"}
- { power_id: batt_3_power_net, platform: total_daily_energy, method: left, accuracy_decimals: 2, unit_of_measurement: 'kWh', id: batt_3_energy_net, name: "${batt_3} daily energy net"}
- { power_id: batt_3_power_in, platform: total_daily_energy, method: left, accuracy_decimals: 2, unit_of_measurement: 'kWh', id: batt_3_energy_in, name: "${batt_3} daily energy in"}
- { power_id: batt_3_power_out, platform: total_daily_energy, method: left, accuracy_decimals: 2, unit_of_measurement: 'kWh', id: batt_3_energy_out, name: "${batt_3} daily energy out"}
- { power_id: bank_power_net, platform: total_daily_energy, method: left, accuracy_decimals: 2, unit_of_measurement: 'kWh', id: bank_energy_net, name: "bank daily energy net"}
- { power_id: bank_power_in, platform: total_daily_energy, method: left, accuracy_decimals: 2, unit_of_measurement: 'kWh', id: bank_energy_in, name: "bank daily energy in"}
- { power_id: bank_power_out, platform: total_daily_energy, method: left, accuracy_decimals: 2, unit_of_measurement: 'kWh', id: bank_energy_out, name: "bank daily energy out"}
# these combine all _x batteries into one sensor - if you have more batteries or less you will have to adjust everything to match
- platform: combination
type: sum
name: "bank power net"
id: bank_power_net
sources:
- source: batt_0_power_net
- source: batt_1_power_net
- source: batt_2_power_net
- source: batt_3_power_net
- platform: combination
type: sum
name: "bank power in"
id: bank_power_in
sources:
- source: batt_0_power_in
- source: batt_1_power_in
- source: batt_2_power_in
- source: batt_3_power_in
- platform: combination
type: sum
name: "bank power out"
id: bank_power_out
sources:
- source: batt_0_power_out
- source: batt_1_power_out
- source: batt_2_power_out
- source: batt_3_power_out
- platform: combination
type: sum
name: "bank current"
id: bank_net_current
sources:
- source: batt_0_current
- source: batt_1_current
- source: batt_2_current
- source: batt_3_current
- platform: combination
type: mean
name: "bank voltage mean"
id: bank_mean_voltage
sources:
- source: batt_0_voltage_total
- source: batt_1_voltage_total
- source: batt_2_voltage_total
- source: batt_3_voltage_total
- platform: combination
type: max
name: "bank voltage cell max"
id: bank_max_cell_voltage
sources:
- source: batt_0_voltage_cell_max
- source: batt_1_voltage_cell_max
- source: batt_2_voltage_cell_max
- source: batt_3_voltage_cell_max
- platform: combination
type: min
name: "bank voltage cell min"
id: bank_min_cell_voltage
sources:
- source: batt_0_voltage_cell_min
- source: batt_1_voltage_cell_min
- source: batt_2_voltage_cell_min
- source: batt_3_voltage_cell_min
# you will need one of these sections for each battery you have - copy this into notepad++ or some other text editor and do a "find and replace" on the batt_0 to your new value "batt_3" and then paste that in at the end to add another battery
- platform: seplos_bms #################################### batt_0 ###################################
seplos_bms_id: bms0
min_cell_voltage:
name: "${batt_0} voltage cell min"
id: batt_0_voltage_cell_min
max_cell_voltage:
name: "${batt_0} voltage cell max"
id: batt_0_voltage_cell_max
min_voltage_cell:
name: "${batt_0} voltage cell min number"
id: batt_0_voltage_cell_min_number
max_voltage_cell:
name: "${batt_0} voltage cell max number"
id: batt_0_voltage_cell_max_number
delta_cell_voltage:
name: "${batt_0} voltage cell delta"
id: batt_0_voltage_cell_delta
average_cell_voltage:
name: "${batt_0} voltage cell average"
id: batt_0_voltage_cell_average
cell_voltage_1:
name: "${batt_0} voltage cell 1"
cell_voltage_2:
name: "${batt_0} voltage cell 2"
cell_voltage_3:
name: "${batt_0} voltage cell 3"
cell_voltage_4:
name: "${batt_0} voltage cell 4"
cell_voltage_5:
name: "${batt_0} voltage cell 5"
cell_voltage_6:
name: "${batt_0} voltage cell 6"
cell_voltage_7:
name: "${batt_0} voltage cell 7"
cell_voltage_8:
name: "${batt_0} voltage cell 8"
cell_voltage_9:
name: "${batt_0} voltage cell 9"
cell_voltage_10:
name: "${batt_0} voltage cell 10"
cell_voltage_11:
name: "${batt_0} voltage cell 11"
cell_voltage_12:
name: "${batt_0} voltage cell 12"
cell_voltage_13:
name: "${batt_0} voltage cell 13"
cell_voltage_14:
name: "${batt_0} voltage cell 14"
cell_voltage_15:
name: "${batt_0} voltage cell 15"
cell_voltage_16:
name: "${batt_0} voltage cell 16"
temperature_1:
name: "${batt_0} temperature 1"
temperature_2:
name: "${batt_0} temperature 2"
temperature_3:
name: "${batt_0} temperature 3"
temperature_4:
name: "${batt_0} temperature 4"
temperature_5:
name: "${batt_0} temperature environment"
temperature_6:
name: "${batt_0} temperature mosfet"
total_voltage:
name: "${batt_0} voltage total"
id: batt_0_voltage_total
current:
name: "${batt_0} current"
id: batt_0_current
power:
name: "${batt_0} power net"
id: batt_0_power_net
filters:
- multiply: 0.001 # Multiplication factor from W to kW is 0.001
unit_of_measurement: 'kW'
accuracy_decimals: 3
charging_power:
name: "${batt_0} power in"
id: batt_0_power_in
filters:
- multiply: 0.001 # Multiplication factor from W to kW is 0.001
unit_of_measurement: 'kW'
accuracy_decimals: 3
discharging_power:
name: "${batt_0} power out"
id: batt_0_power_out
filters:
- multiply: 0.001 # Multiplication factor from W to kW is 0.001
unit_of_measurement: 'kW'
accuracy_decimals: 3
residual_capacity:
name: "${batt_0} remaining capacity"
battery_capacity:
name: "${batt_0} battery capacity"
state_of_charge:
name: "${batt_0} state of charge"
charging_cycles:
name: "${batt_0} charging cycles"
state_of_health:
name: "${batt_0} state of health"
- platform: seplos_bms #################################### batt_1 ###################################
seplos_bms_id: bms1
min_cell_voltage:
name: "${batt_1} voltage cell min"
id: batt_1_voltage_cell_min
max_cell_voltage:
name: "${batt_1} voltage cell max"
id: batt_1_voltage_cell_max
min_voltage_cell:
name: "${batt_1} voltage cell min number"
id: batt_1_voltage_cell_min_number
max_voltage_cell:
name: "${batt_1} voltage cell max number"
id: batt_1_voltage_cell_max_number
delta_cell_voltage:
name: "${batt_1} voltage cell delta"
id: batt_1_voltage_cell_delta
average_cell_voltage:
name: "${batt_1} voltage cell average"
id: batt_1_voltage_cell_average
cell_voltage_1:
name: "${batt_1} voltage cell 1"
cell_voltage_2:
name: "${batt_1} voltage cell 2"
cell_voltage_3:
name: "${batt_1} voltage cell 3"
cell_voltage_4:
name: "${batt_1} voltage cell 4"
cell_voltage_5:
name: "${batt_1} voltage cell 5"
cell_voltage_6:
name: "${batt_1} voltage cell 6"
cell_voltage_7:
name: "${batt_1} voltage cell 7"
cell_voltage_8:
name: "${batt_1} voltage cell 8"
cell_voltage_9:
name: "${batt_1} voltage cell 9"
cell_voltage_10:
name: "${batt_1} voltage cell 10"
cell_voltage_11:
name: "${batt_1} voltage cell 11"
cell_voltage_12:
name: "${batt_1} voltage cell 12"
cell_voltage_13:
name: "${batt_1} voltage cell 13"
cell_voltage_14:
name: "${batt_1} voltage cell 14"
cell_voltage_15:
name: "${batt_1} voltage cell 15"
cell_voltage_16:
name: "${batt_1} voltage cell 16"
temperature_1:
name: "${batt_1} temperature 1"
temperature_2:
name: "${batt_1} temperature 2"
temperature_3:
name: "${batt_1} temperature 3"
temperature_4:
name: "${batt_1} temperature 4"
temperature_5:
name: "${batt_1} temperature environment"
temperature_6:
name: "${batt_1} temperature mosfet"
total_voltage:
name: "${batt_1} voltage total"
id: batt_1_voltage_total
current:
name: "${batt_1} current"
id: batt_1_current
power:
name: "${batt_1} power net"
id: batt_1_power_net
filters:
- multiply: 0.001 # Multiplication factor from W to kW is 0.001
unit_of_measurement: 'kW'
accuracy_decimals: 3
charging_power:
name: "${batt_1} power in"
id: batt_1_power_in
filters:
- multiply: 0.001 # Multiplication factor from W to kW is 0.001
unit_of_measurement: 'kW'
accuracy_decimals: 3
discharging_power:
name: "${batt_1} power out"
id: batt_1_power_out
filters:
- multiply: 0.001 # Multiplication factor from W to kW is 0.001
unit_of_measurement: 'kW'
accuracy_decimals: 3
residual_capacity:
name: "${batt_1} remaining capacity"
battery_capacity:
name: "${batt_1} battery capacity"
state_of_charge:
name: "${batt_1} state of charge"
charging_cycles:
name: "${batt_1} charging cycles"
state_of_health:
name: "${batt_1} state of health"
- platform: seplos_bms #################################### batt_2 ###################################
seplos_bms_id: bms2
min_cell_voltage:
name: "${batt_2} voltage cell min"
id: batt_2_voltage_cell_min
max_cell_voltage:
name: "${batt_2} voltage cell max"
id: batt_2_voltage_cell_max
min_voltage_cell:
name: "${batt_2} voltage cell min number"
id: batt_2_voltage_cell_min_number
max_voltage_cell:
name: "${batt_2} voltage cell max number"
id: batt_2_voltage_cell_max_number
delta_cell_voltage:
name: "${batt_2} voltage cell delta"
id: batt_2_voltage_cell_delta
average_cell_voltage:
name: "${batt_2} voltage cell average"
id: batt_2_voltage_cell_average
cell_voltage_1:
name: "${batt_2} voltage cell 1"
cell_voltage_2:
name: "${batt_2} voltage cell 2"
cell_voltage_3:
name: "${batt_2} voltage cell 3"
cell_voltage_4:
name: "${batt_2} voltage cell 4"
cell_voltage_5:
name: "${batt_2} voltage cell 5"
cell_voltage_6:
name: "${batt_2} voltage cell 6"
cell_voltage_7:
name: "${batt_2} voltage cell 7"
cell_voltage_8:
name: "${batt_2} voltage cell 8"
cell_voltage_9:
name: "${batt_2} voltage cell 9"
cell_voltage_10:
name: "${batt_2} voltage cell 10"
cell_voltage_11:
name: "${batt_2} voltage cell 11"
cell_voltage_12:
name: "${batt_2} voltage cell 12"
cell_voltage_13:
name: "${batt_2} voltage cell 13"
cell_voltage_14:
name: "${batt_2} voltage cell 14"
cell_voltage_15:
name: "${batt_2} voltage cell 15"
cell_voltage_16:
name: "${batt_2} voltage cell 16"
temperature_1:
name: "${batt_2} temperature 1"
temperature_2:
name: "${batt_2} temperature 2"
temperature_3:
name: "${batt_2} temperature 3"
temperature_4:
name: "${batt_2} temperature 4"
temperature_5:
name: "${batt_2} temperature environment"
temperature_6:
name: "${batt_2} temperature mosfet"
total_voltage:
name: "${batt_2} voltage total"
id: batt_2_voltage_total
current:
name: "${batt_2} current"
id: batt_2_current
power:
name: "${batt_2} power net"
id: batt_2_power_net
filters:
- multiply: 0.001 # Multiplication factor from W to kW is 0.001
unit_of_measurement: 'kW'
accuracy_decimals: 3
charging_power:
name: "${batt_2} power in"
id: batt_2_power_in
filters:
- multiply: 0.001 # Multiplication factor from W to kW is 0.001
unit_of_measurement: 'kW'
accuracy_decimals: 3
discharging_power:
name: "${batt_2} power out"
id: batt_2_power_out
filters:
- multiply: 0.001 # Multiplication factor from W to kW is 0.001
unit_of_measurement: 'kW'
accuracy_decimals: 3
residual_capacity:
name: "${batt_2} remaining capacity"
battery_capacity:
name: "${batt_2} battery capacity"
state_of_charge:
name: "${batt_2} state of charge"
charging_cycles:
name: "${batt_2} charging cycles"
state_of_health:
name: "${batt_2} state of health"
- platform: seplos_bms #################################### batt_3 ###################################
seplos_bms_id: bms3
min_cell_voltage:
name: "${batt_3} voltage cell min"
id: batt_3_voltage_cell_min
max_cell_voltage:
name: "${batt_3} voltage cell max"
id: batt_3_voltage_cell_max
min_voltage_cell:
name: "${batt_3} voltage cell min number"
id: batt_3_voltage_cell_min_number
max_voltage_cell:
name: "${batt_3} voltage cell max number"
id: batt_3_voltage_cell_max_number
delta_cell_voltage:
name: "${batt_3} voltage cell delta"
id: batt_3_voltage_cell_delta
average_cell_voltage:
name: "${batt_3} voltage cell average"
id: batt_3_voltage_cell_average
cell_voltage_1:
name: "${batt_3} voltage cell 1"
cell_voltage_2:
name: "${batt_3} voltage cell 2"
cell_voltage_3:
name: "${batt_3} voltage cell 3"
cell_voltage_4:
name: "${batt_3} voltage cell 4"
cell_voltage_5:
name: "${batt_3} voltage cell 5"
cell_voltage_6:
name: "${batt_3} voltage cell 6"
cell_voltage_7:
name: "${batt_3} voltage cell 7"
cell_voltage_8:
name: "${batt_3} voltage cell 8"
cell_voltage_9:
name: "${batt_3} voltage cell 9"
cell_voltage_10:
name: "${batt_3} voltage cell 10"
cell_voltage_11:
name: "${batt_3} voltage cell 11"
cell_voltage_12:
name: "${batt_3} voltage cell 12"
cell_voltage_13:
name: "${batt_3} voltage cell 13"
cell_voltage_14:
name: "${batt_3} voltage cell 14"
cell_voltage_15:
name: "${batt_3} voltage cell 15"
cell_voltage_16:
name: "${batt_3} voltage cell 16"
temperature_1:
name: "${batt_3} temperature 1"
temperature_2:
name: "${batt_3} temperature 2"
temperature_3:
name: "${batt_3} temperature 3"
temperature_4:
name: "${batt_3} temperature 4"
temperature_5:
name: "${batt_3} temperature environment"
temperature_6:
name: "${batt_3} temperature mosfet"
total_voltage:
name: "${batt_3} voltage total"
id: batt_3_voltage_total
current:
name: "${batt_3} current"
id: batt_3_current
power:
name: "${batt_3} power net"
id: batt_3_power_net
filters:
- multiply: 0.001 # Multiplication factor from W to kW is 0.001
unit_of_measurement: 'kW'
accuracy_decimals: 3
charging_power:
name: "${batt_3} power in"
id: batt_3_power_in
filters:
- multiply: 0.001 # Multiplication factor from W to kW is 0.001
unit_of_measurement: 'kW'
accuracy_decimals: 3
discharging_power:
name: "${batt_3} power out"
id: batt_3_power_out
filters:
- multiply: 0.001 # Multiplication factor from W to kW is 0.001
unit_of_measurement: 'kW'
accuracy_decimals: 3
residual_capacity:
name: "${batt_3} remaining capacity"
battery_capacity:
name: "${batt_3} battery capacity"
state_of_charge:
name: "${batt_3} state of charge"
charging_cycles:
name: "${batt_3} charging cycles"
state_of_health:
name: "${batt_3} state of health"
####################################################################### OLD REVERSE ENGINEERING DATA - left for posterity ###############################################
#- platform: template
# name: "Bank Net Power"
# id: batt_net_power
# lambda: |-
# return (-id(batt_0_power).state + id(batt_1_power).state + id(batt_2_power).state);
# update_interval: 5s
# unit_of_measurement: "W"
# icon: mdi:flash
# device_class: "power"
# state_class: "measurement"
# Ruixu Battery Testing with windows application / reverse engineering
# First request in Strings: \xEF\x00\xFB\x00\xFF\x05\x16\
# 2 \xEF\x00\x83\x04\x00e\x00\x01\xFF\x13\x16 e = 0x65
# 3 \xEF\x00\x83\x04\x00\xB5\x00\x01\xFE\xC3\x16
# 4 ~21004642E00200FD36\r
# 5 ~21004644E00200FD34\r
# 6 \xEF\x00\xBD\x04\x01\x12\x00 \xFF\f\x16
# 7 \xEF\x00\xBD\x04\x00\xFA\x00\x14\xFE1\x16
# 8 \xEF\x00\xBD\x04\x01\xD4\x00\x14\xFEV\x16
# 9 ~21004651E00200FD36\r
# 10 ~2100464D0000FD9B\r
# hex 1 EF 00 FB 00 FF 05 16
# hex 1 response EF 00 FB 0B 00 43 4E 31 30 2E 30 32 00 00 00 FD 78 16
# hex 2 EF 00 83 04 00 65 00 01 FF 13 16
# hex 2 response EF 00 83 04 00 02 7A A8 FE 55 16
# hex 3 EF 00 83 04 00 B5 00 01 FE C3 16
# hex 3 response EF 00 83 04 00 02 00 FF FE 78 16
# hex 4 7E 32 31 30 30 34 36 34 32 45 30 30 32 30 30 46 44 33 36 0D
# hex 4 response 7e 32 31 30 30 34 36 30 30 38 30 38 30 30 30 31 30 30 43 45 32 30 43 45 31 30 43 44 46 30 43 45 32 30 43 45 30 30 43 45 33 30 43 44 46 30 43 45 31 30 43 44 46 30 43 45 31 30 43 45 31 30 43 45 30 30 43 45 30 30 43 45 31 30 43 45 30 30 43 45 30 30 37 30 42 43 43 30 42 44 31 30 42 43 45 30 42 43 46 30 42 44 42 30 42 43 43 30 42 44 37 30 30 30 30 31 34 39 35 34 38 41 37 30 34 37 41 41 38 30 30 30 31 33 42 36 34 30 30 30 30 45 30 44 33 5c 72
# this is the cell voltage I belive 30 43 45 32 = 3.298v 30 43 44 46 = 3.295v 30 43 45 30 = 3.296v = last voltage
# hex 5 7E 32 31 30 30 34 36 34 34 45 30 30 32 30 30 46 44 33 34 0D
# hex 5 response 7e 32 31 30 30 34 36 30 30 32 30 34 41 30 30 31 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 37 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 38 30 30 30 36 30 30 30 30 30 30 30 30 30 30 30 30 45 46 41 36 5c 72
# hex 6 EF 00 BD 04 01 12 00 20 FF 0A 16
# hex 7 EF 00 BD 04 00 FA 00 14 FE 31 16
# hex 8 EF 00 BD 04 01 D4 00 14 FE 56 16
# hex 9 7E 32 31 30 30 34 36 35 31 45 30 30 32 30 30 46 44 33 36 0D
# hex 10 7E 32 31 30 30 34 36 34 44 30 30 30 30 46 44 39 42 0D
# 7E 32 31 30 30 34 36 30 30 32 30 30 45 30 37 45 38 30 39 30 44 30 37 30 31 30 30 46 41 42 33 0D
# request 1
# >>> "\xEF\x00\xFB\x00\xFF\x05\x16"
# >>> EF 00 FB 00 FF 05 16
# <<< "\xEF\x00\xFB\v\x00CN10.02\x00\x00\x00\xFDx\x16"
# <<< EF 00 FB 0B 00 43 4E 31 30 2E 30 32 00 00 00 FD 78 16
# request 2
# >>> "\xEF\x00\x83\x04\x00e\x00\x01\xFF\x13\x16"
# >>> EF 00 83 04 00 65 00 01 FF 13 16
# <<< "\xEF\x00\x83\x04\x00\x02z\xA8\xFEU\x16"
# <<< EF 00 83 04 00 02 7A A8 FE 55 16
# 02 = maybe binary?? 00000010
# 7A = 01111010
# request 3
# >>> "\xEF\x00\x83\x04\x00\xB5\x00\x01\xFE\xC3\x16"
# >>> EF 00 83 04 00 B5 00 01 FE C3 16
# <<< "\xEF\x00\x83\x04\x00\x02\x00\xFF\xFEx\x16"
# <<< EF 00 83 04 00 02 00 FF FE 78 16
# 02 = maybe binary?? 00000010
# 00 = 0
# request 4 - cell volts 0x42 = get analog value for old pylon protocol
# >>> "~21004642E00200FD36\r"
# >>> 7E 32 31 30 30 34 36 34 32 45 30 30 32 30 30 46 44 33 36 0D
# ~21004600808000 10 0CE00CDF0CDD0CE00CDE0CE10CDD0CDF0CDD0CDF0CDF0CDE0CDE0CDE0CDE0CDE 070BAE0BB20BAF0BB00BC60BB80BC00000149148A7047AA800013B640000E056
# ~21004600808000 starting data
# 10 = 16 cell count
# 0CE0 = 3.296v cell 1 voltage
# 0CDF = 3.295v cell 2 voltage
# 0CDD0CE00CDE0CE10CDD0CDF0CDD0CDF0CDF0CDE0CDE0CDE0CDE0CDE - remaining cell voltages
# 07 = 7 -temperature count = number of sensors
# 0BAE = 29.90 -Temp Cell 1
# 0BB2 = 29.94
# 0BAF = 29.91
# 0BB0 = 29.92
# 0BC6 = 30.14
# 0BB8 = 30.00
# 0BC0 = 30.08
# 0000 = 0 -Pack A?? Signed integer charge is positive
# 1491 = 52.65v -Pack V
# 48A7 = 18599mAh -remaining Ah
# 04 = 04 -Manual says "custom quantity"
# 7AA8 = 314.00Ah -full capacity Ah
# 0001 = 1 -cycles
# 3B = 59 -SOC% :)
# 64 = 100 -SOH??
# 0000
# E056\r - ending
# <<< 7E 32 31 30 30 34 36 30 30 38 30 38 30 30 30 31 30 30 43 45 30 30 43 44 46 30 43 44 44 30 43 45 30 30 43 44 45 30 43 45 31 30 43 44 44 30 43 44 46 30 43 44 44 30 43 44 46 30 43 44 46 30 43 44 45 30 43 44 45 30 43 44 45 30 43 44 45 30 43 44 45 30 37 30 42 41 45 30 42 42 32 30 42 41 46 30 42 42 30 30 42 43 36 30 42 42 38 30 42 43 30 30 30 30 30 31 34 39 31 34 38 41 37 30 34 37 41 41 38 30 30 30 31 33 42 36 34 30 30 30 30 45 30 35 36 0D
# 16 30 43 45 32 = 3.298v 30 43 44 46 = 3.295v 30 43 45 30 = 3.296v = last voltage
# cell count
# request 5 - error flags / code? 0x44 = get alarm data for old pylon protocol
# >>> "~21004644E00200FD34\r"
# >>> 7E 32 31 30 30 34 36 34 34 45 30 30 32 30 30 46 44 33 34 0D
# <<< "~21004600204A00 10 0000000000000000000000000000000007000000000000000000080006000000000000EFA6\r"
# ~21004600204A00 10 0000000000000000000000000000000007000000000000000000
# 08 = Dischard current
# 00
# 06 = Status #2 flag bits DFET and CFET on
# 000000000000EFA6\r
# <<< 7E 32 31 30 30 34 36 30 30 32 30 34 41 30 30 31 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 37 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 38 30 30 30 36 30 30 30 30 30 30 30 30 30 30 30 30 45 46 41 36 0D
# request 6 - error flags / code? 901227970007 = Battery code
# >>> "\xEF\x00\xBD\x04\x01\x12\x00 \xFF\f\x16"
# >>> EF 00 BD 04 01 12 00 20 FF 0C 16
# <<< "\xEF\x00\xBD\"\x00 9012 27970007\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFC\x95\x16"
# <<< EF 00 BD 22 00 20 39 30 31 32 32 37 39 37 30 30 30 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FC 95 16
# request 7 - BMS SN1 serial number 1 = 90116322 2405150023
# >>> "\xEF\x00\xBD\x04\x00\xFA\x00\x14\xFE1\x16"
# >>> EF 00 BD 04 00 FA 00 14 FE 31 16
# <<< "\xEF\x00\xBD\x16\x00\x1490116322 2405150023\x00\xFBk\x16"
# <<< EF 00 BD 16 00 14 39 30 31 31 36 33 32 32 20 32 34 30 35 31 35 30 30 32 33 00 FB 6B 16
# request 8 - BMS Serial number 2 = BMS4503004810000SZTB
# >>> "\xEF\x00\xBD\x04\x01\xD4\x00\x14\xFEV\x16"
# >>> EF 00 BD 04 01 D4 00 14 FE 56 16
# <<< "\xEF\x00\xBD\x16\x00\x14BMS4503004810000SZTB\xFAk\x16"
# <<< EF 00 BD 16 00 14 42 4D 53 34 35 30 33 30 30 34 38 31 30 30 30 30 53 5A 54 42 FA 6B 16
# request 9 - Hardware Version and BMS SN2 App shows RX01 for SW version. HW Version = RS_GA02V01_51200
# >>> "~21004651E00200FD36\r" = 0x51 = get manufacturer information
# >>> 7E 32 31 30 30 34 36 35 31 45 30 30 32 30 30 46 44 33 36 0D
# <<< "~21004600C040RS_GA02V01_51200 RX01BMS4503004810000SZTB F0E7\r"
# <<< 7E 32 31 30 30 34 36 30 30 43 30 34 30 52 53 5F 47 41 30 32 56 30 31 5F 35 31 32 30 30 20 20 20 20 52 58 30 31 42 4D 53 34 35 30 33 30 30 34 38 31 30 30 30 30 53 5A 54 42 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 46 30 45 37 0D
# request 10 - looks like time / date maybe 07E8 = 2024
# >>> "~2100464D0000FD9B\r"
# >>> 7E 32 31 30 30 34 36 34 44 30 30 30 30 46 44 39 42 0D
# <<< "~21004600200E07E8090D070100FAB3\r"
# <<< 7E 32 31 30 30 34 36 30 30 32 30 30 45 30 37 45 38 30 39 30 44 30 37 30 31 30 30 46 41 42 33 0D
# error example: EF 00 83 04 00 B5 00 01 FF 13 16 -the 13 is a miss type - so the response is some error I believe
# error response: EF 00 83 01 02 FF 7A 16