-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
esp8266-seplos-v3-example.yaml
597 lines (548 loc) · 16.2 KB
/
esp8266-seplos-v3-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
substitutions:
name: seplos-bms
device_description: "Monitor and control a Seplos V3 BMS via RS485 (Modbus)"
tx_pin: GPIO4
rx_pin: GPIO5
esphome:
name: ${name}
comment: ${device_description}
min_version: 2024.6.0
project:
name: "syssi.esphome-seplos-bms"
version: 1.2.0
esp8266:
board: d1_mini
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ota:
platform: esphome
logger:
level: DEBUG
# If you use Home Assistant please remove this `mqtt` section and uncomment the `api` component!
# The native API has many advantages over MQTT: https://esphome.io/components/api.html#advantages-over-mqtt
mqtt:
broker: !secret mqtt_host
username: !secret mqtt_username
password: !secret mqtt_password
id: mqtt_client
# api:
uart:
- id: uart_0
baud_rate: 19200
tx_pin: ${tx_pin}
rx_pin: ${rx_pin}
debug:
direction: BOTH
dummy_receiver: false
modbus:
- id: modbus0
uart_id: uart_0
send_wait_time: 200ms
modbus_controller:
- id: bms0
address: 0x00
modbus_id: modbus0
command_throttle: 200ms
update_interval: 10s
sensor:
# 1000 Pack Voltage R UINT16 2 10mV
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} total voltage"
address: 0x1000
register_type: read
value_type: U_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 2
filters:
- multiply: 0.01
# 1001 Current R INT16 2 10mA
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} current"
address: 0x1001
register_type: read
value_type: S_WORD
unit_of_measurement: "A"
device_class: current
state_class: measurement
accuracy_decimals: 2
filters:
- multiply: 0.01
# 1002 Remaining capacity R UINT16 2 10mAH
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} remaining capacity"
address: 0x1002
register_type: read
value_type: U_WORD
unit_of_measurement: "Ah"
state_class: measurement
accuracy_decimals: 2
filters:
- multiply: 0.01
# 1003 Total Capacity R UINT16 2 10mAH
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} total capacity"
address: 0x1003
register_type: read
value_type: U_WORD
unit_of_measurement: "Ah"
state_class: measurement
accuracy_decimals: 2
filters:
- multiply: 0.01
# 1004 Total Discharge Capacity R UINT16 2 10AH
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} total discharge capacity"
address: 0x1004
register_type: read
value_type: U_WORD
unit_of_measurement: "Ah"
state_class: measurement
accuracy_decimals: 2
filters:
- multiply: 0.01
# 1005 SOC R UINT16 2 0.1%
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} state of charge"
address: 0x1005
register_type: read
value_type: U_WORD
unit_of_measurement: "%"
device_class: battery
state_class: measurement
accuracy_decimals: 0
filters:
- multiply: 0.1
# 1006 SOH R UINT16 2 0.1%
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} state of health"
address: 0x1006
register_type: read
value_type: U_WORD
unit_of_measurement: "%"
state_class: measurement
accuracy_decimals: 0
# 1007 Cycle R UINT16 2 1
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} cycle"
address: 0x1007
register_type: read
value_type: U_WORD
unit_of_measurement: ""
state_class: measurement
accuracy_decimals: 0
# 1008 Averag of Cell Votage R UINT16 2 1mV
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} average cell voltage"
address: 0x1008
register_type: read
value_type: U_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 3
filters:
- multiply: 0.001
# 1009 Averag of Cell Temperature R UINT16 2 0.1K
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} average cell temperature"
address: 0x1009
register_type: read
value_type: S_WORD
unit_of_measurement: "°C"
device_class: temperature
state_class: measurement
accuracy_decimals: 1
filters:
- offset: -2731.5
- multiply: 0.1
# 100A Max Cell Voltage R UINT16 2 1mV
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} max cell voltage"
address: 0x100A
register_type: read
value_type: U_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 3
filters:
- multiply: 0.001
# 100B Min Cell Voltage R UINT16 2 1mV
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} min cell voltage"
address: 0x100B
register_type: read
value_type: U_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 3
filters:
- multiply: 0.001
# 100C Max Cell Temperature R UINT16 2 0.1K
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} max cell temperature"
address: 0x100C
register_type: read
value_type: S_WORD
unit_of_measurement: "°C"
device_class: temperature
state_class: measurement
accuracy_decimals: 1
filters:
- offset: -2731.5
- multiply: 0.1
# 100D Min Cell Temperature R UINT16 2 0.1K
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} min cell temperature"
address: 0x100D
register_type: read
value_type: S_WORD
unit_of_measurement: "°C"
device_class: temperature
state_class: measurement
accuracy_decimals: 1
filters:
- offset: -2731.5
- multiply: 0.1
# 100F MaxDisCurt R UINT16 2 1A
# Max Discharging Current
# 1010 MaxChgCurt R UINT16 2 1A
# Max Charging Current
# 1100 Cell1 Voltage R UINT16 2 1mV
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} cell voltage 1"
address: 0x1100
register_type: read
value_type: U_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 3
filters:
- multiply: 0.001
# 1101 Cell2 Voltage R UINT16 2 1mV
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} cell voltage 2"
address: 0x1101
register_type: read
value_type: U_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 3
filters:
- multiply: 0.001
# 1102 Cell3 Voltage R UINT16 2 1mV
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} cell voltage 3"
address: 0x1102
register_type: read
value_type: U_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 3
filters:
- multiply: 0.001
# 1103 Cell4 Voltage R UINT16 2 1mV
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} cell voltage 4"
address: 0x1103
register_type: read
value_type: U_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 3
filters:
- multiply: 0.001
# 1104 Cell5 Voltage R UINT16 2 1mV
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} cell voltage 5"
address: 0x1104
register_type: read
value_type: U_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 3
filters:
- multiply: 0.001
# 1105 Cell6 Voltage R UINT16 2 1mV
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} cell voltage 6"
address: 0x1105
register_type: read
value_type: U_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 3
filters:
- multiply: 0.001
# 1106 Cell7 Voltage R UINT16 2 1mV
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} cell voltage 7"
address: 0x1106
register_type: read
value_type: U_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 3
filters:
- multiply: 0.001
# 1107 Cell8 Voltage R UINT16 2 1mV
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} cell voltage 8"
address: 0x1107
register_type: read
value_type: U_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 3
filters:
- multiply: 0.001
# 1108 Cell9 Voltage R UINT16 2 1mV
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} cell voltage 9"
address: 0x1108
register_type: read
value_type: U_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 3
filters:
- multiply: 0.001
# 1109 Cell10 Voltage R UINT16 2 1mV
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} cell voltage 10"
address: 0x1109
register_type: read
value_type: U_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 3
filters:
- multiply: 0.001
# 110A Cell11 Voltage R UINT16 2 1mV
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} cell voltage 11"
address: 0x110A
register_type: read
value_type: U_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 3
filters:
- multiply: 0.001
# 110B Cell12 Voltage R UINT16 2 1mV
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} cell voltage 12"
address: 0x110B
register_type: read
value_type: U_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 3
filters:
- multiply: 0.001
# 110C Cell13 Voltage R UINT16 2 1mV
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} cell voltage 13"
address: 0x110C
register_type: read
value_type: U_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 3
filters:
- multiply: 0.001
# 110D Cell14 Voltage R UINT16 2 1mV
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} cell voltage 14"
address: 0x110D
register_type: read
value_type: U_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 3
filters:
- multiply: 0.001
# 110E Cell15 Voltage R UINT16 2 1mV
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} cell voltage 15"
address: 0x110E
register_type: read
value_type: U_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 3
filters:
- multiply: 0.001
# 110F Cell16 Voltage R UINT16 2 1mV
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} cell voltage 16"
address: 0x110F
register_type: read
value_type: U_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 3
filters:
- multiply: 0.001
# 1110 Cell temperature 1 R UINT16 2 0.1K
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} cell temperature 1"
address: 0x1110
register_type: read
value_type: S_WORD
unit_of_measurement: "°C"
device_class: temperature
state_class: measurement
accuracy_decimals: 1
filters:
- offset: -2731.5
- multiply: 0.1
# 1111 Cell temperature 2 R UINT16 2 0.1K
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} cell temperature 2"
address: 0x1111
register_type: read
value_type: S_WORD
unit_of_measurement: "°C"
device_class: temperature
state_class: measurement
accuracy_decimals: 1
filters:
- offset: -2731.5
- multiply: 0.1
# 1112 Cell temperature 3 R UINT16 2 0.1K
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} cell temperature 3"
address: 0x1112
register_type: read
value_type: S_WORD
unit_of_measurement: "°C"
device_class: temperature
state_class: measurement
accuracy_decimals: 1
filters:
- offset: -2731.5
- multiply: 0.1
# 1113 Cell temperature 4 R UINT16 2 0.1K
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} cell temperature 4"
address: 0x1113
register_type: read
value_type: S_WORD
unit_of_measurement: "°C"
device_class: temperature
state_class: measurement
accuracy_decimals: 1
filters:
- offset: -2731.5
- multiply: 0.1
# 1118 Environment Temperature R UINT16 2 0.1K
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} environment temperature"
address: 0x1118
register_type: read
value_type: S_WORD
unit_of_measurement: "°C"
device_class: temperature
state_class: measurement
accuracy_decimals: 1
filters:
- offset: -2731.5
- multiply: 0.1
# 1119 Power temperature R UINT16 2 0.1K
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} mosfet temperature"
address: 0x1119
register_type: read
value_type: S_WORD
unit_of_measurement: "°C"
device_class: temperature
state_class: measurement
accuracy_decimals: 1
filters:
- offset: -2731.5
- multiply: 0.1
# Pack Info C
#
# 1200 Cells voltage 08-01low alarm state R HEX 1 1:alarm
# 1208 Cells voltage 16-09low alarm state R HEX 1 1:alarm
# 1210 Cells voltage 08-01high alarm state R HEX 1 1:alarm
# 1218 Cells voltage 16-09high alarm state R HEX 1 1:alarm
# 1220 Cell 08-01 temperature Tlow alarm state R HEX 1 1:alarm
# 1228 Cell 08-01 temperature high alarm state R HEX 1 1:alarm
# 1230 Cell 08-01 equalization event code R HEX 1 1:on 0:off
# 1238 Cell 16-09 equalization event code R HEX 1 1:on 0:off
# 1240 System state code R HEX 1 See TB09
# 1248 Voltage event code R HEX 1 See TB02
# 1250 Cells Temperature event code R HEX 1 See TB03
# 1258 Environment and power Temperature event code R HEX 1 See TB04
# 1260 Current event code1 R HEX 1 See TB05
# 1268 Current event code2 R HEX 1 See TB16
# 1270 The residual capacity code R HEX 1 See TB06
# System Parameter reg. 1300...1367
# System Function reg. 1400...1448
# System Control reg. 1500...1519
# History Info reg. 1600...1627
# Version Info reg. 1700...1724
# PCS Control reg. 1800...1823
# EMS Info A reg. 2000...2019
# EMS Info B reg. 2100...2115
# EMS Info C reg. 2200...2248
#
# See docs/XZH BMS Modbus-RTU Protocol.pdf