I’m having some issues with my battery monitoring. I have a ESP32 and a Basen green 12V 100Ah battery with the xiaoxiang BMS. The ESP is placed just beside the battery but it does’nt connect to it. If you restart HA it can sometimes connect and show all parameters. But mostly it doesn’t connect to the battery. Any ideas?
Hello @burnspc, thanks for your great contribution. I have tried to get my unit SP04S034L4S200A connected but until now without much luck.
All values are returned as “nan”.
I have included parts of the log and the home assistant ESPHome configuration underneath and hope to get some pointers to fix this.
It might be relevant that I have accidentally set a bluetooth password on the device. I did try to remove it by changing it to 000000 but not sure whether that helped.
INFO ESPHome 2024.8.0
INFO Reading configuration /config/esphome/test.yaml...
INFO Updating https://github.com/syssi/esphome-jbd-bms.git@main
INFO Generating C++ source...
INFO Compiling app...
Processing battery-connect (board: esp32dev; framework: espidf; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
- framework-espidf @ 3.40407.240606 (4.4.7)
- tool-cmake @ 3.16.4
- tool-ninja @ 1.7.1
- toolchain-esp32ulp @ 2.35.0-20220830
- toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Reading CMake configuration...
Dependency Graph
|-- noise-c @ 0.1.6
Compiling .pioenvs/battery-connect/src/main.o
Linking .pioenvs/battery-connect/firmware.elf
RAM: [== ] 16.6% (used 54540 bytes from 327680 bytes)
Flash: [======= ] 74.1% (used 1358833 bytes from 1835008 bytes)
Building .pioenvs/battery-connect/firmware.bin
Creating esp32 image...
Successfully created esp32 image.
esp32_create_combined_bin([".pioenvs/battery-connect/firmware.bin"], [".pioenvs/battery-connect/firmware.elf"])
Wrote 0x15d5a0 bytes to file /data/build/battery-connect/.pioenvs/battery-connect/firmware.factory.bin, ready to flash to offset 0x0
esp32_copy_ota_bin([".pioenvs/battery-connect/firmware.bin"], [".pioenvs/battery-connect/firmware.elf"])
========================= [SUCCESS] Took 28.67 seconds =========================
INFO Successfully compiled program.
INFO Connecting to 192.168.1.141
INFO Uploading /data/build/battery-connect/.pioenvs/battery-connect/firmware.bin (1365408 bytes)
Uploading: [============================================================] 100% Done...
INFO Upload took 12.38 seconds, waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from 192.168.1.141 using esphome API
INFO Successfully connected to battery-connect @ 192.168.1.141 in 19.321s
INFO Successful handshake with battery-connect @ 192.168.1.141 in 0.123s
[17:20:52][I][app:100]: ESPHome version 2024.8.0 compiled on Aug 25 2024, 17:19:53
[17:20:52][I][app:102]: Project syssi.esphome-jbd-bms version 1.4.0
[17:20:52][C][wifi:600]: WiFi:
[17:20:52][C][wifi:428]: Local MAC: D0:EF:76:58:CC:80
[17:20:52][C][wifi:433]: SSID: 'Wegnet'[redacted]
[17:20:52][C][wifi:436]: IP Address: 192.168.1.141
[17:20:52][C][wifi:440]: BSSID: 74:83:C2:2A:FD:EA[redacted]
[17:20:52][C][wifi:441]: Hostname: 'battery-connect'
[17:20:52][C][wifi:443]: Signal strength: -62 dB ▂▄▆█
[17:20:52][C][wifi:447]: Channel: 11
[17:20:52][C][wifi:448]: Subnet: 255.255.255.0
[17:20:52][C][wifi:449]: Gateway: 192.168.1.1
[17:20:52][C][wifi:450]: DNS1: 0.0.0.0
[17:20:52][C][wifi:451]: DNS2: 0.0.0.0
[17:20:52][C][logger:185]: Logger:
[17:20:52][C][logger:186]: Level: DEBUG
[17:20:52][C][logger:188]: Log Baud Rate: 115200
[17:20:52][C][logger:189]: Hardware UART: UART0
[17:20:52][C][jbd_bms_ble:379]: JbdBmsBle:
[17:20:52][C][jbd_bms_ble:381]: Balancing 'battery-connect balancing'
[17:20:52][C][jbd_bms_ble:382]: Charging 'battery-connect charging'
[17:20:52][C][jbd_bms_ble:383]: Discharging 'battery-connect discharging'
[17:20:52][C][jbd_bms_ble:385]: Total voltage 'battery-connect total voltage'
[17:20:52][C][jbd_bms_ble:385]: Device Class: 'voltage'
[17:20:52][C][jbd_bms_ble:385]: State Class: 'measurement'
[17:20:52][C][jbd_bms_ble:385]: Unit of Measurement: 'V'
[17:20:52][C][jbd_bms_ble:385]: Accuracy Decimals: 2
[17:20:52][C][jbd_bms_ble:386]: Battery strings 'battery-connect battery strings'
[17:20:52][C][jbd_bms_ble:386]: State Class: 'measurement'
[17:20:52][C][jbd_bms_ble:386]: Unit of Measurement: ''
[17:20:52][C][jbd_bms_ble:386]: Accuracy Decimals: 0
[17:20:52][C][jbd_bms_ble:386]: Icon: 'mdi:car-battery'
[17:20:52][C][jbd_bms_ble:387]: Software version 'battery-connect software version'
[17:20:52][C][jbd_bms_ble:387]: State Class: 'measurement'
[17:20:52][C][jbd_bms_ble:387]: Unit of Measurement: ''
[17:20:52][C][jbd_bms_ble:387]: Accuracy Decimals: 1
[17:20:52][C][jbd_bms_ble:387]: Icon: 'mdi:numeric'
[17:20:52][C][jbd_bms_ble:388]: Current 'battery-connect current'
[17:20:52][C][jbd_bms_ble:388]: Device Class: 'current'
[17:20:52][C][jbd_bms_ble:388]: State Class: 'measurement'
[17:20:52][C][jbd_bms_ble:388]: Unit of Measurement: 'A'
[17:20:52][C][jbd_bms_ble:388]: Accuracy Decimals: 1
[17:20:52][C][jbd_bms_ble:388]: Icon: 'mdi:current-dc'
[17:20:52][C][jbd_bms_ble:389]: Power 'battery-connect power'
[17:20:52][C][jbd_bms_ble:389]: Device Class: 'power'
[17:20:52][C][jbd_bms_ble:389]: State Class: 'measurement'
[17:20:52][C][jbd_bms_ble:389]: Unit of Measurement: 'W'
[17:20:52][C][jbd_bms_ble:389]: Accuracy Decimals: 1
[17:20:52][C][jbd_bms_ble:390]: Charging Power 'battery-connect charging power'
[17:20:52][C][jbd_bms_ble:390]: Device Class: 'power'
[17:20:52][C][jbd_bms_ble:390]: State Class: 'measurement'
[17:20:52][C][jbd_bms_ble:390]: Unit of Measurement: 'W'
[17:20:52][C][jbd_bms_ble:390]: Accuracy Decimals: 2
[17:20:52][C][jbd_bms_ble:391]: Discharging Power 'battery-connect discharging power'
[17:20:52][C][jbd_bms_ble:391]: Device Class: 'power'
[17:20:52][C][jbd_bms_ble:391]: State Class: 'measurement'
[17:20:52][C][jbd_bms_ble:391]: Unit of Measurement: 'W'
[17:20:52][C][jbd_bms_ble:391]: Accuracy Decimals: 2
[17:20:52][C][jbd_bms_ble:392]: State of charge 'battery-connect state of charge'
[17:20:52][C][jbd_bms_ble:392]: Device Class: 'battery'
[17:20:52][C][jbd_bms_ble:392]: State Class: 'measurement'
[17:20:52][C][jbd_bms_ble:392]: Unit of Measurement: '%'
[17:20:52][C][jbd_bms_ble:392]: Accuracy Decimals: 0
[17:20:52][C][jbd_bms_ble:393]: Operation status bitmask 'battery-connect operation status bitmask'
[17:20:52][C][jbd_bms_ble:393]: State Class: 'measurement'
[17:20:52][C][jbd_bms_ble:393]: Unit of Measurement: ''
[17:20:52][C][jbd_bms_ble:393]: Accuracy Decimals: 0
[17:20:52][C][jbd_bms_ble:393]: Icon: 'mdi:heart-pulse'
[17:20:52][C][jbd_bms_ble:394]: Errors bitmask 'battery-connect errors bitmask'
[17:20:52][C][jbd_bms_ble:394]: State Class: 'measurement'
[17:20:52][C][jbd_bms_ble:394]: Unit of Measurement: ''
[17:20:52][C][jbd_bms_ble:394]: Accuracy Decimals: 0
[17:20:52][C][jbd_bms_ble:394]: Icon: 'mdi:alert-circle-outline'
[17:20:52][C][jbd_bms_ble:395]: Nominal capacity 'battery-connect nominal capacity'
[17:20:52][C][jbd_bms_ble:395]: State Class: 'measurement'
[17:20:52][C][jbd_bms_ble:395]: Unit of Measurement: 'Ah'
[17:20:52][C][jbd_bms_ble:395]: Accuracy Decimals: 2
[17:20:52][C][jbd_bms_ble:395]: Icon: 'mdi:battery-50'
[17:20:52][C][jbd_bms_ble:396]: Charging cycles 'battery-connect charging cycles'
[17:20:52][C][jbd_bms_ble:396]: State Class: 'measurement'
[17:20:52][C][jbd_bms_ble:396]: Unit of Measurement: ''
[17:20:52][C][jbd_bms_ble:396]: Accuracy Decimals: 0
[17:20:52][C][jbd_bms_ble:396]: Icon: 'mdi:battery-sync'
[17:20:52][C][jbd_bms_ble:397]: Balancer status bitmask 'battery-connect balancer status bitmask'
[17:20:52][C][jbd_bms_ble:397]: State Class: 'measurement'
[17:20:52][C][jbd_bms_ble:397]: Unit of Measurement: ''
[17:20:52][C][jbd_bms_ble:397]: Accuracy Decimals: 0
[17:20:52][C][jbd_bms_ble:397]: Icon: 'mdi:seesaw'
[17:20:52][C][jbd_bms_ble:398]: Capacity remaining 'battery-connect capacity remaining'
[17:20:52][C][jbd_bms_ble:398]: State Class: 'measurement'
[17:20:52][C][jbd_bms_ble:398]: Unit of Measurement: 'Ah'
[17:20:52][C][jbd_bms_ble:398]: Accuracy Decimals: 2
[17:20:52][C][jbd_bms_ble:398]: Icon: 'mdi:battery-50'
[17:20:52][C][jbd_bms_ble:399]: Average cell voltage sensor 'battery-connect average cell voltage'
[17:20:52][C][jbd_bms_ble:399]: Device Class: 'voltage'
[17:20:52][C][jbd_bms_ble:399]: State Class: 'measurement'
[17:20:52][C][jbd_bms_ble:399]: Unit of Measurement: 'V'
[17:20:52][C][jbd_bms_ble:399]: Accuracy Decimals: 4
[17:20:52][C][jbd_bms_ble:400]: Delta cell voltage sensor 'battery-connect delta cell voltage'
[17:20:53][C][jbd_bms_ble:400]: Device Class: 'voltage'
[17:20:53][C][jbd_bms_ble:400]: State Class: 'measurement'
[17:20:53][C][jbd_bms_ble:400]: Unit of Measurement: 'V'
[17:20:53][C][jbd_bms_ble:400]: Accuracy Decimals: 4
[17:20:53][C][jbd_bms_ble:401]: Maximum cell voltage 'battery-connect max cell voltage'
[17:20:53][C][jbd_bms_ble:401]: Device Class: 'voltage'
[17:20:53][C][jbd_bms_ble:401]: State Class: 'measurement'
[17:20:53][C][jbd_bms_ble:401]: Unit of Measurement: 'V'
[17:20:53][C][jbd_bms_ble:401]: Accuracy Decimals: 3
[17:20:53][C][jbd_bms_ble:401]: Icon: 'mdi:battery-plus-outline'
[17:20:53][C][jbd_bms_ble:402]: Min voltage cell 'battery-connect min voltage cell'
[17:20:53][C][jbd_bms_ble:402]: State Class: 'measurement'
[17:20:53][C][jbd_bms_ble:402]: Unit of Measurement: ''
[17:20:53][C][jbd_bms_ble:402]: Accuracy Decimals: 0
[17:20:53][C][jbd_bms_ble:402]: Icon: 'mdi:battery-minus-outline'
[17:20:53][C][jbd_bms_ble:403]: Max voltage cell 'battery-connect max voltage cell'
[17:20:53][C][jbd_bms_ble:403]: State Class: 'measurement'
[17:20:53][C][jbd_bms_ble:403]: Unit of Measurement: ''
[17:20:53][C][jbd_bms_ble:403]: Accuracy Decimals: 0
[17:20:53][C][jbd_bms_ble:403]: Icon: 'mdi:battery-plus-outline'
[17:20:53][C][jbd_bms_ble:404]: Minimum cell voltage 'battery-connect min cell voltage'
[17:20:53][C][jbd_bms_ble:404]: Device Class: 'voltage'
[17:20:53][C][jbd_bms_ble:404]: State Class: 'measurement'
[17:20:53][C][jbd_bms_ble:404]: Unit of Measurement: 'V'
[17:20:53][C][jbd_bms_ble:404]: Accuracy Decimals: 3
[17:20:53][C][jbd_bms_ble:404]: Icon: 'mdi:battery-minus-outline'
[17:20:53][C][jbd_bms_ble:406]: Temperature 1 'battery-connect temperature 1'
PART DELETED
[17:20:54][C][jbd_bms_ble:439]: Device Class: 'voltage'
[17:20:54][C][jbd_bms_ble:439]: State Class: 'measurement'
[17:20:54][C][jbd_bms_ble:439]: Unit of Measurement: 'V'
[17:20:54][C][jbd_bms_ble:439]: Accuracy Decimals: 3
[17:20:54][C][jbd_bms_ble:440]: Cell Voltage 29 'battery-connect cell voltage 29'
[17:20:54][C][jbd_bms_ble:440]: Device Class: 'voltage'
[17:20:54][C][jbd_bms_ble:440]: State Class: 'measurement'
[17:20:54][C][jbd_bms_ble:440]: Unit of Measurement: 'V'
[17:20:54][C][jbd_bms_ble:440]: Accuracy Decimals: 3
[17:20:54][C][jbd_bms_ble:441]: Cell Voltage 30 'battery-connect cell voltage 30'
[17:20:54][C][jbd_bms_ble:441]: Device Class: 'voltage'
[17:20:54][C][jbd_bms_ble:441]: State Class: 'measurement'
[17:20:54][C][jbd_bms_ble:441]: Unit of Measurement: 'V'
[17:20:54][C][jbd_bms_ble:441]: Accuracy Decimals: 3
[17:20:54][C][jbd_bms_ble:442]: Cell Voltage 31 'battery-connect cell voltage 31'
[17:20:54][C][jbd_bms_ble:442]: Device Class: 'voltage'
[17:20:54][C][jbd_bms_ble:442]: State Class: 'measurement'
[17:20:54][C][jbd_bms_ble:442]: Unit of Measurement: 'V'
[17:20:54][C][jbd_bms_ble:442]: Accuracy Decimals: 3
[17:20:54][C][jbd_bms_ble:443]: Cell Voltage 32 'battery-connect cell voltage 32'
[17:20:54][C][jbd_bms_ble:443]: Device Class: 'voltage'
[17:20:54][C][jbd_bms_ble:443]: State Class: 'measurement'
[17:20:54][C][jbd_bms_ble:443]: Unit of Measurement: 'V'
[17:20:54][C][jbd_bms_ble:443]: Accuracy Decimals: 3
[17:20:54][C][jbd_bms_ble:445]: Operation status 'battery-connect operation status'
[17:20:54][C][jbd_bms_ble:445]: Icon: 'mdi:heart-pulse'
[17:20:54][C][jbd_bms_ble:446]: Errors 'battery-connect errors'
[17:20:54][C][jbd_bms_ble:446]: Icon: 'mdi:alert-circle-outline'
[17:20:54][C][jbd_bms_ble:447]: Device model 'battery-connect device model'
[17:20:54][C][jbd_bms_ble:447]: Icon: 'mdi:chip'
[17:20:54][W][esp32_ble_tracker:114]: Too many BLE events to process. Some devices may not show up.
[17:20:54][C][ble_switch:068]: BLE Client Switch 'battery-connect enable bluetooth connection'
[17:20:54][C][ble_switch:070]: Icon: 'mdi:bluetooth'
[17:20:54][C][ble_switch:091]: Restore Mode: always OFF
[17:20:54][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:20:54][C][jbd_bms_ble.switch:068]: JbdBmsBle Switch 'battery-connect discharging'
[17:20:54][C][jbd_bms_ble.switch:070]: Icon: 'mdi:battery-charging-50'
[17:20:54][C][jbd_bms_ble.switch:091]: Restore Mode: always OFF
[17:20:54][C][jbd_bms_ble.switch:068]: JbdBmsBle Switch 'battery-connect charging'
[17:20:54][C][jbd_bms_ble.switch:070]: Icon: 'mdi:battery-charging-50'
[17:20:54][C][jbd_bms_ble.switch:091]: Restore Mode: always OFF
[17:20:54][C][esp32_ble:391]: ESP32 BLE:
[17:20:54][C][esp32_ble:393]: MAC address: D0:EF:76:58:CC:82
[17:20:54][C][esp32_ble:394]: IO Capability: none
[17:20:54][C][esp32_ble_tracker:653]: BLE Tracker:
[17:20:54][C][esp32_ble_tracker:654]: Scan Duration: 300 s
[17:20:54][C][esp32_ble_tracker:655]: Scan Interval: 320.0 ms
[17:20:54][C][esp32_ble_tracker:656]: Scan Window: 30.0 ms
[17:20:54][C][esp32_ble_tracker:657]: Scan Type: ACTIVE
[17:20:54][C][esp32_ble_tracker:658]: Continuous Scanning: True
[17:20:54][C][ble_client:027]: BLE Client:
[17:20:54][C][ble_client:028]: Address: A4:C1:37:04:2D:BE
[17:20:54][C][ble_client:029]: Auto-Connect: TRUE
[17:20:54][C][captive_portal:088]: Captive Portal:
[17:20:54][C][mdns:116]: mDNS:
[17:20:54][C][mdns:117]: Hostname: battery-connect
[17:20:54][C][esphome.ota:073]: Over-The-Air updates:
[17:20:54][C][esphome.ota:074]: Address: 192.168.1.141:3232
[17:20:54][C][esphome.ota:075]: Version: 2
[17:20:54][C][esphome.ota:078]: Password configured
[17:20:54][C][safe_mode:018]: Safe Mode:
[17:20:54][C][safe_mode:020]: Boot considered successful after 60 seconds
[17:20:54][C][safe_mode:021]: Invoke after 10 boot attempts
[17:20:54][C][safe_mode:023]: Remain in safe mode for 300 seconds
[17:20:54][C][api:139]: API Server:
[17:20:54][C][api:140]: Address: 192.168.1.141:6053
[17:20:54][C][api:142]: Using noise encryption: YES
[17:20:55][D][text_sensor:064]: 'battery-connect errors': Sending state 'Offline'
[17:20:55][D][sensor:094]: 'battery-connect state of charge': Sending state nan % with 0 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect total voltage': Sending state nan V with 2 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect current': Sending state nan A with 1 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect power': Sending state nan W with 1 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect charging power': Sending state nan W with 2 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect discharging power': Sending state nan W with 2 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect nominal capacity': Sending state nan Ah with 2 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect charging cycles': Sending state nan with 0 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect capacity remaining': Sending state nan Ah with 2 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect min cell voltage': Sending state nan V with 3 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect max cell voltage': Sending state nan V with 3 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect min voltage cell': Sending state nan with 0 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect max voltage cell': Sending state nan with 0 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect delta cell voltage': Sending state nan V with 4 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect average cell voltage': Sending state nan V with 4 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect operation status bitmask': Sending state nan with 0 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect errors bitmask': Sending state nan with 0 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect balancer status bitmask': Sending state nan with 0 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect battery strings': Sending state nan with 0 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect software version': Sending state nan with 1 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect temperature 1': Sending state nan °C with 1 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect temperature 2': Sending state nan °C with 1 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect temperature 3': Sending state nan °C with 1 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect temperature 4': Sending state nan °C with 1 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect temperature 5': Sending state nan °C with 1 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect temperature 6': Sending state nan °C with 1 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect cell voltage 1': Sending state nan V with 3 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect cell voltage 2': Sending state nan V with 3 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect cell voltage 3': Sending state nan V with 3 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect cell voltage 4': Sending state nan V with 3 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect cell voltage 5': Sending state nan V with 3 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect cell voltage 6': Sending state nan V with 3 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect cell voltage 7': Sending state nan V with 3 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect cell voltage 8': Sending state nan V with 3 decimals of accuracy
[17:20:55][D][sensor:094]: 'battery-connect cell voltage 9': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 10': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 11': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 12': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 13': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 14': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 15': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 16': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 17': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 18': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 19': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 20': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 21': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 22': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 23': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 24': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 25': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 26': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 27': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 28': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 29': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 30': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 31': Sending state nan V with 3 decimals of accuracy
[17:20:56][D][sensor:094]: 'battery-connect cell voltage 32': Sending state nan V with 3 decimals of accuracy
[17:20:56][W][component:237]: Component jbd_bms_ble took a long time for an operation (532 ms).
[17:20:56][W][component:238]: Components should block for at most 30 ms.
[17:20:56][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:20:57][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:20:59][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:01][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:03][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:05][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:07][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:09][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:11][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:13][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:15][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:17][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:19][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:21][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:23][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:25][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:27][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:29][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:31][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:33][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:35][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:37][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:38][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[17:21:38][D][esp32.preferences:114]: Saving 1 preferences to flash...
[17:21:38][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[17:21:39][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:41][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:43][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:45][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:47][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
[17:21:49][D][esp32_ble_client:110]: [0] [A4:C1:37:04:2D:BE] ESP_GATTC_WRITE_CHAR_EVT
CONFIGURATION:
substitutions:
name: battery-connect
device_description: "Monitor and control a Xiaoxiang Battery Management System (JBD-BMS) via BLE"
external_components_source: github://syssi/esphome-jbd-bms@main
mac_address: A4:C1:37:04:2D:BE
esphome:
name: ${name}
comment: ${device_description}
project:
name: "syssi.esphome-jbd-bms"
version: 1.4.0
esp32:
board: esp32dev
framework:
type: esp-idf
# arduino
external_components:
- source: ${external_components_source}
refresh: 0s
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "XXX="
ota:
- platform: esphome
password: "XXX"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 192.168.1.141
gateway: 192.168.1.1
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Test Fallback Hotspot"
password: "XXX"
captive_portal:
#mqtt:
# broker: !secret mqtt_host
# username: !secret mqtt_username
# password: !secret mqtt_password
# id: mqtt_client
esp32_ble_tracker:
on_ble_advertise:
then:
- lambda: |-
if (x.get_name().rfind("xiaoxiang", 0) == 0) {
ESP_LOGI("ble_adv", "New JBD-BMS found");
ESP_LOGI("ble_adv", " Name: %s", x.get_name().c_str());
ESP_LOGI("ble_adv", " MAC address: %s", x.address_str().c_str());
ESP_LOGD("ble_adv", " Advertised service UUIDs:");
for (auto uuid : x.get_service_uuids()) {
ESP_LOGD("ble_adv", " - %s", uuid.to_string().c_str());
}
}
ble_client:
- id: client0
mac_address: ${mac_address}
jbd_bms_ble:
- id: bms0
ble_client_id: client0
update_interval: 2s
binary_sensor:
- platform: jbd_bms_ble
jbd_bms_ble_id: bms0
balancing:
name: "${name} balancing"
charging:
name: "${name} charging"
discharging:
name: "${name} discharging"
sensor:
- platform: jbd_bms_ble
jbd_bms_ble_id: bms0
battery_strings:
name: "${name} battery strings"
current:
name: "${name} current"
power:
name: "${name} power"
charging_power:
name: "${name} charging power"
discharging_power:
name: "${name} discharging power"
state_of_charge:
name: "${name} state of charge"
nominal_capacity:
name: "${name} nominal capacity"
charging_cycles:
name: "${name} charging cycles"
capacity_remaining:
name: "${name} capacity remaining"
battery_cycle_capacity:
name: "${name} battery cycle capacity"
total_voltage:
name: "${name} total voltage"
average_cell_voltage:
name: "${name} average cell voltage"
delta_cell_voltage:
name: "${name} delta cell voltage"
min_cell_voltage:
name: "${name} min cell voltage"
max_cell_voltage:
name: "${name} max cell voltage"
min_voltage_cell:
name: "${name} min voltage cell"
max_voltage_cell:
name: "${name} max voltage cell"
temperature_1:
name: "${name} temperature 1"
temperature_2:
name: "${name} temperature 2"
temperature_3:
name: "${name} temperature 3"
temperature_4:
name: "${name} temperature 4"
temperature_5:
name: "${name} temperature 5"
temperature_6:
name: "${name} temperature 6"
cell_voltage_1:
name: "${name} cell voltage 1"
cell_voltage_2:
name: "${name} cell voltage 2"
cell_voltage_3:
name: "${name} cell voltage 3"
cell_voltage_4:
name: "${name} cell voltage 4"
cell_voltage_5:
name: "${name} cell voltage 5"
cell_voltage_6:
name: "${name} cell voltage 6"
cell_voltage_7:
name: "${name} cell voltage 7"
cell_voltage_8:
name: "${name} cell voltage 8"
cell_voltage_9:
name: "${name} cell voltage 9"
cell_voltage_10:
name: "${name} cell voltage 10"
cell_voltage_11:
name: "${name} cell voltage 11"
cell_voltage_12:
name: "${name} cell voltage 12"
cell_voltage_13:
name: "${name} cell voltage 13"
cell_voltage_14:
name: "${name} cell voltage 14"
cell_voltage_15:
name: "${name} cell voltage 15"
cell_voltage_16:
name: "${name} cell voltage 16"
cell_voltage_17:
name: "${name} cell voltage 17"
cell_voltage_18:
name: "${name} cell voltage 18"
cell_voltage_19:
name: "${name} cell voltage 19"
cell_voltage_20:
name: "${name} cell voltage 20"
cell_voltage_21:
name: "${name} cell voltage 21"
cell_voltage_22:
name: "${name} cell voltage 22"
cell_voltage_23:
name: "${name} cell voltage 23"
cell_voltage_24:
name: "${name} cell voltage 24"
cell_voltage_25:
name: "${name} cell voltage 25"
cell_voltage_26:
name: "${name} cell voltage 26"
cell_voltage_27:
name: "${name} cell voltage 27"
cell_voltage_28:
name: "${name} cell voltage 28"
cell_voltage_29:
name: "${name} cell voltage 29"
cell_voltage_30:
name: "${name} cell voltage 30"
cell_voltage_31:
name: "${name} cell voltage 31"
cell_voltage_32:
name: "${name} cell voltage 32"
operation_status_bitmask:
name: "${name} operation status bitmask"
errors_bitmask:
name: "${name} errors bitmask"
balancer_status_bitmask:
name: "${name} balancer status bitmask"
software_version:
name: "${name} software version"
text_sensor:
- platform: jbd_bms_ble
jbd_bms_ble_id: bms0
errors:
name: "${name} errors"
operation_status:
name: "${name} operation status"
device_model:
name: "${name} device model"
switch:
- platform: ble_client
ble_client_id: client0
name: "${name} enable bluetooth connection"
- platform: jbd_bms_ble
jbd_bms_ble_id: bms0
charging:
name: "${name} charging"
discharging:
name: "${name} discharging"
I am hopeful this thread isn’t too long dead to be dug back up.
I have a Chins 400 amp hour Bluetooth Smart LiFePO4 battery that uses BAT-BMS for monitoring, I am wondering if there is a way to get this worked into a Home Assistant Dashboard. It is my one missing piece for my RV monitoring dashbaord…

