-
Notifications
You must be signed in to change notification settings - Fork 0
/
deye_rw-m6.1.yaml
779 lines (690 loc) · 24.4 KB
/
deye_rw-m6.1.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
# YAML for ESPHome for Deye RW-M6.1 Battery
# Not all messages are decoded. Use at your own risk!
esphome:
name: deyecan
friendly_name: DeyeCAN
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# level: INFO
# Enable Home Assistant API
api:
encryption:
key: !secret api_deyecan
ota:
- platform: esphome
password: !secret ota_deyecan
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
canbus:
- platform: esp32_can
tx_pin: GPIO23
rx_pin: GPIO22
can_id: 4
bit_rate: 500KBPS
on_frame:
# - can_id: 0 # listen to all messages
# can_id_mask: 0
- can_id: 0x351
then:
- lambda: |-
float u_max = ((x[1] << 8) | x[0]) / 10.0;
id(battery_charge_voltage).publish_state(u_max);
int i_charge = ((x[3] << 8) | x[2]) / 10;
id(battery_charge_current_limit).publish_state(i_charge);
int i_discharge = ((x[5] << 8) | x[4]) / 10;
id(battery_discharge_current_limit).publish_state(i_discharge);
float u_min = ((x[7] << 8) | x[6]) / 10.0;
id(battery_discharge_voltage).publish_state(u_min);
# ESP_LOGI("canid 0x351:", "U_max: %.1f V, I_charge %d A, I_discharge: %d A, U_min %.1f V", u_max, i_charge, i_discharge, u_min );
- can_id: 0x355
then:
- lambda: |-
int soc = ((x[1] << 8) | x[0]);
id(battery_soc).publish_state(soc);
int soh = ((x[3] << 8) | x[2]);
id(battery_soh).publish_state(soh);
# ESP_LOGI("canid 0x355:", "SoC %d %, SoH %d %",soc, soh );
- can_id: 0x356
then:
- lambda: |-
float voltage = ((x[1] << 8) | x[0]) / 100.0;
id(battery_voltage).publish_state(voltage);
float current = ((x[3] << 8) | x[2]) / 10;
if(x[3] > 0x80) current = uint16_t(~((x[3] << 8) | x[2]) + 1) / -10.0;
id(battery_current).publish_state(current);
float temperature = ((x[5] << 8) | x[4]) / 10;
id(battery_temperature).publish_state(temperature);
# ESP_LOGI("canid 0x356:", "U: %.1f V, I: %.1f A, T: %.1f °C", voltage, current, temperature );
#Deye specific
- can_id: 0x361
then:
- lambda: |-
float cell_u_max = ((x[1] << 8) | x[0]) / 1000.0;
id(battery_max_cell_voltage_deye).publish_state(cell_u_max);
float cell_u_min = ((x[3] << 8) | x[2]) / 1000.0;
id(battery_min_cell_voltage_deye).publish_state(cell_u_min);
float temp_max = ((x[5] << 8) | x[4]) / 10.0;
id(battery_temp_max_deye).publish_state(temp_max);
float temp_min = ((x[7] << 8) | x[6]) / 10.0;
id(battery_temp_min_deye).publish_state(temp_min);
- can_id: 0x371
then:
- lambda: |-
int i_charge = ((x[1] << 8) | x[0]) / 10;
id(battery_charge_current_limit_deye).publish_state(i_charge);
int i_discharge = ((x[3] << 8) | x[2]) / 10;
id(battery_discharge_current_limit_deye).publish_state(i_discharge);
- can_id: 0x150 #Pack 1
then:
- lambda: |-
float voltage = ((x[1] << 8) | x[0]) / 10.0;
id(pack_1_voltage).publish_state(voltage);
float current = ((x[3] << 8) | x[2]) / 10.0;
if(x[3] > 0x80) current = uint16_t(~((x[3] << 8) | x[2]) + 1) / -10.0;
id(pack_1_current).publish_state(current);
int soc = ((x[5] << 8) | x[4]) / 10.0;
id(pack_1_soc).publish_state(soc);
int soh = ((x[7] << 8) | x[6]) / 10.0;
id(pack_1_soh).publish_state(soh);
# ESP_LOGI("canid 0x150:", "U : %.1f V, I %.1f A, SoC: %d %, SoH %d %", voltage, current, soc, soh );
- can_id: 0x151 #Pack 2
then:
- lambda: |-
float voltage = ((x[1] << 8) | x[0]) / 10.0;
id(pack_2_voltage).publish_state(voltage);
float current = ((x[3] << 8) | x[2]) / 10.0;
if(x[3] > 0x80) current = uint16_t(~((x[3] << 8) | x[2]) + 1) / -10.0;
id(pack_2_current).publish_state(current);
int soc = ((x[5] << 8) | x[4]) / 10.0;
id(pack_2_soc).publish_state(soc);
int soh = ((x[7] << 8) | x[6]) / 10.0;
id(pack_2_soh).publish_state(soh);
# ESP_LOGI("canid 0x151:", "U : %.1f V, I %.1f A, SoC: %d %, SoH %d %", voltage, current, soc, soh );
- can_id: 0x152 #Pack 3
then:
- lambda: |-
float voltage = ((x[1] << 8) | x[0]) / 10.0;
id(pack_3_voltage).publish_state(voltage);
float current = ((x[3] << 8) | x[2]) / 10.0;
if(x[3] > 0x80) current = uint16_t(~((x[3] << 8) | x[2]) + 1) / -10.0;
id(pack_3_current).publish_state(current);
int soc = ((x[5] << 8) | x[4]) / 10.0;
id(pack_3_soc).publish_state(soc);
int soh = ((x[7] << 8) | x[6]) / 10.0;
id(pack_3_soh).publish_state(soh);
# ESP_LOGI("canid 0x152:", "U : %.1f V, I %.1f A, SoC: %d %, SoH %d %", voltage, current, soc, soh );
- can_id: 0x200 #Pack 1
then:
- lambda: |-
float cell_u_max = ((x[1] << 8) | x[0]) / 1000.0;
id(pack_1_max_cell_voltage).publish_state(cell_u_max);
float cell_u_min = ((x[3] << 8) | x[2]) / 1000.0;
id(pack_1_min_cell_voltage).publish_state(cell_u_min);
float temp_max = ((x[5] << 8) | x[4]) / 10.0;
id(pack_1_temp_max).publish_state(temp_max);
float temp_min = ((x[7] << 8) | x[6]) / 10.0;
id(pack_1_temp_min).publish_state(temp_min);
# ESP_LOGI("canid 0x200:", "U cell max: %.3f V, U cell min %.3f V, Temp max: %.1f, T_min %.1f V", cell_u_max, cell_u_min, temp_max, temp_min );
- can_id: 0x201 #Pack 2
then:
- lambda: |-
float cell_u_max = ((x[1] << 8) | x[0]) / 1000.0;
id(pack_2_max_cell_voltage).publish_state(cell_u_max);
float cell_u_min = ((x[3] << 8) | x[2]) / 1000.0;
id(pack_2_min_cell_voltage).publish_state(cell_u_min);
float temp_max = ((x[5] << 8) | x[4]) / 10.0;
id(pack_2_temp_max).publish_state(temp_max);
float temp_min = ((x[7] << 8) | x[6]) / 10.0;
id(pack_2_temp_min).publish_state(temp_min);
- can_id: 0x202 #Pack 3
then:
- lambda: |-
float cell_u_max = ((x[1] << 8) | x[0]) / 1000.0;
id(pack_3_max_cell_voltage).publish_state(cell_u_max);
float cell_u_min = ((x[3] << 8) | x[2]) / 1000.0;
id(pack_3_min_cell_voltage).publish_state(cell_u_min);
float temp_max = ((x[5] << 8) | x[4]) / 10.0;
id(pack_3_temp_max).publish_state(temp_max);
float temp_min = ((x[7] << 8) | x[6]) / 10.0;
id(pack_3_temp_min).publish_state(temp_min);
- can_id: 0x250 #Pack 1
then:
- lambda: |-
float mosmax = ((x[1] << 8) | x[0]) / 10.0;
if(x[1] > 0x80) mosmax = uint16_t(~((x[1] << 8) | x[0]) + 1) / -10.0;
id(pack_1_mosmax).publish_state(mosmax);
float heatmem = (x[3] << 8) | x[2];
if(x[3] > 0x80) heatmem = uint16_t(~((x[3] << 8) | x[2]) + 1) / -10.0;
id(pack_1_heatmem).publish_state(heatmem);
int val3 = (x[5] << 8) | x[4];
int val4 = (x[7] << 8) | x[6];
ESP_LOGI("canid 0x250:", "%.1f, %.1f, %d, %d", mosmax, heatmem, val3, val4 );
- can_id: 0x251 #Pack 2
then:
- lambda: |-
float mosmax = ((x[1] << 8) | x[0]) / 10.0;
if(x[1] > 0x80) mosmax = uint16_t(~((x[1] << 8) | x[0]) + 1) / -10.0;
id(pack_2_mosmax).publish_state(mosmax);
float heatmem = (x[3] << 8) | x[2];
if(x[3] > 0x80) heatmem = uint16_t(~((x[3] << 8) | x[2]) + 1) / -10.0;
id(pack_2_heatmem).publish_state(heatmem);
# ??? int val3 = (x[5] << 8) | x[4];
# ??? int val4 = (x[7] << 8) | x[6];
# ESP_LOGI("canid 0x250:", "%.1f, %.1f, %d, %d", mosmax, heatmem, val3, val4 );
- can_id: 0x252 #Pack 3
then:
- lambda: |-
float mosmax = ((x[1] << 8) | x[0]) / 10.0;
if(x[1] > 0x80) mosmax = uint16_t(~((x[1] << 8) | x[0]) + 1) / -10.0;
id(pack_3_mosmax).publish_state(mosmax);
float heatmem = (x[3] << 8) | x[2];
if(x[3] > 0x80) heatmem = uint16_t(~((x[3] << 8) | x[2]) + 1) / -10.0;
id(pack_3_heatmem).publish_state(heatmem);
# ??? int val3 = (x[5] << 8) | x[4];
# ??? int val4 = (x[7] << 8) | x[6];
# ESP_LOGI("canid 0x250:", "%.1f, %.1f, %d, %d", mosmax, heatmem, val3, val4 );
- can_id: 0x400 #Pack 1
then:
- lambda: |-
float cycles = ((x[3] << 8) | x[2]);
id(pack_1_cycles).publish_state(cycles);
- can_id: 0x401 #Pack 2
then:
- lambda: |-
float cycles = ((x[3] << 8) | x[2]);
id(pack_2_cycles).publish_state(cycles);
- can_id: 0x402 #Pack 3
then:
- lambda: |-
float cycles = ((x[3] << 8) | x[2]);
id(pack_3_cycles).publish_state(cycles);
- can_id: 0x550 #Pack 1
then:
- lambda: |-
ESP_LOGI("canid 0x550:", "%02x %02x %02x %02x %02x %02x %02x %02x", x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]);
float charged = ((x[3] << 24) | (x[2] << 16) | (x[1] << 8) | x[0]) / 1000.0;
id(pack_1_charged).publish_state(charged);
float discharged = ((x[7] << 24) | (x[6] << 16) | (x[5] << 8) | x[5]) / 1000.0;
id(pack_1_discharged).publish_state(discharged);
# ESP_LOGI("canid 0x550:", "%.3f kWh, %.3f kWh", charged, discharged );
- can_id: 0x551 #Pack 2
then:
- lambda: |-
ESP_LOGI("canid 0x551:", "%02x %02x %02x %02x %02x %02x %02x %02x", x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]);
float charged = ((x[3] << 24) | (x[2] << 16) | (x[1] << 8) | x[0]) / 1000.0;
id(pack_2_charged).publish_state(charged);
float discharged = ((x[7] << 24) | (x[6] << 16) | (x[5] << 8) | x[5]) / 1000.0;
id(pack_2_discharged).publish_state(discharged);
# ESP_LOGI("canid 0x551:", "%.3f kWh, %.3f kWh", charged, discharged );
- can_id: 0x552 #Pack 3
then:
- lambda: |-
ESP_LOGI("canid 0x551:", "%02x %02x %02x %02x %02x %02x %02x %02x", x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]);
float charged = ((x[3] << 24) | (x[2] << 16) | (x[1] << 8) | x[0]) / 1000.0;
id(pack_3_charged).publish_state(charged);
float discharged = ((x[7] << 24) | (x[6] << 16) | (x[5] << 8) | x[5]) / 1000.0;
id(pack_3_discharged).publish_state(discharged);
# ESP_LOGI("canid 0x551:", "%.3f kWh, %.3f kWh", charged, discharged );
# not decoded stuff:
# - can_id: 0x359 #Pack 1
# then:
# - lambda: |-
# ESP_LOGI("canid 0x359:", "%02x %02x %02x %02x %02x %02x %02x %02x", x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]);
# - can_id: 0x35C #Pack 1
# then:
# - lambda: |-
# ESP_LOGI("canid 0x35C:", "%02x %02x %02x %02x %02x %02x %02x %02x", x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]);
# 363, byte 0 + 1 = Battery Firmware Vrsion
# - can_id: 0x363
# then:
# - lambda: |-
# ESP_LOGI("canid 0x363:", "%02x %02x %02x %02x %02x %02x %02x %02x", x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]);
# int val1 = (x[1] << 8) | x[0];
# int val2 = (x[3] << 8) | x[2];
# int val3 = (x[5] << 8) | x[4];
# int val4 = (x[7] << 8) | x[6];
# ESP_LOGI("canid 0x363:", "%d, %d, %d, %d", val1, val2, val3, val4 );
# 363: 03 03 00 00 03 00 00 00 3 battery packs
# 363: 03 01 00 00 03 00 00 00 3 battery packs
# 363: 02 01 00 00 02 00 00 00 2 battery packs
# 363: 02 00 00 00 02 00 00 00 2 battery packs
# 363: 02 02 00 00 02 00 00 00 2 battery packs fully charged 100% soc 55,40v 3,5-3,3v
# 363: 01 00 00 00 01 00 00 00 1 battery pack, ~ 30% SoC not charging, but also charging, also dischaging
# - can_id: 0x364
# then:
# - lambda: |-
# ESP_LOGI("canid 0x364:", "%02x %02x %02x %02x %02x %02x %02x %02x", x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]);
# int val1 = (x[1] << 8) | x[0];
# int val2 = (x[3] << 8) | x[2];
# int val3 = (x[5] << 8) | x[4];
# int val4 = (x[7] << 8) | x[6];
# ESP_LOGI("canid 0x364:", "%d, %d, %d, %d", val1, val2, val3, val4 );
# ESP_LOGD("canid 0x355", "%s", &b[0] );
# - canbus.send:
# canbus_id: 100
# can_id: 0x401
# data: !lambda
# return {0x401, x};
# 0x110 00 00 00 00 00 00 00 31 or 00 00 00 00 00 00 00 21, 31= charging and discarging allowed, 21= discharging allowed
# 0x500 30 06 AA 56 37 2E 30 38: FW: 3006, HW: AA56, ??: 7.08 (ASCII)
# 0x600+0x650 Serial number part 1+2 in ASCII
# 0x700 Status bits
# 0x35e 44 59 30 30 31 05 60 09 -> Protocol name in ASCII, tranlsates to "DEYE" in Deye inverters
sensor:
- platform: template
name: "Battery voltage"
id: "battery_voltage"
unit_of_measurement: 'V'
device_class: 'voltage'
state_class: 'measurement'
accuracy_decimals: 2
- platform: template
name: "Battery current"
id: "battery_current"
unit_of_measurement: 'A'
device_class: 'current'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Battery temperature"
id: "battery_temperature"
unit_of_measurement: '°C'
device_class: 'temperature'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Battery charge voltage"
id: "battery_charge_voltage"
unit_of_measurement: 'V'
device_class: 'voltage'
state_class: 'measurement'
accuracy_decimals: 2
- platform: template
name: "Battery discharge voltage"
id: "battery_discharge_voltage"
unit_of_measurement: 'V'
device_class: 'voltage'
state_class: 'measurement'
accuracy_decimals: 2
- platform: template
name: "Battery charge current limit"
id: "battery_charge_current_limit"
unit_of_measurement: 'A'
device_class: 'current'
state_class: 'measurement'
accuracy_decimals: 0
- platform: template
name: "Battery discharge current limit"
id: "battery_discharge_current_limit"
unit_of_measurement: 'A'
device_class: 'current'
state_class: 'measurement'
accuracy_decimals: 0
- platform: template
name: "Battery SoC"
id: "battery_soc"
unit_of_measurement: '%'
device_class: 'battery'
state_class: 'measurement'
accuracy_decimals: 0
- platform: template
name: "Battery SoH"
id: "battery_soh"
unit_of_measurement: '%'
device_class: 'battery'
state_class: 'measurement'
accuracy_decimals: 0
#Deye battery specific
- platform: template
name: "Battery max cell voltage Deye"
id: "battery_max_cell_voltage_deye"
unit_of_measurement: 'V'
device_class: 'voltage'
state_class: 'measurement'
accuracy_decimals: 3
- platform: template
name: "Battery min cell voltage Deye"
id: "battery_min_cell_voltage_deye"
unit_of_measurement: 'V'
device_class: 'voltage'
state_class: 'measurement'
accuracy_decimals: 3
- platform: template
name: "Battery temp max Deye"
id: "battery_temp_max_deye"
unit_of_measurement: '°C'
device_class: 'temperature'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Battery temp min Deye"
id: "battery_temp_min_deye"
unit_of_measurement: '°C'
device_class: 'temperature'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Battery charge current limit Deye"
id: "battery_charge_current_limit_deye"
unit_of_measurement: 'A'
device_class: 'current'
state_class: 'measurement'
accuracy_decimals: 0
- platform: template
name: "Battery discharge current limit Deye"
id: "battery_discharge_current_limit_deye"
unit_of_measurement: 'A'
device_class: 'current'
state_class: 'measurement'
accuracy_decimals: 0
#Pack 1
- platform: template
name: "Pack 1 voltage"
id: "pack_1_voltage"
unit_of_measurement: 'V'
device_class: 'voltage'
state_class: 'measurement'
accuracy_decimals: 2
- platform: template
name: "Pack 1 current"
id: "pack_1_current"
unit_of_measurement: 'A'
device_class: 'current'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Pack 1 SoC"
id: "pack_1_soc"
unit_of_measurement: '%'
device_class: 'battery'
state_class: 'measurement'
accuracy_decimals: 0
- platform: template
name: "Pack 1 SoH"
id: "pack_1_soh"
unit_of_measurement: '%'
device_class: 'battery'
state_class: 'measurement'
accuracy_decimals: 0
- platform: template
name: "Pack 1 max cell voltage"
id: "pack_1_max_cell_voltage"
unit_of_measurement: 'V'
device_class: 'voltage'
state_class: 'measurement'
accuracy_decimals: 3
- platform: template
name: "Pack 1 min cell voltage"
id: "pack_1_min_cell_voltage"
unit_of_measurement: 'V'
device_class: 'voltage'
state_class: 'measurement'
accuracy_decimals: 3
on_value:
then:
- component.update: pack_1_imbalance
- platform: template
name: "Pack 1 imbalance"
id: "pack_1_imbalance"
unit_of_measurement: 'mV'
device_class: 'voltage'
state_class: 'measurement'
accuracy_decimals: 0
lambda: |-
return ((id(pack_1_max_cell_voltage).state - id(pack_1_min_cell_voltage).state)) * 1000;
- platform: template
name: "Pack 1 temp max"
id: "pack_1_temp_max"
unit_of_measurement: '°C'
device_class: 'temperature'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Pack 1 temp min"
id: "pack_1_temp_min"
unit_of_measurement: '°C'
device_class: 'temperature'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Pack 1 MosMax"
id: "pack_1_mosmax"
unit_of_measurement: '°C'
device_class: 'temperature'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Pack 1 HeatMem"
id: "pack_1_heatmem"
unit_of_measurement: '°C'
device_class: 'temperature'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Pack 1 cycles"
id: "pack_1_cycles"
state_class: 'measurement'
accuracy_decimals: 0
- platform: template
name: "Pack 1 charged"
id: "pack_1_charged"
unit_of_measurement: 'kWh'
device_class: 'energy'
state_class: 'measurement'
accuracy_decimals: 3
- platform: template
name: "Pack 1 discharged"
id: "pack_1_discharged"
unit_of_measurement: 'kWh'
device_class: 'energy'
state_class: 'measurement'
accuracy_decimals: 3
#Pack 2
- platform: template
name: "Pack 2 voltage"
id: "pack_2_voltage"
unit_of_measurement: 'V'
device_class: 'voltage'
state_class: 'measurement'
accuracy_decimals: 2
- platform: template
name: "Pack 2 current"
id: "pack_2_current"
unit_of_measurement: 'A'
device_class: 'current'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Pack 2 SoC"
id: "pack_2_soc"
unit_of_measurement: '%'
device_class: 'battery'
state_class: 'measurement'
accuracy_decimals: 0
- platform: template
name: "Pack 2 SoH"
id: "pack_2_soh"
unit_of_measurement: '%'
device_class: 'battery'
state_class: 'measurement'
accuracy_decimals: 0
- platform: template
name: "Pack 2 max cell voltage"
id: "pack_2_max_cell_voltage"
unit_of_measurement: 'V'
device_class: 'voltage'
state_class: 'measurement'
accuracy_decimals: 3
- platform: template
name: "Pack 2 min cell voltage"
id: "pack_2_min_cell_voltage"
unit_of_measurement: 'V'
device_class: 'voltage'
state_class: 'measurement'
accuracy_decimals: 3
on_value:
then:
- component.update: pack_2_imbalance
- platform: template
name: "Pack 2 imbalance"
id: "pack_2_imbalance"
unit_of_measurement: 'mV'
device_class: 'voltage'
state_class: 'measurement'
accuracy_decimals: 0
lambda: |-
return ((id(pack_2_max_cell_voltage).state - id(pack_2_min_cell_voltage).state)) * 1000;
- platform: template
name: "Pack 2 temp max"
id: "pack_2_temp_max"
unit_of_measurement: '°C'
device_class: 'temperature'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Pack 2 temp min"
id: "pack_2_temp_min"
unit_of_measurement: '°C'
device_class: 'temperature'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Pack 2 MosMax"
id: "pack_2_mosmax"
unit_of_measurement: '°C'
device_class: 'temperature'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Pack 2 HeatMem"
id: "pack_2_heatmem"
unit_of_measurement: '°C'
device_class: 'temperature'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Pack 2 cycles"
id: "pack_2_cycles"
state_class: 'measurement'
accuracy_decimals: 0
- platform: template
name: "Pack 2 charged"
id: "pack_2_charged"
unit_of_measurement: 'kWh'
device_class: 'energy'
state_class: 'measurement'
accuracy_decimals: 3
- platform: template
name: "Pack 2 discharged"
id: "pack_2_discharged"
unit_of_measurement: 'kWh'
device_class: 'energy'
state_class: 'measurement'
accuracy_decimals: 3
#Pack 3
- platform: template
name: "Pack 3 voltage"
id: "pack_3_voltage"
unit_of_measurement: 'V'
device_class: 'voltage'
state_class: 'measurement'
accuracy_decimals: 2
- platform: template
name: "Pack 3 current"
id: "pack_3_current"
unit_of_measurement: 'A'
device_class: 'current'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Pack 3 SoC"
id: "pack_3_soc"
unit_of_measurement: '%'
device_class: 'battery'
state_class: 'measurement'
accuracy_decimals: 0
- platform: template
name: "Pack 3 SoH"
id: "pack_3_soh"
unit_of_measurement: '%'
device_class: 'battery'
state_class: 'measurement'
accuracy_decimals: 0
- platform: template
name: "Pack 3 max cell voltage"
id: "pack_3_max_cell_voltage"
unit_of_measurement: 'V'
device_class: 'voltage'
state_class: 'measurement'
accuracy_decimals: 3
- platform: template
name: "Pack 3 min cell voltage"
id: "pack_3_min_cell_voltage"
unit_of_measurement: 'V'
device_class: 'voltage'
state_class: 'measurement'
accuracy_decimals: 3
on_value:
then:
- component.update: pack_3_imbalance
- platform: template
name: "Pack 3 imbalance"
id: "pack_3_imbalance"
unit_of_measurement: 'mV'
device_class: 'voltage'
state_class: 'measurement'
accuracy_decimals: 0
lambda: |-
return ((id(pack_3_max_cell_voltage).state - id(pack_3_min_cell_voltage).state)) * 1000;
- platform: template
name: "Pack 3 temp max"
id: "pack_3_temp_max"
unit_of_measurement: '°C'
device_class: 'temperature'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Pack 3 MosMax"
id: "pack_3_mosmax"
unit_of_measurement: '°C'
device_class: 'temperature'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Pack 3 HeatMem"
id: "pack_3_heatmem"
unit_of_measurement: '°C'
device_class: 'temperature'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Pack 3 temp min"
id: "pack_3_temp_min"
unit_of_measurement: '°C'
device_class: 'temperature'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Pack 3 cycles"
id: "pack_3_cycles"
state_class: 'measurement'
accuracy_decimals: 0
- platform: template
name: "Pack 3 charged"
id: "pack_3_charged"
unit_of_measurement: 'kWh'
device_class: 'energy'
state_class: 'measurement'
accuracy_decimals: 3
- platform: template
name: "Pack 3 discharged"
id: "pack_3_discharged"
unit_of_measurement: 'kWh'
device_class: 'energy'
state_class: 'measurement'
accuracy_decimals: 3