syssi / esphome-jbd-bms

ESPHome component to monitor and control a Xiaoxiang Battery Management System (JBD-BMS) via UART-TTL or BLE
Apache License 2.0
115 stars 31 forks source link

Add BLE support #9

Closed syssi closed 2 years ago

syssi commented 2 years ago

Fixes #7

Available BLE services, chars and handles

Found device at MAC address [70:3E:97:07:C0:3E]
 Attempting BLE connection to 70:3e:97:07:c0:3e
 Service UUID: 0x1800
   start_handle: 0x1  end_handle: 0x7
  characteristic 0x2A00, handle 0x3, properties 0x12
  characteristic 0x2A01, handle 0x5, properties 0x2
  characteristic 0x2A04, handle 0x7, properties 0x2
 Service UUID: 0x1801
   start_handle: 0x8  end_handle: 0xb
  characteristic 0x2A05, handle 0xa, properties 0x20
 Service UUID: 0x180A
   start_handle: 0xc  end_handle: 0xe
  characteristic 0x2A50, handle 0xe, properties 0x2
 Service UUID: 0xFF00
   start_handle: 0xf  end_handle: 0x16
  characteristic 0xFF01, handle 0x11, properties 0x12
  characteristic 0xFF02, handle 0x15, properties 0x6
 Service UUID: 00010203-0405-0607-0809-0A0B0C0D1912
   start_handle: 0x17  end_handle: 0x1b
  characteristic 00010203-0405-0607-0809-0A0B0C0D2B12, handle 0x19, properties 0x6

Protocol details

Setup request

Subscribe notifications

Frame no. 50

Periodic requests

Query cell voltages (0x04)

Frame no. 52

Query cell info (0x03)

Frame no. 55

Notifications:

Cell info notification (0x03, 40 + 32 bytes)

Frame no. 56 + 57

Cell voltages (0x04, 30 bytes)

Frame no. 66