-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathesp32-s2-0x25-full.yaml
472 lines (405 loc) · 14.1 KB
/
esp32-s2-0x25-full.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
substitutions:
name: "esp32-s2-0x25-full"
friendly_name: "esp32-s2-0x25-full"
esphome:
name: ${name}
friendly_name: ${friendly_name}
min_version: 2024.6.0
name_add_mac_suffix: false
platformio_options:
board_build.flash_mode: dio
project:
name: esphome.web
version: dev
esp32:
board: esp32-s2-saola-1
framework:
type: arduino
# Enable logging
logger:
# needed for C3, S2 and S3 (and possibly others) to read logs via USB, depending on framework used
hardware_uart: USB_CDC
# use INFO for production, VERY_VERBOSE for debugging or filing an issue report
level: INFO
#level: DEBUG
#level: VERBOSE
#level: VERY_VERBOSE
# Enable Home Assistant API
api:
encryption:
key: !secret api_encryption_key
# disable reboot if unable to connect API
reboot_timeout: 0min
# Allow Over-The-Air updates
ota:
platform: esphome
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# In conjunction with captive_portal, this spawns an AP with the device name and mac address if unable to connect
ap:
password: !secret fallback_hotspot_password
# how long to try connecting to WiFi before spawning the backup AP
ap_timeout: 5min
# disable reboot if unable to connect to WiFi
reboot_timeout: 0min
# In combination with the wifi fallback AP this allows the user
# to provision wifi credentials to the device via WiFi AP.
captive_portal:
# allows access to all BMS sensors and configuration
web_server:
version: 3
# this would just be annoying every time, so disable ota from here instead
#auth:
# username: !secret web_server_username
# password: !secret web_server_password
# disable firmware upload via the web server which is currently un-authenticated
ota: false
# don't reference external resources hosted on the net so that device webserver dashboard will continue working if internet is down
local: true
# import the pace_bms component
external_components:
- source:
type: git
url: https://github.com/nkinnan/esphome-pace-bms
ref: "main"
components: [ pace_bms ]
refresh: 1s
# this can be removed once the PR goes through: https://github.com/esphome/esphome/pull/7425
- source:
type: git
url: https://github.com/nkinnan/esphome
ref: "make_time_dependency_optional"
components: [ datetime ]
refresh: 1s
uart:
id: uart_0
baud_rate: 9600
tx_pin: GPIO17
rx_pin: GPIO16
rx_buffer_size: 256
pace_bms:
id: pace_bms_at_address_1
address: 1
uart_id: uart_0
# needed for RS485
#flow_control_pin: GPIO5
update_interval: 5s
request_throttle: 50ms
response_timeout: 1000ms
protocol_commandset: 0x25 # example only
# protocol_variant: "EG4" # example only
# protocol_version: 0x20 # example only
# battery_chemistry: 0x4A # example only
sensor:
- platform: pace_bms
pace_bms_id: pace_bms_at_address_1
cell_count:
name: "Cell Count"
cell_voltage_01:
name: "Cell Voltage 01"
cell_voltage_02:
name: "Cell Voltage 02"
cell_voltage_03:
name: "Cell Voltage 03"
cell_voltage_04:
name: "Cell Voltage 04"
cell_voltage_05:
name: "Cell Voltage 05"
cell_voltage_06:
name: "Cell Voltage 06"
cell_voltage_07:
name: "Cell Voltage 07"
cell_voltage_08:
name: "Cell Voltage 08"
cell_voltage_09:
name: "Cell Voltage 09"
cell_voltage_10:
name: "Cell Voltage 10"
cell_voltage_11:
name: "Cell Voltage 11"
cell_voltage_12:
name: "Cell Voltage 12"
cell_voltage_13:
name: "Cell Voltage 13"
cell_voltage_14:
name: "Cell Voltage 14"
cell_voltage_15:
name: "Cell Voltage 15"
cell_voltage_16:
name: "Cell Voltage 16"
temperature_count:
name: "Temperature Count"
# Generally the first four temperatures are cell measurements and the last two are
# MOSFET / Environment or Environment / MOSFET with the order of those two depending on manufacturer
temperature_01:
name: "Cell Temperature 1"
temperature_02:
name: "Cell Temperature 2"
temperature_03:
name: "Cell Temperature 3"
temperature_04:
name: "Cell Temperature 4"
temperature_05:
name: "MOSFET Temperature"
temperature_06:
name: "Environment Temperature"
total_voltage:
name: "Total Voltage"
current:
name: "Current"
power:
name: "Power"
remaining_capacity:
name: "Remaining Capacity"
full_capacity:
name: "Full Capacity"
design_capacity: # not available on EG4 protocol 0x20 variant
name: "Design Capacity"
state_of_charge:
name: "State of Charge"
state_of_health:
name: "State of Health"
cycle_count:
name: "Cycle Count"
min_cell_voltage:
name: "Min Cell Voltage"
max_cell_voltage:
name: "Max Cell Voltage"
avg_cell_voltage:
name: "Avg Cell Voltage"
max_cell_differential:
name: "Max Cell Differential"
# # specific raw status values that you probably don't need, but the values / bit flags are documented anyway
# # you can probably just use the 6 text sensor equivalents which encompass all of these values and are suitable for display
# warning_status_value_cell_01:
# name: "Warning Status Value Cell 01"
# warning_status_value_cell_02:
# name: "Warning Status Value Cell 02"
# warning_status_value_cell_03:
# name: "Warning Status Value Cell 03"
# warning_status_value_cell_04:
# name: "Warning Status Value Cell 04"
# warning_status_value_cell_05:
# name: "Warning Status Value Cell 05"
# warning_status_value_cell_06:
# name: "Warning Status Value Cell 06"
# warning_status_value_cell_07:
# name: "Warning Status Value Cell 07"
# warning_status_value_cell_08:
# name: "Warning Status Value Cell 08"
# warning_status_value_cell_09:
# name: "Warning Status Value Cell 09"
# warning_status_value_cell_10:
# name: "Warning Status Value Cell 10"
# warning_status_value_cell_11:
# name: "Warning Status Value Cell 11"
# warning_status_value_cell_12:
# name: "Warning Status Value Cell 12"
# warning_status_value_cell_13:
# name: "Warning Status Value Cell 13"
# warning_status_value_cell_14:
# name: "Warning Status Value Cell 14"
# warning_status_value_cell_15:
# name: "Warning Status Value Cell 15"
# warning_status_value_cell_16:
# name: "Warning Status Value Cell 16"
# warning_status_value_temperature_01:
# name: "Warning Status Value Temperature 01"
# warning_status_value_temperature_02:
# name: "Warning Status Value Temperature 02"
# warning_status_value_temperature_03:
# name: "Warning Status Value Temperature 03"
# warning_status_value_temperature_04:
# name: "Warning Status Value Temperature 04"
# warning_status_value_temperature_05:
# name: "Warning Status Value Temperature 05"
# warning_status_value_temperature_06:
# name: "Warning Status Value Temperature 06"
# warning_status_value_charge_current:
# name: "Warning Status Value Charge Current"
# warning_status_value_total_voltage:
# name: "Warning Status Value Total Voltage"
# warning_status_value_discharge_current:
# name: "Warning Status Value Discharge Current"
# warning_status_value_1:
# name: "Warning Status Value 1"
# warning_status_value_2:
# name: "Warning Status Value 2"
# balancing_status_value:
# name: "Balancing Status Value"
# system_status_value:
# name: "System Status Value"
# configuration_status_value:
# name: "Configuration Status Value"
# protection_status_value_1:
# name: "Protection Status Value 1"
# protection_status_value_2:
# name: "Protection Status Value 2"
# fault_status_value:
# name: "Fault Status Value"
text_sensor:
- platform: pace_bms
pace_bms_id: pace_bms_at_address_1
hardware_version:
name: "Hardware Version"
serial_number: # not available on EG4 protocol 0x20 variant
name: "Serial Number"
# pre-decoded human readable text strings that describe all of the specific status values and are suitable for display
warning_status:
name: "Warning Status"
protection_status:
name: "Protection Status"
fault_status:
name: "Fault Status"
system_status:
name: "System Status"
configuration_status:
name: "Configuration Status"
balancing_status:
name: "Balancing Status"
datetime:
- platform: pace_bms
pace_bms_id: pace_bms_at_address_1
system_date_and_time:
name: "System Date and Time"
button:
- platform: pace_bms
pace_bms_id: pace_bms_at_address_1
shutdown:
name: "Shutdown" # will actually "reboot" if the battery is charging/discharging - it only stays shut down if idle
switch:
- platform: pace_bms
pace_bms_id: pace_bms_at_address_1
buzzer_alarm:
name: "Buzzer Alarm"
led_alarm:
name: "Led Alarm"
charge_current_limiter:
name: "Charge Current Limiter"
charge_mosfet:
name: "Charge Mosfet"
discharge_mosfet:
name: "Discharge Mosfet"
select:
- platform: pace_bms
pace_bms_id: pace_bms_at_address_1
charge_current_limiter_gear:
name: "Charge Current Limiter Gear"
# setting the protocol is possible on some version 25 BMSes but not all
protocol_can:
name: "Protocol (CAN)"
protocol_rs485:
name: "Protocol (RS485)"
protocol_type:
name: "Protocol (Type)"
number:
- platform: pace_bms
pace_bms_id: pace_bms_at_address_1
cell_over_voltage_alarm:
name: "Cell Over Voltage Alarm"
cell_over_voltage_protection:
name: "Cell Over Voltage Protection"
cell_over_voltage_protection_release:
name: "Cell Over Voltage Protection Release"
cell_over_voltage_protection_delay:
name: "Cell Over Voltage Protection Delay"
pack_over_voltage_alarm:
name: "Pack Over Voltage Alarm"
pack_over_voltage_protection:
name: "Pack Over Voltage Protection"
pack_over_voltage_protection_release:
name: "Pack Over Voltage Protection Release"
pack_over_voltage_protection_delay:
name: "Pack Over Voltage Protection Delay"
cell_under_voltage_alarm:
name: "Cell Under Voltage Alarm"
cell_under_voltage_protection:
name: "Cell Under Voltage Protection"
cell_under_voltage_protection_release:
name: "Cell Under Voltage Protection Release"
cell_under_voltage_protection_delay:
name: "Cell Under Voltage Protection Delay"
pack_under_voltage_alarm:
name: "Pack Under Voltage Alarm"
pack_under_voltage_protection:
name: "Pack Under Voltage Protection"
pack_under_voltage_protection_release:
name: "Pack Under Voltage Protection Release"
pack_under_voltage_protection_delay:
name: "Pack Under Voltage Protection Delay"
charge_over_current_alarm:
name: "Charge Over Current Alarm"
charge_over_current_protection:
name: "Charge Over Current Protection"
charge_over_current_protection_delay:
name: "Charge Over Current Protection Delay"
discharge_over_current1_alarm:
name: "Discharge Over Current 1 Alarm"
discharge_over_current1_protection:
name: "Discharge Over Current 1 Protection"
discharge_over_current1_protection_delay:
name: "Discharge Over Current 1 Protection Delay"
discharge_over_current2_protection:
name: "Discharge Over Current 2 Protection"
discharge_over_current2_protection_delay:
name: "Discharge Over Current 2 Protection Delay"
short_circuit_protection_delay:
name: "Short Circuit Protection Delay (Milliseconds)"
cell_balancing_threshold:
name: "Cell Balancing Threshold"
cell_balancing_delta:
name: "Cell Balancing Delta"
sleep_cell_voltage:
name: "Sleep Cell Voltage"
sleep_delay:
name: "Sleep Delay (Minutes)"
full_charge_voltage:
name: "Full Charge Voltage"
full_charge_amps:
name: "Full Charge Amps"
low_charge_alarm_percent:
name: "Low Charge Alarm Percent"
charge_over_temperature_alarm:
name: "Charge Over Temperature Alarm"
charge_over_temperature_protection:
name: "Charge Over Temperature Protection"
charge_over_temperature_protection_release:
name: "Charge Over Temperature Protection Release"
discharge_over_temperature_alarm:
name: "Discharge Over Temperature Alarm"
discharge_over_temperature_protection:
name: "Discharge Over Temperature Protection"
discharge_over_temperature_protection_release:
name: "Discharge Over Temperature Protection Release"
charge_under_temperature_alarm:
name: "Charge Under Temperature Alarm"
charge_under_temperature_protection:
name: "Charge Under Temperature Protection"
charge_under_temperature_protection_release:
name: "Charge Under Temperature Protection Release"
discharge_under_temperature_alarm:
name: "Discharge Under Temperature Alarm"
discharge_under_temperature_protection:
name: "Discharge Under Temperature Protection"
discharge_under_temperature_protection_release:
name: "Discharge Under Temperature Protection Release"
mosfet_over_temperature_alarm:
name: "Mosfet Over Temperature Alarm"
mosfet_over_temperature_protection:
name: "Mosfet Over Temperature Protection"
mosfet_over_temperature_protection_release:
name: "Mosfet Over Temperature Protection Release"
environment_over_temperature_alarm:
name: "Environment Over Temperature Alarm"
environment_over_temperature_protection:
name: "Environment Over Temperature Protection"
environment_over_temperature_protection_release:
name: "Environment Over Temperature Protection Release"
environment_under_temperature_alarm:
name: "Environment Under Temperature Alarm"
environment_under_temperature_protection:
name: "Environment Under Temperature Protection"
environment_under_temperature_protection_release:
name: "Environment Under Temperature Protection Release"