Testing

Hi, does this work with a serial connection via bluetooth?

Please update the mac_address and flash this example configuration to a ESP32:
https://raw.githubusercontent.com/syssi/esphome-basen-bms/main/esp32-ble-example.yaml
If we are lucky the implementation is able to establish a BLE connection and receives some RAW frames already. If not we have to send a few commands to the BMS first (not implemented yet).

@mager33 Welcome back home! I would be happy if we can proceed here. :-)

@syssi hmm...it does not seem to connect by itself...
[18:37:59][I][app:102]: ESPHome version 2023.2.4 compiled on Feb 23 2023, 18:19:05
[18:37:59][I][app:104]: Project syssi.esphome-basen-bms version 1.3.0
[18:37:59][C][wifi:504]: WiFi:
[18:37:59][C][wifi:362]:   Local MAC: AC:67:B2:F9:CD:A8
[18:37:59][C][wifi:363]:   SSID: [redacted]
[18:37:59][C][wifi:364]:   IP Address: <IP_ADDRESS>
[18:37:59][C][wifi:366]:   BSSID: [redacted]
[18:37:59][C][wifi:367]:   Hostname: 'basen-bms-ble'
[18:37:59][C][wifi:369]:   Signal strength: -58 dB ▂▄▆█
[18:37:59][V][wifi:371]:   Priority: 0.0
[18:37:59][C][wifi:373]:   Channel: 11
[18:37:59][C][wifi:374]:   Subnet: <IP_ADDRESS>
[18:37:59][C][wifi:375]:   Gateway: <IP_ADDRESS>
[18:37:59][C][wifi:376]:   DNS1: <IP_ADDRESS>
[18:37:59][C][wifi:377]:   DNS2: <IP_ADDRESS>
[18:37:59][C][logger:293]: Logger:
[18:37:59][C][logger:294]:   Level: VERY_VERBOSE
[18:37:59][C][logger:295]:   Log Baud Rate: 115200
[18:37:59][C][logger:296]:   Hardware UART: UART0
[18:37:59][C][logger:298]:   Level for 'esp32_ble_tracker': VERY_VERBOSE
[18:37:59][C][logger:298]:   Level for 'basen_bms_ble': VERY_VERBOSE
[18:37:59][C][logger:298]:   Level for 'scheduler': DEBUG
[18:37:59][C][logger:298]:   Level for 'component': DEBUG
[18:37:59][C][logger:298]:   Level for 'sensor': DEBUG
[18:37:59][C][basen_bms_ble:214]: BasenBmsBle:
[18:37:59][C][basen_bms_ble:215]:   Fake traffic enabled: NO
[18:37:59][C][basen_bms_ble:217]: Total voltage 'basen-bms-ble total voltage'
[18:37:59][C][basen_bms_ble:217]:   Device Class: 'voltage'
[18:37:59][C][basen_bms_ble:217]:   State Class: 'measurement'
[18:37:59][C][basen_bms_ble:217]:   Unit of Measurement: 'V'
[18:37:59][C][basen_bms_ble:217]:   Accuracy Decimals: 2
[18:37:59][C][ble_switch:076]: BLE Client Switch 'basen-bms-ble enable bluetooth connection'
[18:37:59][C][ble_switch:078]:   Icon: 'mdi:bluetooth'
[18:37:59][C][ble_switch:099]:   Restore Mode: restore defaults to OFF
[18:37:59][C][basen_bms_ble.switch:076]: BasenBmsBle Switch 'basen-bms-ble charging'
[18:37:59][C][basen_bms_ble.switch:078]:   Icon: 'mdi:battery-charging-50'
[18:37:59][C][basen_bms_ble.switch:099]:   Restore Mode: restore defaults to OFF
[18:37:59][C][esp32_ble:214]: ESP32 BLE:
[18:37:59][C][esp32_ble_tracker:583]: BLE Tracker:
[18:37:59][C][esp32_ble_tracker:584]:   Scan Duration: 300 s
[18:37:59][C][esp32_ble_tracker:585]:   Scan Interval: 320.0 ms
[18:37:59][C][esp32_ble_tracker:586]:   Scan Window: 30.0 ms
[18:37:59][C][esp32_ble_tracker:587]:   Scan Type: ACTIVE
[18:37:59][C][esp32_ble_tracker:588]:   Continuous Scanning: True
[18:37:59][C][ble_client:027]: BLE Client:
[18:37:59][C][ble_client:028]:   Address: 70:3E:97:07:C0:3E
[18:37:59][C][mdns:108]: mDNS:
[18:37:59][C][mdns:109]:   Hostname: basen-bms-ble
[18:37:59][V][mdns:110]:   Services:
[18:37:59][V][mdns:112]:   - _esphomelib, _tcp, 6053
[18:37:59][V][mdns:114]:     TXT: version = 2023.2.4
[18:37:59][V][mdns:114]:     TXT: mac = ac67b2f9cda8
[18:37:59][V][mdns:114]:     TXT: platform = ESP32
[18:37:59][V][mdns:114]:     TXT: board = esp32dev
[18:37:59][V][mdns:114]:     TXT: network = wifi
[18:37:59][V][mdns:114]:     TXT: project_name = syssi.esphome-basen-bms
[18:37:59][V][mdns:114]:     TXT: project_version = 1.3.0
[18:37:59][C][ota:093]: Over-The-Air Updates:
[18:37:59][C][ota:094]:   Address: basen-bms-ble.local:3232
[18:37:59][C][api:138]: API Server:
[18:37:59][C][api:139]:   Address: basen-bms-ble.local:6053
[18:37:59][C][api:143]:   Using noise encryption: NO
[18:38:00][W][basen_bms_ble:199]: [70:3E:97:07:C0:3E] Not connected

@syssi but the advertisment is seen:
[V][esp32_ble:178]: (BLE) gap_event_handler - 3
[VV][esp32_ble_tracker:361]: Parse Result:
[VV][esp32_ble_tracker:378]:   Address: A4:C1:38:27:48:9A (PUBLIC)
[VV][esp32_ble_tracker:380]:   RSSI: -84
[VV][esp32_ble_tracker:381]:   Name: '17427'
[VV][esp32_ble_tracker:389]:   Ad Flag: 6
[VV][esp32_ble_tracker:392]:   Service UUID: 0xFA00
[VV][esp32_ble_tracker:395]:   Manufacturer data: <IP_ADDRESS>
[VV][esp32_ble_tracker:411]: Adv data: <IP_ADDRESS>.02.00.FA.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.07.FF.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.00 (62)
[W][basen_bms_ble:199]: [70:3E:97:07:C0:3E] Not connected

Is this A4:C1:38:27:48:9A the MAC address of the VIP BMS? Please update the variable mac_address at the head of the YAML to this value and flash again.

The BLE tracker should discover the device and print all advertised service uuids and characteristics of the BMS. As next step a BLE client connection should be established and some notifications should arrive (in best case).

in HomeAssistant I only get 1 device with 1 entity

At the moment the implementation writes everything to the log. There are no sensor entities exposed yet.

Please make sure the enable bluetooth connection is turned on.
I'm looking for something like this:

[17:25:56][D][ble_client:047]: Found device at MAC address [20:21:11:28:18:DD]
[17:25:56][I][ble_client:086]: Attempting BLE connection to 20:21:11:28:18:dd
[17:25:57][V][ble_client:126]: [20:21:11:28:18:dd] ESP_GATTC_CONNECT_EVT
[17:25:57][V][ble_client:116]: [20:21:11:28:18:dd] ESP_GATTC_OPEN_EVT
[17:25:57][V][ble_client:144]: cfg_mtu status 0, mtu 247
[17:25:57][V][ble_client:169]: [20:21:11:28:18:dd] ESP_GATTC_SEARCH_CMPL_EVT
[17:25:57][I][ble_client:171]: Service UUID: 0xFFE0
[17:25:57][I][ble_client:172]:   start_handle: 0x1  end_handle: 0xffff
[17:25:57][I][ble_client:384]:  characteristic 0xFFE1, handle 0x3, properties 0xc
[17:25:57][I][ble_client:384]:  characteristic 0xFFE1, handle 0x5, properties 0x12
[17:25:57][V][ble_client:419]:    descriptor 0x2902, handle 0x6

The BLE client tries to connect to a device with the MAC address 20:21:11:28:18:DD here. In your case it will be the MAC address of your YAML configuration. Please make sure you are using the correct MAC address here.

As soon the connection is established you should see these log messages:

[18:37:59][VV][basen_bms_ble:217]: Notification received (handle %d): ...

To reduce some noise you could update the logger configuration to this one:
logger:
  level: VERY_VERBOSE
  logs:
    esp32_ble_tracker: VERBOSE
    ble_client: VERY_VERBOSE
    basen_bms_ble: VERY_VERBOSE
    scheduler: DEBUG
    component: DEBUG
    sensor: DEBUG
    api: DEBUG
    api.service: DEBUG

Another detail: The BLE module of the BMS is probably not able to handle multiple connections. Please force close the android app to make sure the BLE module isn't blocked by another active connection.

Please make sure the enable bluetooth connection is turned on.
How?

I've set my phone to flight mode so no other BLE connection is active. Good point!
Will compile again.
In the meantime, some new entities have appeared in HA. But all "not availabe"

Success!
[20:08:58][W][basen_bms_ble:199]: [A4:C1:38:27:48:9A] Not connected
[20:08:59][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[20:08:59][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[20:08:59][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[20:08:59][D][esp32_ble_client:048]: [0] [A4:C1:38:27:48:9A] Found device
[20:08:59][D][esp32_ble_tracker:206]: Pausing scan to make connection...
[20:08:59][V][esp32_ble:178]: (BLE) gap_event_handler - 18
[20:08:59][I][esp32_ble_client:064]: [0] [A4:C1:38:27:48:9A] 0x00 Attempting BLE connection
[20:09:00][W][basen_bms_ble:199]: [A4:C1:38:27:48:9A] Not connected
[20:09:01][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 40
[20:09:01][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=40 gattc_if=3
[20:09:01][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 2
[20:09:01][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=2 gattc_if=3
[20:09:01][V][esp32_ble_client:126]: [0] [A4:C1:38:27:48:9A] ESP_GATTC_OPEN_EVT
[20:09:02][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 46
[20:09:02][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=46 gattc_if=3
[20:09:02][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 7
[20:09:02][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=7 gattc_if=3
[20:09:02][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 7
[20:09:02][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=7 gattc_if=3
[20:09:02][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 7
[20:09:02][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=7 gattc_if=3
[20:09:02][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 7
[20:09:02][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=7 gattc_if=3
[20:09:02][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 6
[20:09:02][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=6 gattc_if=3
[20:09:02][V][esp32_ble_client:186]: [0] [A4:C1:38:27:48:9A] ESP_GATTC_SEARCH_CMPL_EVT
[20:09:02][V][esp32_ble_client:189]: [0] [A4:C1:38:27:48:9A] Service UUID: 0x1800
[20:09:02][V][esp32_ble_client:191]: [0] [A4:C1:38:27:48:9A]  start_handle: 0x1  end_handle: 0x7
[20:09:02][V][esp32_ble_client:189]: [0] [A4:C1:38:27:48:9A] Service UUID: 0x1801
[20:09:02][V][esp32_ble_client:191]: [0] [A4:C1:38:27:48:9A]  start_handle: 0x8  end_handle: 0xb
[20:09:02][V][esp32_ble_client:189]: [0] [A4:C1:38:27:48:9A] Service UUID: 0x180A
[20:09:02][V][esp32_ble_client:191]: [0] [A4:C1:38:27:48:9A]  start_handle: 0xc  end_handle: 0xe
[20:09:02][V][esp32_ble_client:189]: [0] [A4:C1:38:27:48:9A] Service UUID: 0xFA00
[20:09:02][V][esp32_ble_client:191]: [0] [A4:C1:38:27:48:9A]  start_handle: 0xf  end_handle: 0x16
[20:09:02][I][esp32_ble_client:193]: [0] [A4:C1:38:27:48:9A] Connected
[20:09:02][V][esp32_ble_client:069]: [0] [A4:C1:38:27:48:9A]  characteristic 0xFA01, handle 0x11, properties 0x12
[20:09:02][V][esp32_ble_client:069]: [0] [A4:C1:38:27:48:9A]  characteristic 0xFA02, handle 0x15, properties 0x6
[20:09:02][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 18
[20:09:02][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=18 gattc_if=3
[20:09:02][V][esp32_ble_client:157]: [0] [A4:C1:38:27:48:9A] cfg_mtu status 0, mtu 23
[20:09:02][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 38
[20:09:02][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=38 gattc_if=3
[20:09:02][D][esp32_ble_tracker:238]: Starting scan...
[20:09:02][V][esp32_ble:178]: (BLE) gap_event_handler - 2
[20:09:02][V][esp32_ble:178]: (BLE) gap_event_handler - 7
[20:09:02][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 9
[20:09:02][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=9 gattc_if=3

I'm missing some basen_bms_ble log messages right after the BLE connection. Are there some messages if the connection is established?

We are on a good track! I've pushed a last change for today. The implementation issues 3 commands to the BMS now. This time the BMS should respond and we should see some additional log messages prefix with basen_bms_ble.

[20:45:12][W][basen_bms_ble:222]: [A4:C1:38:27:48:9A] Not connected
[20:45:13][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[20:45:13][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[20:45:13][D][esp32_ble_client:048]: [0] [A4:C1:38:27:48:9A] Found device
[20:45:13][D][esp32_ble_tracker:206]: Pausing scan to make connection...
[20:45:13][V][esp32_ble:178]: (BLE) gap_event_handler - 18
[20:45:13][I][esp32_ble_client:064]: [0] [A4:C1:38:27:48:9A] 0x00 Attempting BLE connection
[20:45:14][W][basen_bms_ble:222]: [A4:C1:38:27:48:9A] Not connected
[20:45:15][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 40
[20:45:15][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=40 gattc_if=3
[20:45:15][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 2
[20:45:15][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=2 gattc_if=3
[20:45:15][V][esp32_ble_client:126]: [0] [A4:C1:38:27:48:9A] ESP_GATTC_OPEN_EVT
[20:45:16][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 46
[20:45:16][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=46 gattc_if=3
[20:45:16][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 7
[20:45:16][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=7 gattc_if=3
[20:45:16][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 7
[20:45:16][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=7 gattc_if=3
[20:45:16][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 7
[20:45:16][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=7 gattc_if=3
[20:45:16][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 7
[20:45:16][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=7 gattc_if=3
[20:45:16][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 6
[20:45:16][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=6 gattc_if=3
[20:45:16][V][esp32_ble_client:186]: [0] [A4:C1:38:27:48:9A] ESP_GATTC_SEARCH_CMPL_EVT
[20:45:16][V][esp32_ble_client:189]: [0] [A4:C1:38:27:48:9A] Service UUID: 0x1800
[20:45:16][V][esp32_ble_client:191]: [0] [A4:C1:38:27:48:9A]  start_handle: 0x1  end_handle: 0x7
[20:45:16][V][esp32_ble_client:189]: [0] [A4:C1:38:27:48:9A] Service UUID: 0x1801
[20:45:16][V][esp32_ble_client:191]: [0] [A4:C1:38:27:48:9A]  start_handle: 0x8  end_handle: 0xb
[20:45:16][V][esp32_ble_client:189]: [0] [A4:C1:38:27:48:9A] Service UUID: 0x180A
[20:45:16][V][esp32_ble_client:191]: [0] [A4:C1:38:27:48:9A]  start_handle: 0xc  end_handle: 0xe
[20:45:16][V][esp32_ble_client:189]: [0] [A4:C1:38:27:48:9A] Service UUID: 0xFA00
[20:45:16][V][esp32_ble_client:191]: [0] [A4:C1:38:27:48:9A]  start_handle: 0xf  end_handle: 0x16
[20:45:16][I][esp32_ble_client:193]: [0] [A4:C1:38:27:48:9A] Connected
[20:45:16][V][esp32_ble_client:069]: [0] [A4:C1:38:27:48:9A]  characteristic 0xFA01, handle 0x11, properties 0x12
[20:45:16][V][esp32_ble_client:069]: [0] [A4:C1:38:27:48:9A]  characteristic 0xFA02, handle 0x15, properties 0x6
[20:45:16][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 18
[20:45:16][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=18 gattc_if=3
[20:45:16][V][esp32_ble_client:157]: [0] [A4:C1:38:27:48:9A] cfg_mtu status 0, mtu 23
[20:45:16][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 38
[20:45:16][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=38 gattc_if=3
[20:45:16][VV][basen_bms_ble:281]: Send command: 3B.16.2A.<IP_ADDRESS>.0D.0A (9)
[20:45:16][VV][basen_bms_ble:281]: Send command: 3B.16.2A.<IP_ADDRESS>.0D.0A (9)
[20:45:16][VV][basen_bms_ble:281]: Send command: 3B.16.2A.<IP_ADDRESS>.0D.0A (9)
[20:45:16][VV][basen_bms_ble:305]: Send command: 3A.<IP_ADDRESS>.3B.00.0D.0A (9)
[20:45:16][D][esp32_ble_tracker:238]: Starting scan...
[20:45:16][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 9
[20:45:16][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=9 gattc_if=3
[20:45:16][V][esp32_ble:178]: (BLE) gap_event_handler - 2
[20:45:16][V][esp32_ble:178]: (BLE) gap_event_handler - 7
[20:45:16][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[20:45:16][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[20:45:16][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[20:45:16][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[20:45:16][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[20:45:16][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[20:45:16][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[20:45:16][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[20:45:17][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[20:45:17][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[20:45:17][VV][basen_bms_ble:152]: Notification received (handle 17): 3B.16.2A.<IP_ADDRESS>.00.E4.61.3B.16.2A.<IP_ADDRESS>.00.E4.61 (20)
[20:45:17][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[20:45:17][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[20:45:17][VV][basen_bms_ble:152]: Notification received (handle 17): 16.2A.<IP_ADDRESS>.00.E<IP_ADDRESS>.18.3D.0C.3A.0C.3D.0C.35.0C (20)
[20:45:17][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[20:45:17][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[20:45:17][VV][basen_bms_ble:152]: Notification received (handle 17): 3C.0C.42.0C.40.0C.3D.0C.<IP_ADDRESS>.<IP_ADDRESS>.96.02.0D.0A (20)
[20:45:17][W][basen_bms_ble:164]: Maximum response size exceeded
[20:45:17][W][basen_bms_ble:189]: CRC check failed! 0x00EF != 0x0296
[20:45:17][V][esp32_ble:178]: (BLE) gap_event_handler - 3

Perfect! That's enough for now. I will ping you again as soon I made some progress implementing the communication flow.

I've pushed another change. This time the component send a single command. The BMS should answer with ~2 notifications which are assembled to a full frame with a proper CRC. Please give it a try as soon as it suits you.

WARNING basen-bms-ble.local: Connection error occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/aioesphomeapi/connection.py", line 520, in send_message_await_response_complex
await fut
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/aioesphomeapi/connection.py", line 520, in send_message_await_response_complex
await fut
File "/usr/local/lib/python3.9/dist-packages/async_timeout/init.py", line 129, in aexit
self._do_exit(exc_type)
File "/usr/local/lib/python3.9/dist-packages/async_timeout/init.py", line 212, in _do_exit
raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/aioesphomeapi/connection.py", line 303, in _keep_alive_loop
await self._ping()
File "/usr/local/lib/python3.9/dist-packages/aioesphomeapi/connection.py", line 628, in _ping
await self.send_message_await_response(PingRequest(), PingResponse)
File "/usr/local/lib/python3.9/dist-packages/aioesphomeapi/connection.py", line 537, in send_message_await_response
res = await self.send_message_await_response_complex(
File "/usr/local/lib/python3.9/dist-packages/aioesphomeapi/connection.py", line 522, in send_message_await_response_complex
raise TimeoutAPIError(
aioesphomeapi.core.TimeoutAPIError: Timeout waiting for response for <class 'api_pb2.PingRequest'> after 10.0s
INFO Disconnected from ESPHome API for basen-bms-ble.local
WARNING Disconnected from API
INFO Successfully connected to basen-bms-ble.local
[22:52:11][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:12][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:14][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:14][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:15][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:16][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:16][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:18][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:18][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:19][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:20][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:20][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:20][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:21][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:22][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:22][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:24][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:24][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:24][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:26][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:27][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:28][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:29][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:29][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:30][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:31][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:32][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:33][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:33][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:34][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:34][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:35][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:36][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:36][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:36][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:38][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:38][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:39][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:40][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:40][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:52:40][D][esp32_ble_client:048]: [0] [A4:C1:38:27:48:9A] Found device
[22:52:40][D][esp32_ble_tracker:206]: Pausing scan to make connection...
[22:52:40][V][esp32_ble:178]: (BLE) gap_event_handler - 18
[22:52:40][I][esp32_ble_client:064]: [0] [A4:C1:38:27:48:9A] 0x00 Attempting BLE connection
[22:52:42][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:44][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:46][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:48][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:50][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:52][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:54][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:56][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:52:58][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:53:00][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:53:01][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 40
[22:53:01][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=40 gattc_if=3
[22:53:01][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 2
[22:53:01][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=2 gattc_if=3
[22:53:01][V][esp32_ble_client:126]: [0] [A4:C1:38:27:48:9A] ESP_GATTC_OPEN_EVT
[22:53:02][W][basen_bms_ble:226]: [A4:C1:38:27:48:9A] Not connected
[22:53:03][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 46
[22:53:03][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=46 gattc_if=3
[22:53:03][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 7
[22:53:03][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=7 gattc_if=3
[22:53:03][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 7
[22:53:03][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=7 gattc_if=3
[22:53:03][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 7
[22:53:03][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=7 gattc_if=3
[22:53:03][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 7
[22:53:03][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=7 gattc_if=3
[22:53:03][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 6
[22:53:03][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=6 gattc_if=3
[22:53:03][V][esp32_ble_client:186]: [0] [A4:C1:38:27:48:9A] ESP_GATTC_SEARCH_CMPL_EVT
[22:53:03][V][esp32_ble_client:189]: [0] [A4:C1:38:27:48:9A] Service UUID: 0x1800
[22:53:03][V][esp32_ble_client:191]: [0] [A4:C1:38:27:48:9A]  start_handle: 0x1  end_handle: 0x7
[22:53:03][V][esp32_ble_client:189]: [0] [A4:C1:38:27:48:9A] Service UUID: 0x1801
[22:53:03][V][esp32_ble_client:191]: [0] [A4:C1:38:27:48:9A]  start_handle: 0x8  end_handle: 0xb
[22:53:03][V][esp32_ble_client:189]: [0] [A4:C1:38:27:48:9A] Service UUID: 0x180A
[22:53:03][V][esp32_ble_client:191]: [0] [A4:C1:38:27:48:9A]  start_handle: 0xc  end_handle: 0xe
[22:53:03][V][esp32_ble_client:189]: [0] [A4:C1:38:27:48:9A] Service UUID: 0xFA00
[22:53:03][V][esp32_ble_client:191]: [0] [A4:C1:38:27:48:9A]  start_handle: 0xf  end_handle: 0x16
[22:53:03][I][esp32_ble_client:193]: [0] [A4:C1:38:27:48:9A] Connected
[22:53:03][V][esp32_ble_client:069]: [0] [A4:C1:38:27:48:9A]  characteristic 0xFA01, handle 0x11, properties 0x12
[22:53:03][V][esp32_ble_client:069]: [0] [A4:C1:38:27:48:9A]  characteristic 0xFA02, handle 0x15, properties 0x6
[22:53:03][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 18
[22:53:03][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=18 gattc_if=3
[22:53:03][V][esp32_ble_client:157]: [0] [A4:C1:38:27:48:9A] cfg_mtu status 0, mtu 23
[22:53:03][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 38
[22:53:03][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=38 gattc_if=3
[22:53:03][VV][basen_bms_ble:288]: Send command (handle 0x15): 3B.16.2A.<IP_ADDRESS>.0D.0A (9)
[22:53:03][D][esp32_ble_tracker:238]: Starting scan...
[22:53:03][V][esp32_ble:178]: (BLE) gap_event_handler - 2
[22:53:03][V][esp32_ble:178]: (BLE) gap_event_handler - 7
[22:53:03][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 9
[22:53:03][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=9 gattc_if=3
[22:53:03][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[22:53:03][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[22:53:03][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[22:53:03][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[22:53:03][VV][basen_bms_ble:156]: Notification received (handle 0x11): 3B.16.2A.<IP_ADDRESS>.00.CE.<IP_ADDRESS>.<IP_ADDRESS>.23.00.00 (20)
[22:53:03][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[22:53:03][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[22:53:03][VV][basen_bms_ble:156]: Notification received (handle 0x11): <IP_ADDRESS>.<IP_ADDRESS>.6F.03.0D.0A (12)
[22:53:03][W][basen_bms_ble:237]: Unhandled response received (frame_type 0x2A): 3B.16.2A.<IP_ADDRESS>.00.CE.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.02.00.00 (28)
[22:53:04][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:53:05][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[22:53:11][V][esp32_ble:178]: (BLE) gap_event_handler - 3

Cool! This is the first properly assembled and verified response:
22:53:03][VV][basen_bms_ble:156]: Notification received (handle 0x11): 3B.16.2A.<IP_ADDRESS>.00.CE.<IP_ADDRESS>.<IP_ADDRESS>.23.00.00 (20)
[22:53:03][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[22:53:03][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[22:53:03][VV][basen_bms_ble:156]: Notification received (handle 0x11): <IP_ADDRESS>.<IP_ADDRESS>.6F.03.0D.0A (12)
[22:53:03][W][basen_bms_ble:237]: Unhandled response received (frame_type 0x2A): 3B.16.2A.<IP_ADDRESS>.00.CE.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.02.00.00 (28)

We will do the same for some more commands to collect all kind of responses/frames periodically. I will keep you updated!

You could do me a favor in the meantime: Could you provide screenshots of all views of the Android app? I would like to get a idea which values/measurements are available.

https://imgur.com/a/58Eb71U

Gesendet: Donnerstag, 23. Februar 2023 um 23:03 Uhr
Von: "Sebastian Muszynski" @.>
An: "syssi/esphome-basen-bms" @.>
Cc: "Martin" @.>, "Mention" @.>
Betreff: Re: [syssi/esphome-basen-bms] Testing (Issue #1)

You could do me a favor in the meantime: Could you provide screenshots of all views of the Android app? I would like to get a idea which values/measurements are available.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: @.***>

I've improved the component a bit. It's able to decode the general info and status frame now. Furthermore there are 5 commands issued now instead of one. This will help to collect some responses of the unhandled frames. Could you flash the updated version and provide some logs? Thanks in advance!

[00:14:29][D][api.connection:918]: Home Assistant 2023.2.5 (::FFFF:<IP_ADDRESS>): Connected successfully
[00:14:29][C][logger:293]: Logger:
[00:14:29][C][logger:294]:   Level: VERY_VERBOSE
[00:14:29][C][logger:295]:   Log Baud Rate: 115200
[00:14:29][C][logger:296]:   Hardware UART: UART0
[00:14:29][C][logger:298]:   Level for 'esp32_ble_tracker': VERBOSE
[00:14:29][C][logger:298]:   Level for 'ble_client': VERY_VERBOSE
[00:14:29][C][logger:298]:   Level for 'basen_bms_ble': VERY_VERBOSE
[00:14:29][C][logger:298]:   Level for 'scheduler': DEBUG
[00:14:29][C][logger:298]:   Level for 'component': DEBUG
[00:14:29][C][logger:298]:   Level for 'sensor': DEBUG
[00:14:29][C][logger:298]:   Level for 'api': DEBUG
[00:14:29][C][logger:298]:   Level for 'api.service': DEBUG
[00:14:29][C][basen_bms_ble:354]: BasenBmsBle:
[00:14:29][C][basen_bms_ble:355]:   Fake traffic enabled: NO
[00:14:29][C][basen_bms_ble:357]: Total voltage 'basen-bms-ble total voltage'
[00:14:29][C][basen_bms_ble:357]:   Device Class: 'voltage'
[00:14:29][C][basen_bms_ble:357]:   State Class: 'measurement'
[00:14:29][C][basen_bms_ble:357]:   Unit of Measurement: 'V'
[00:14:29][C][basen_bms_ble:357]:   Accuracy Decimals: 2
[00:14:29][C][ble_switch:076]: BLE Client Switch 'basen-bms-ble enable bluetooth connection'
[00:14:29][C][ble_switch:078]:   Icon: 'mdi:bluetooth'
[00:14:29][C][ble_switch:099]:   Restore Mode: restore defaults to OFF
[00:14:29][C][basen_bms_ble.switch:076]: BasenBmsBle Switch 'basen-bms-ble charging'
[00:14:29][C][basen_bms_ble.switch:078]:   Icon: 'mdi:battery-charging-50'
[00:14:29][C][basen_bms_ble.switch:099]:   Restore Mode: restore defaults to OFF
[00:14:29][C][esp32_ble:214]: ESP32 BLE:
[00:14:29][C][esp32_ble_tracker:583]: BLE Tracker:
[00:14:30][C][esp32_ble_tracker:584]:   Scan Duration: 300 s
[00:14:30][C][esp32_ble_tracker:585]:   Scan Interval: 320.0 ms
[00:14:30][C][esp32_ble_tracker:586]:   Scan Window: 30.0 ms
[00:14:30][C][esp32_ble_tracker:587]:   Scan Type: ACTIVE
[00:14:30][C][esp32_ble_tracker:588]:   Continuous Scanning: True
[00:14:30][C][ble_client:027]: BLE Client:
[00:14:30][C][ble_client:028]:   Address: A4:C1:38:27:48:9A
[00:14:30][C][mdns:108]: mDNS:
[00:14:30][C][mdns:109]:   Hostname: basen-bms-ble
[00:14:30][V][mdns:110]:   Services:
[00:14:30][V][mdns:112]:   - _esphomelib, _tcp, 6053
[00:14:30][V][mdns:114]:     TXT: version = 2023.2.4
[00:14:30][V][mdns:114]:     TXT: mac = ac67b2f9cda8
[00:14:30][V][mdns:114]:     TXT: platform = ESP32
[00:14:30][V][mdns:114]:     TXT: board = esp32dev
[00:14:30][V][mdns:114]:     TXT: network = wifi
[00:14:30][V][mdns:114]:     TXT: project_name = syssi.esphome-basen-bms
[00:14:30][V][mdns:114]:     TXT: project_version = 1.3.0
[00:14:30][C][ota:093]: Over-The-Air Updates:
[00:14:30][C][ota:094]:   Address: basen-bms-ble.local:3232
[00:14:30][C][api:138]: API Server:
[00:14:30][C][api:139]:   Address: basen-bms-ble.local:6053
[00:14:30][C][api:143]:   Using noise encryption: NO
[00:14:30][V][basen_bms_ble:401]: Send command (handle 0x15): 3A.16.FE.<IP_ADDRESS>.0D.0A (9)
[00:14:30][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[00:14:30][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[00:14:30][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[00:14:30][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[00:14:30][VV][basen_bms_ble:151]: Notification received (handle 0x11): 3A.16.FE.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.02 (20)
[00:14:30][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[00:14:30][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[00:14:30][VV][basen_bms_ble:151]: Notification received (handle 0x11): 76.53.61.E2.04.0D.0A (7)
[00:14:30][W][basen_bms_ble:244]: Unhandled response received (frame_type 0xFE): 3A.16.FE.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS> (23)
[00:14:31][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[00:14:31][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[00:14:31][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[00:14:32][V][basen_bms_ble:401]: Send command (handle 0x15): 3A.16.2A.<IP_ADDRESS>.0D.0A (9)
[00:14:32][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[00:14:32][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[00:14:32][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[00:14:32][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[00:14:32][VV][basen_bms_ble:151]: Notification received (handle 0x11): 3A.16.2A.<IP_ADDRESS>.00.B<IP_ADDRESS>.<IP_ADDRESS>.DE.3D.00.00 (20)
[00:14:32][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[00:14:32][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[00:14:32][VV][basen_bms_ble:151]: Notification received (handle 0x11): <IP_ADDRESS>.0F.02.00.00.F6.03.0D.0A (12)
[00:14:32][I][basen_bms_ble:256]: Status frame (28+4 bytes):
[00:14:32][D][basen_bms_ble:257]:   3A.16.2A.<IP_ADDRESS>.00.B<IP_ADDRESS>.<IP_ADDRESS>.DE.3D.<IP_ADDRESS>.00.00.0F.02.00.00 (28)
[00:14:32][I][basen_bms_ble:269]:   Current: 0.00 A
[00:14:32][I][basen_bms_ble:281]:   Charging states (Bitmask): 128 (0x80)
[00:14:32][I][basen_bms_ble:284]:   Discharging states (Bitmask): 128 (0x80)
[00:14:32][I][basen_bms_ble:287]:   Charging warnings: 0 (0x00)
[00:14:32][I][basen_bms_ble:290]:   Discharging warnings: 0 (0x00)
[00:14:34][V][basen_bms_ble:401]: Send command (handle 0x15): 3A.16.2B.<IP_ADDRESS>.0D.0A (9)
[00:14:34][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[00:14:34][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[00:14:34][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[00:14:34][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[00:14:34][VV][basen_bms_ble:151]: Notification received (handle 0x11): 3A.16.2B.18.A<IP_ADDRESS>.<IP_ADDRESS>.9B.A<IP_ADDRESS>.00.00.00 (20)
[00:14:34][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[00:14:34][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[00:14:34][VV][basen_bms_ble:151]: Notification received (handle 0x11): <IP_ADDRESS>.<IP_ADDRESS>.9A.04.0D.0A (12)
[00:14:34][I][basen_bms_ble:310]: General info frame (28+4 bytes):
[00:14:34][D][basen_bms_ble:311]:   3A.16.2B.18.A<IP_ADDRESS>.<IP_ADDRESS>.9B.A<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.53.11.00 (28)
[00:14:34][I][basen_bms_ble:323]:   Nominal capacity: 100.000 Ah
[00:14:34][I][basen_bms_ble:326]:   Nominal voltage: 25.600 V
[00:14:34][I][basen_bms_ble:329]:   Real capacity: 106.651 Ah
[00:14:34][I][basen_bms_ble:338]:   Serial number: 0
[00:14:34][I][basen_bms_ble:342]:   Manufacturing date: 2021.11.17
[00:14:34][I][basen_bms_ble:345]:   Charging cycles: 17
[00:14:36][V][basen_bms_ble:401]: Send command (handle 0x15): 3A.<IP_ADDRESS>.3B.00.0D.0A (9)
[00:14:36][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[00:14:36][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[00:14:36][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[00:14:36][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[00:14:36][VV][basen_bms_ble:151]: Notification received (handle 0x11): 3A.<IP_ADDRESS>.0C.97.0C.98.0C.96.0C.96.0C.98.0C.98.0C.97.0C (20)
[00:14:36][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[00:14:36][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[00:14:36][VV][basen_bms_ble:151]: Notification received (handle 0x11): <IP_ADDRESS>.<IP_ADDRESS>.6A.05.0D.0A (12)
[00:14:36][W][basen_bms_ble:244]: Unhandled response received (frame_type 0x24): 3A.<IP_ADDRESS>.0C.97.0C.98.0C.96.0C.96.0C.98.0C.98.0C.97.0C.<IP_ADDRESS>.<IP_ADDRESS> (28)
[00:14:38][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[00:14:38][V][basen_bms_ble:401]: Send command (handle 0x15): 3A.<IP_ADDRESS>.3C.00.0D.0A (9)
[00:14:38][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[00:14:38][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[00:14:38][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[00:14:38][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[00:14:38][VV][basen_bms_ble:151]: Notification received (handle 0x11): 3A.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.00.00.00 (20)
[00:14:38][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[00:14:38][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[00:14:38][VV][basen_bms_ble:151]: Notification received (handle 0x11): <IP_ADDRESS>.<IP_ADDRESS>.53.00.0D.0A (12)
[00:14:38][W][basen_bms_ble:244]: Unhandled response received (frame_type 0x25): 3A.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.00.00.00 (28)
[00:14:39][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[00:14:40][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[00:14:40][V][basen_bms_ble:401]: Send command (handle 0x15): 3A.16.FE.<IP_ADDRESS>.0D.0A (9)
[00:14:40][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[00:14:40][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[00:14:40][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[00:14:40][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[00:14:40][VV][basen_bms_ble:151]: Notification received (handle 0x11): 3A.16.FE.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.02 (20)
[00:14:40][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[00:14:40][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[00:14:40][VV][basen_bms_ble:151]: Notification received (handle 0x11): 76.53.61.E2.04.0D.0A (7)
[00:14:40][W][basen_bms_ble:244]: Unhandled response received (frame_type 0xFE): 3A.16.FE.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS> (23)
[00:14:42][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[00:14:42][V][basen_bms_ble:401]: Send command (handle 0x15): 3A.16.2A.<IP_ADDRESS>.0D.0A (9)
[00:14:42][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[00:14:42][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[00:14:42][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[00:14:42][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[00:14:42][VV][basen_bms_ble:151]: Notification received (handle 0x11): 3A.16.2A.<IP_ADDRESS>.00.B<IP_ADDRESS>.<IP_ADDRESS>.DE.3D.00.00 (20)
[00:14:42][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[00:14:42][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[00:14:42][VV][basen_bms_ble:151]: Notification received (handle 0x11): <IP_ADDRESS>.0F.02.00.00.F7.03.0D.0A (12)
[00:14:42][I][basen_bms_ble:256]: Status frame (28+4 bytes):
[00:14:42][D][basen_bms_ble:257]:   3A.16.2A.<IP_ADDRESS>.00.B<IP_ADDRESS>.<IP_ADDRESS>.DE.3D.<IP_ADDRESS>.00.00.0F.02.00.00 (28)
[00:14:42][I][basen_bms_ble:269]:   Current: 0.00 A
[00:14:42][I][basen_bms_ble:281]:   Charging states (Bitmask): 128 (0x80)
[00:14:42][I][basen_bms_ble:284]:   Discharging states (Bitmask): 128 (0x80)
[00:14:42][I][basen_bms_ble:287]:   Charging warnings: 0 (0x00)
[00:14:42][I][basen_bms_ble:290]:   Discharging warnings: 0 (0x00)
[00:14:43][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[00:14:44][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[00:14:44][V][basen_bms_ble:401]: Send command (handle 0x15): 3A.16.2B.<IP_ADDRESS>.0D.0A (9)
[00:14:44][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[00:14:44][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[00:14:44][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[00:14:44][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[00:14:44][VV][basen_bms_ble:151]: Notification received (handle 0x11): 3A.16.2B.18.A<IP_ADDRESS>.<IP_ADDRESS>.9B.A<IP_ADDRESS>.00.00.00 (20)
[00:14:44][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[00:14:44][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[00:14:44][VV][basen_bms_ble:151]: Notification received (handle 0x11): <IP_ADDRESS>.<IP_ADDRESS>.9A.04.0D.0A (12)
[00:14:44][I][basen_bms_ble:310]: General info frame (28+4 bytes):
[00:14:44][D][basen_bms_ble:311]:   3A.16.2B.18.A<IP_ADDRESS>.<IP_ADDRESS>.9B.A<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.53.11.00 (28)
[00:14:44][I][basen_bms_ble:323]:   Nominal capacity: 100.000 Ah
[00:14:44][I][basen_bms_ble:326]:   Nominal voltage: 25.600 V
[00:14:44][I][basen_bms_ble:329]:   Real capacity: 106.651 Ah
[00:14:44][I][basen_bms_ble:338]:   Serial number: 0
[00:14:44][I][basen_bms_ble:342]:   Manufacturing date: 2021.11.17
[00:14:44][I][basen_bms_ble:345]:   Charging cycles: 17
[00:14:45][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[00:14:45][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[00:14:46][V][basen_bms_ble:401]: Send command (handle 0x15): 3A.<IP_ADDRESS>.3B.00.0D.0A (9)
[00:14:46][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[00:14:46][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[00:14:46][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[00:14:46][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[00:14:46][VV][basen_bms_ble:151]: Notification received (handle 0x11): 3A.<IP_ADDRESS>.0C.97.0C.98.0C.96.0C.96.0C.98.0C.98.0C.97.0C (20)
[00:14:46][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[00:14:46][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[00:14:46][VV][basen_bms_ble:151]: Notification received (handle 0x11): <IP_ADDRESS>.<IP_ADDRESS>.6A.05.0D.0A (12)
[00:14:46][W][basen_bms_ble:244]: Unhandled response received (frame_type 0x24): 3A.<IP_ADDRESS>.0C.97.0C.98.0C.96.0C.96.0C.98.0C.98.0C.97.0C.<IP_ADDRESS>.<IP_ADDRESS> (28)
[00:14:47][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[00:14:48][V][basen_bms_ble:401]: Send command (handle 0x15): 3A.<IP_ADDRESS>.3C.00.0D.0A (9)
[00:14:48][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[00:14:48][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[00:14:48][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[00:14:48][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A]

Jo, cool - das war ein grosser Schritt. Die Einheit beim Strom stimmt nicht; es sind mA. (wir können deutsch reden, oder?).
 Das BMS schalten/konfigurieren finde ich nebensächlich! (hab auch Sorge, es zu "bricken")
[00:20:33][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[00:20:33][VV][basen_bms_ble:151]: Notification received (handle 0x11): <IP_ADDRESS>.0E.<IP_ADDRESS>.05.0D.0A (12)
[00:20:33][I][basen_bms_ble:256]: Status frame (28+4 bytes):
[00:20:33][D][basen_bms_ble:257]:   3A.16.2A.18.03.E5.FF.FF.<IP_ADDRESS>.<IP_ADDRESS>.35.3D.<IP_ADDRESS>.00.00.0E.02.00.00 (28)
[00:20:33][I][basen_bms_ble:269]:   Current: -6909.00 A
[00:20:33][I][basen_bms_ble:281]:   Charging states (Bitmask): 128 (0x80)
[00:20:33][I][basen_bms_ble:284]:   Discharging states (Bitmask): 128 (0x80)
[00:20:33][I][basen_bms_ble:287]:   Charging warnings: 0 (0x00)
[00:20:33][I][basen_bms_ble:290]:   Discharging warnings: 0 (0x00)

I will implement the decoding of the other frames (containing the total voltage, cell voltages and temperatures) this weekend probably. It will take some time but the response payloads and your screenshots will help a lot.

Some most important measurements/values will be decoded now. Please give it another try! :-)

Wow, alles geht! Es sind nur 8 Zellen, darum auch nur 8x sinnvolle Werte. Aus meiner Sicht fehlt nur der Sensor für HomeAssistant, dann bin ich sehr glücklich. Tolle Arbeit!
Den Schalter "enable bluetooth connection" verstehe ich nicht - der bezieht sich NUR auf den ESP32? Oder macht das was am BMS?
[11:56:41][C][basen_bms_ble:437]: BasenBmsBle:
[11:56:41][C][basen_bms_ble:438]:   Fake traffic enabled: NO
[11:56:41][C][basen_bms_ble:440]: Total voltage 'basen-bms-ble total voltage'
[11:56:41][C][basen_bms_ble:440]:   Device Class: 'voltage'
[11:56:41][C][basen_bms_ble:440]:   State Class: 'measurement'
[11:56:41][C][basen_bms_ble:440]:   Unit of Measurement: 'V'
[11:56:41][C][basen_bms_ble:440]:   Accuracy Decimals: 2
[11:56:41][C][ble_switch:076]: BLE Client Switch 'basen-bms-ble enable bluetooth connection'
[11:56:41][C][ble_switch:078]:   Icon: 'mdi:bluetooth'
[11:56:41][C][ble_switch:099]:   Restore Mode: restore defaults to OFF
[11:56:41][C][basen_bms_ble.switch:076]: BasenBmsBle Switch 'basen-bms-ble charging'
[11:56:41][C][basen_bms_ble.switch:078]:   Icon: 'mdi:battery-charging-50'
[11:56:41][C][basen_bms_ble.switch:099]:   Restore Mode: restore defaults to OFF
[11:56:41][C][esp32_ble:214]: ESP32 BLE:
[11:56:41][C][esp32_ble_tracker:583]: BLE Tracker:
[11:56:41][C][esp32_ble_tracker:584]:   Scan Duration: 300 s
[11:56:41][C][esp32_ble_tracker:585]:   Scan Interval: 320.0 ms
[11:56:41][C][esp32_ble_tracker:586]:   Scan Window: 30.0 ms
[11:56:41][C][esp32_ble_tracker:587]:   Scan Type: ACTIVE
[11:56:41][C][esp32_ble_tracker:588]:   Continuous Scanning: True
[11:56:41][C][ble_client:027]: BLE Client:
[11:56:41][C][ble_client:028]:   Address: A4:C1:38:27:48:9A
[11:56:41][C][mdns:108]: mDNS:
[11:56:41][C][mdns:109]:   Hostname: basen-bms-ble
[11:56:41][V][mdns:110]:   Services:
[11:56:41][V][mdns:112]:   - _esphomelib, _tcp, 6053
[11:56:41][V][mdns:114]:     TXT: version = 2023.2.4
[11:56:41][V][mdns:114]:     TXT: mac = ac67b2f9cda8
[11:56:41][V][mdns:114]:     TXT: platform = ESP32
[11:56:41][V][mdns:114]:     TXT: board = esp32dev
[11:56:41][V][mdns:114]:     TXT: network = wifi
[11:56:41][V][mdns:114]:     TXT: project_name = syssi.esphome-basen-bms
[11:56:41][V][mdns:114]:     TXT: project_version = 1.3.0
[11:56:42][C][ota:093]: Over-The-Air Updates:
[11:56:42][C][ota:094]:   Address: basen-bms-ble.local:3232
[11:56:42][C][api:138]: API Server:
[11:56:42][C][api:139]:   Address: basen-bms-ble.local:6053
[11:56:42][C][api:143]:   Using noise encryption: NO
[11:56:42][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:42][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:43][V][basen_bms_ble:484]: Send command (handle 0x15): 3A.<IP_ADDRESS>.3B.00.0D.0A (9)
[11:56:43][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[11:56:43][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[11:56:43][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[11:56:43][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[11:56:43][VV][basen_bms_ble:161]: Notification received (handle 0x11): 3A.<IP_ADDRESS>E.0D.11.0D.12.0D.11.0D.10.0D.10.0D.13.0D.12.0D (20)
[11:56:43][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[11:56:43][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[11:56:43][VV][basen_bms_ble:161]: Notification received (handle 0x11): <IP_ADDRESS>.<IP_ADDRESS>.41.01.0D.0A (12)
[11:56:43][I][basen_bms_ble:403]: Cell voltages frame (chunk 0, 28+4 bytes):
[11:56:43][D][basen_bms_ble:404]:   3A.<IP_ADDRESS>E.0D.11.0D.12.0D.11.0D.10.0D.10.0D.13.0D.12.0D.<IP_ADDRESS>.<IP_ADDRESS> (28)
[11:56:43][I][basen_bms_ble:428]:   Cell voltage 1: 3.342 V
[11:56:43][I][basen_bms_ble:428]:   Cell voltage 2: 3.345 V
[11:56:43][I][basen_bms_ble:428]:   Cell voltage 3: 3.346 V
[11:56:43][I][basen_bms_ble:428]:   Cell voltage 4: 3.345 V
[11:56:43][I][basen_bms_ble:428]:   Cell voltage 5: 3.344 V
[11:56:43][I][basen_bms_ble:428]:   Cell voltage 6: 3.344 V
[11:56:43][I][basen_bms_ble:428]:   Cell voltage 7: 3.347 V
[11:56:43][I][basen_bms_ble:428]:   Cell voltage 8: 3.346 V
[11:56:43][I][basen_bms_ble:428]:   Cell voltage 9: 0.000 V
[11:56:43][I][basen_bms_ble:428]:   Cell voltage 10: 0.000 V
[11:56:43][I][basen_bms_ble:428]:   Cell voltage 11: 0.000 V
[11:56:43][I][basen_bms_ble:428]:   Cell voltage 12: 0.000 V
[11:56:43][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:44][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:44][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:45][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:45][V][basen_bms_ble:484]: Send command (handle 0x15): 3A.<IP_ADDRESS>.3C.00.0D.0A (9)
[11:56:45][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[11:56:45][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[11:56:45][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[11:56:45][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[11:56:45][VV][basen_bms_ble:161]: Notification received (handle 0x11): 3A.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.00.00.00 (20)
[11:56:45][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[11:56:45][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[11:56:45][VV][basen_bms_ble:161]: Notification received (handle 0x11): <IP_ADDRESS>.<IP_ADDRESS>.53.00.0D.0A (12)
[11:56:45][I][basen_bms_ble:403]: Cell voltages frame (chunk 1, 28+4 bytes):
[11:56:45][D][basen_bms_ble:404]:   3A.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.00.00.00 (28)
[11:56:45][I][basen_bms_ble:428]:   Cell voltage 13: 0.000 V
[11:56:45][I][basen_bms_ble:428]:   Cell voltage 14: 0.000 V
[11:56:45][I][basen_bms_ble:428]:   Cell voltage 15: 0.000 V
[11:56:45][I][basen_bms_ble:428]:   Cell voltage 16: 0.000 V
[11:56:45][I][basen_bms_ble:428]:   Cell voltage 17: 0.000 V
[11:56:45][I][basen_bms_ble:428]:   Cell voltage 18: 0.000 V
[11:56:45][I][basen_bms_ble:428]:   Cell voltage 19: 0.000 V
[11:56:45][I][basen_bms_ble:428]:   Cell voltage 20: 0.000 V
[11:56:45][I][basen_bms_ble:428]:   Cell voltage 21: 0.000 V
[11:56:45][I][basen_bms_ble:428]:   Cell voltage 22: 0.000 V
[11:56:45][I][basen_bms_ble:428]:   Cell voltage 23: 0.000 V
[11:56:45][I][basen_bms_ble:428]:   Cell voltage 24: 0.000 V
[11:56:46][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:46][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:47][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:47][V][basen_bms_ble:484]: Send command (handle 0x15): 3A.16.FE.<IP_ADDRESS>.0D.0A (9)
[11:56:47][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[11:56:47][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[11:56:47][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[11:56:47][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[11:56:47][VV][basen_bms_ble:161]: Notification received (handle 0x11): 3A.16.FE.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.02 (20)
[11:56:47][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[11:56:47][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[11:56:47][VV][basen_bms_ble:161]: Notification received (handle 0x11): <IP_ADDRESS>.04.0D.0A (7)
[11:56:47][W][basen_bms_ble:268]: Unhandled response received (frame_type 0xFE): 3A.16.FE.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS> (23)
[11:56:47][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:48][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:49][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:49][V][basen_bms_ble:484]: Send command (handle 0x15): 3A.16.2A.<IP_ADDRESS>.0D.0A (9)
[11:56:49][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[11:56:49][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[11:56:49][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[11:56:49][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[11:56:49][VV][basen_bms_ble:161]: Notification received (handle 0x11): 3A.16.2A.18.60.4F.<IP_ADDRESS>.<IP_ADDRESS>.19.19.F<IP_ADDRESS> (20)
[11:56:49][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[11:56:49][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[11:56:49][VV][basen_bms_ble:161]: Notification received (handle 0x11): <IP_ADDRESS>.1F.02.00.00.EC.04.0D.0A (12)
[11:56:49][I][basen_bms_ble:283]: Status frame (28+4 bytes):
[11:56:49][D][basen_bms_ble:284]:   3A.16.2A.18.60.4F.<IP_ADDRESS>.<IP_ADDRESS>.19.19.F<IP_ADDRESS>.<IP_ADDRESS>.1F.02.00.00 (28)
[11:56:49][I][basen_bms_ble:296]:   Current: 20.320 A
[11:56:49][I][basen_bms_ble:299]:   Total voltage: 26.761 V
[11:56:49][D][basen_bms_ble:302]:   Temperature 1: 19 °C
[11:56:49][D][basen_bms_ble:305]:   Temperature 2: 20 °C
[11:56:49][D][basen_bms_ble:308]:   Temperature 3: 25 °C
[11:56:49][D][basen_bms_ble:311]:   Temperature 4: 25 °C
[11:56:49][I][basen_bms_ble:314]:   Capacity remaining: 33.528 Ah
[11:56:49][D][basen_bms_ble:317]:   Charging states (Bitmask): 128 (0x80)
[11:56:49][I][basen_bms_ble:318]:   Charging states: Charging MOS (CHG)
[11:56:49][D][basen_bms_ble:321]:   Discharging states (Bitmask): 128 (0x80)
[11:56:49][I][basen_bms_ble:322]:   Discharging states: Discharging MOS (DSG)
[11:56:49][D][basen_bms_ble:325]:   Charging warnings (Bitmask): 0 (0x00)
[11:56:49][I][basen_bms_ble:326]:   Charging warnings:
[11:56:49][D][basen_bms_ble:329]:   Discharging warnings (Bitmask): 0 (0x00)
[11:56:49][I][basen_bms_ble:330]:   Discharging warnings:
[11:56:49][D][basen_bms_ble:333]:   State of charge: 31 %
[11:56:49][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:50][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:50][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:51][V][basen_bms_ble:484]: Send command (handle 0x15): 3A.16.2B.<IP_ADDRESS>.0D.0A (9)
[11:56:51][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[11:56:51][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[11:56:51][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[11:56:51][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[11:56:51][VV][basen_bms_ble:161]: Notification received (handle 0x11): 3A.16.2B.18.A<IP_ADDRESS>.<IP_ADDRESS>.9B.A<IP_ADDRESS>.00.00.00 (20)
[11:56:51][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[11:56:51][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[11:56:51][VV][basen_bms_ble:161]: Notification received (handle 0x11): <IP_ADDRESS>.<IP_ADDRESS>.9A.04.0D.0A (12)
[11:56:51][I][basen_bms_ble:352]: General info frame (28+4 bytes):
[11:56:51][D][basen_bms_ble:353]:   3A.16.2B.18.A<IP_ADDRESS>.<IP_ADDRESS>.9B.A<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.53.11.00 (28)
[11:56:51][I][basen_bms_ble:365]:   Nominal capacity: 100.000 Ah
[11:56:51][I][basen_bms_ble:368]:   Nominal voltage: 25.600 V
[11:56:51][I][basen_bms_ble:371]:   Real capacity: 106.651 Ah
[11:56:51][I][basen_bms_ble:380]:   Serial number: 0
[11:56:51][I][basen_bms_ble:384]:   Manufacturing date: 2021.11.17
[11:56:51][I][basen_bms_ble:387]:   Charging cycles: 17
[11:56:51][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:51][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:52][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:52][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:52][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:53][V][basen_bms_ble:484]: Send command (handle 0x15): 3A.<IP_ADDRESS>.3B.00.0D.0A (9)
[11:56:53][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[11:56:53][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[11:56:53][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[11:56:53][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[11:56:53][VV][basen_bms_ble:161]: Notification received (handle 0x11): 3A.<IP_ADDRESS>B.0D.0F.0D.10.0D.0E.0D.0E.0D.10.0D.11.0D.10.0D (20)
[11:56:53][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[11:56:53][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[11:56:53][VV][basen_bms_ble:161]: Notification received (handle 0x11): <IP_ADDRESS>.<IP_ADDRESS>.31.01.0D.0A (12)
[11:56:53][I][basen_bms_ble:403]: Cell voltages frame (chunk 0, 28+4 bytes):
[11:56:53][D][basen_bms_ble:404]:   3A.<IP_ADDRESS>B.0D.0F.0D.10.0D.0E.0D.0E.0D.10.0D.11.0D.10.0D.<IP_ADDRESS>.<IP_ADDRESS> (28)
[11:56:53][I][basen_bms_ble:428]:   Cell voltage 1: 3.339 V
[11:56:53][I][basen_bms_ble:428]:   Cell voltage 2: 3.343 V
[11:56:53][I][basen_bms_ble:428]:   Cell voltage 3: 3.344 V
[11:56:53][I][basen_bms_ble:428]:   Cell voltage 4: 3.342 V
[11:56:53][I][basen_bms_ble:428]:   Cell voltage 5: 3.342 V
[11:56:53][I][basen_bms_ble:428]:   Cell voltage 6: 3.344 V
[11:56:53][I][basen_bms_ble:428]:   Cell voltage 7: 3.345 V
[11:56:53][I][basen_bms_ble:428]:   Cell voltage 8: 3.344 V
[11:56:53][I][basen_bms_ble:428]:   Cell voltage 9: 0.000 V
[11:56:53][I][basen_bms_ble:428]:   Cell voltage 10: 0.000 V
[11:56:53][I][basen_bms_ble:428]:   Cell voltage 11: 0.000 V
[11:56:53][I][basen_bms_ble:428]:   Cell voltage 12: 0.000 V
[11:56:54][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:54][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:54][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:55][V][basen_bms_ble:484]: Send command (handle 0x15): 3A.<IP_ADDRESS>.3C.00.0D.0A (9)
[11:56:55][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[11:56:55][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[11:56:55][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[11:56:55][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[11:56:55][VV][basen_bms_ble:161]: Notification received (handle 0x11): 3A.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.00.00.00 (20)
[11:56:55][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[11:56:55][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[11:56:55][VV][basen_bms_ble:161]: Notification received (handle 0x11): <IP_ADDRESS>.<IP_ADDRESS>.53.00.0D.0A (12)
[11:56:55][I][basen_bms_ble:403]: Cell voltages frame (chunk 1, 28+4 bytes):
[11:56:55][D][basen_bms_ble:404]:   3A.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.00.00.00 (28)
[11:56:55][I][basen_bms_ble:428]:   Cell voltage 13: 0.000 V
[11:56:55][I][basen_bms_ble:428]:   Cell voltage 14: 0.000 V
[11:56:55][I][basen_bms_ble:428]:   Cell voltage 15: 0.000 V
[11:56:55][I][basen_bms_ble:428]:   Cell voltage 16: 0.000 V
[11:56:55][I][basen_bms_ble:428]:   Cell voltage 17: 0.000 V
[11:56:55][I][basen_bms_ble:428]:   Cell voltage 18: 0.000 V
[11:56:55][I][basen_bms_ble:428]:   Cell voltage 19: 0.000 V
[11:56:55][I][basen_bms_ble:428]:   Cell voltage 20: 0.000 V
[11:56:55][I][basen_bms_ble:428]:   Cell voltage 21: 0.000 V
[11:56:55][I][basen_bms_ble:428]:   Cell voltage 22: 0.000 V
[11:56:55][I][basen_bms_ble:428]:   Cell voltage 23: 0.000 V
[11:56:55][I][basen_bms_ble:428]:   Cell voltage 24: 0.000 V
[11:56:56][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:56][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:56][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:57][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:57][V][basen_bms_ble:484]: Send command (handle 0x15): 3A.16.FE.<IP_ADDRESS>.0D.0A (9)
[11:56:57][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[11:56:57][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[11:56:57][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[11:56:57][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[11:56:57][VV][basen_bms_ble:161]: Notification received (handle 0x11): 3A.16.FE.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.02 (20)
[11:56:57][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[11:56:57][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[11:56:57][VV][basen_bms_ble:161]: Notification received (handle 0x11): <IP_ADDRESS>.04.0D.0A (7)
[11:56:57][W][basen_bms_ble:268]: Unhandled response received (frame_type 0xFE): 3A.16.FE.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS> (23)
[11:56:58][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:56:59][V][basen_bms_ble:484]: Send command (handle 0x15): 3A.16.2A.<IP_ADDRESS>.0D.0A (9)
[11:56:59][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[11:56:59][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[11:56:59][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[11:56:59][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[11:56:59][VV][basen_bms_ble:161]: Notification received (handle 0x11): 3A.16.2A.18.0A.2C.00.00.4F.<IP_ADDRESS>.<IP_ADDRESS>.83.00.00 (20)
[11:56:59][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[11:56:59][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[11:56:59][VV][basen_bms_ble:161]: Notification received (handle 0x11): <IP_ADDRESS>.1F.<IP_ADDRESS>.03.0D.0A (12)
[11:56:59][I][basen_bms_ble:283]: Status frame (28+4 bytes):
[11:56:59][D][basen_bms_ble:284]:   3A.16.2A.18.0A.2C.00.00.4F.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>F.02.00.00 (28)
[11:56:59][I][basen_bms_ble:296]:   Current: 11.274 A
[11:56:59][I][basen_bms_ble:299]:   Total voltage: 26.703 V
[11:56:59][D][basen_bms_ble:302]:   Temperature 1: 19 °C
[11:56:59][D][basen_bms_ble:305]:   Temperature 2: 20 °C
[11:56:59][D][basen_bms_ble:308]:   Temperature 3: 25 °C
[11:56:59][D][basen_bms_ble:311]:   Temperature 4: 25 °C
[11:56:59][I][basen_bms_ble:314]:   Capacity remaining: 33.573 Ah
[11:56:59][D][basen_bms_ble:317]:   Charging states (Bitmask): 128 (0x80)
[11:56:59][I][basen_bms_ble:318]:   Charging states: Charging MOS (CHG)
[11:56:59][D][basen_bms_ble:321]:   Discharging states (Bitmask): 128 (0x80)
[11:56:59][I][basen_bms_ble:322]:   Discharging states: Discharging MOS (DSG)
[11:56:59][D][basen_bms_ble:325]:   Charging warnings (Bitmask): 0 (0x00)
[11:56:59][I][basen_bms_ble:326]:   Charging warnings:
[11:56:59][D][basen_bms_ble:329]:   Discharging warnings (Bitmask): 0 (0x00)
[11:56:59][I][basen_bms_ble:330]:   Discharging warnings:
[11:56:59][D][basen_bms_ble:333]:   State of charge: 31 %
[11:57:00][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:57:01][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:57:01][V][basen_bms_ble:484]: Send command (handle 0x15): 3A.16.2B.<IP_ADDRESS>.0D.0A (9)
[11:57:01][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 4
[11:57:01][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[11:57:01][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[11:57:01][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[11:57:01][VV][basen_bms_ble:161]: Notification received (handle 0x11): 3A.16.2B.18.A<IP_ADDRESS>.<IP_ADDRESS>.9B.A<IP_ADDRESS>.00.00.00 (20)
[11:57:01][V][esp32_ble:206]: (BLE) gattc_event [esp_gatt_if: 3] - 10
[11:57:01][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[11:57:01][VV][basen_bms_ble:161]: Notification received (handle 0x11): <IP_ADDRESS>.<IP_ADDRESS>.9A.04.0D.0A (12)
[11:57:01][I][basen_bms_ble:352]: General info frame (28+4 bytes):
[11:57:01][D][basen_bms_ble:353]:   3A.16.2B.18.A<IP_ADDRESS>.<IP_ADDRESS>.9B.A<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.53.11.00 (28)
[11:57:01][I][basen_bms_ble:365]:   Nominal capacity: 100.000 Ah
[11:57:01][I][basen_bms_ble:368]:   Nominal voltage: 25.600 V
[11:57:01][I][basen_bms_ble:371]:   Real capacity: 106.651 Ah
[11:57:01][I][basen_bms_ble:380]:   Serial number: 0
[11:57:01][I][basen_bms_ble:384]:   Manufacturing date: 2021.11.17
[11:57:01][I][basen_bms_ble:387]:   Charging cycles: 17
[11:57:02][V][esp32_ble:178]: (BLE) gap_event_handler - 3
[11:57:02][V][esp32_ble:178]: (BLE) gap_event_handler - 3

If you turn off the enable bluetooth connection switch the BLE client connection to your BMS gets pause/suspended. So you can use your Android App again without removing the power supply from the ESP.

Please update your YAML or just take this one: https://raw.githubusercontent.com/syssi/esphome-basen-bms/main/esp32-ble-example.yaml
It will provide a lot of entities.

I would like to mention your battery model at the docs. Could you tell me some details / the model name of your battery?

[19:26:00][I][app:102]: ESPHome version 2023.2.4 compiled on Feb 25 2023, 19:22:50
[19:26:00][I][app:104]: Project syssi.esphome-basen-bms version 1.3.0
[19:26:00][C][wifi:504]: WiFi:
[19:26:00][C][wifi:362]:   Local MAC: AC:67:B2:F9:CD:A8
[19:26:00][C][wifi:363]:   SSID: [redacted]
[19:26:00][C][wifi:364]:   IP Address: <IP_ADDRESS>
[19:26:00][C][wifi:366]:   BSSID: [redacted]
[19:26:00][C][wifi:367]:   Hostname: 'basen-bms-ble'
[19:26:00][C][wifi:369]:   Signal strength: -60 dB ▂▄▆█
[19:26:00][V][wifi:371]:   Priority: 0.0
[19:26:00][C][wifi:373]:   Channel: 1
[19:26:00][C][wifi:374]:   Subnet: <IP_ADDRESS>
[19:26:00][C][wifi:375]:   Gateway: <IP_ADDRESS>
[19:26:00][C][wifi:376]:   DNS1: <IP_ADDRESS>
[19:26:00][C][wifi:377]:   DNS2: <IP_ADDRESS>
[19:26:00][W][basen_bms_ble:242]: [A4:C1:38:27:48:9A] Not connected
[19:26:00][C][logger:293]: Logger:
[19:26:00][C][logger:294]:   Level: VERY_VERBOSE
[19:26:00][C][logger:295]:   Log Baud Rate: 115200
[19:26:00][C][logger:296]:   Hardware UART: UART0
[19:26:00][C][logger:298]:   Level for 'basen_bms_ble': VERY_VERBOSE
[19:26:00][C][logger:298]:   Level for 'ble_client': DEBUG
[19:26:00][C][logger:298]:   Level for 'esp32_ble': DEBUG
[19:26:00][C][logger:298]:   Level for 'esp32_ble_tracker': DEBUG
[19:26:00][C][logger:298]:   Level for 'scheduler': DEBUG
[19:26:00][C][logger:298]:   Level for 'component': DEBUG
[19:26:00][C][logger:298]:   Level for 'sensor': DEBUG
[19:26:00][C][logger:298]:   Level for 'api': DEBUG
[19:26:00][C][logger:298]:   Level for 'api.service': DEBUG
[19:26:00][C][basen_bms_ble:483]: BasenBmsBle:
[19:26:00][C][basen_bms_ble:484]:   Fake traffic enabled: NO
[19:26:00][C][basen_bms_ble:486]: Balancing 'basen-bms-ble balancing'
[19:26:00][C][basen_bms_ble:487]: Charging 'basen-bms-ble charging'
[19:26:00][C][basen_bms_ble:488]: Discharging 'basen-bms-ble discharging'
[19:26:00][C][basen_bms_ble:490]: Total voltage 'basen-bms-ble total voltage'
[19:26:00][C][basen_bms_ble:490]:   Device Class: 'voltage'
[19:26:00][C][basen_bms_ble:490]:   State Class: 'measurement'
[19:26:00][C][basen_bms_ble:490]:   Unit of Measurement: 'V'
[19:26:00][C][basen_bms_ble:490]:   Accuracy Decimals: 3
[19:26:00][C][basen_bms_ble:491]: Current 'basen-bms-ble current'
[19:26:00][C][basen_bms_ble:491]:   Device Class: 'current'
[19:26:00][C][basen_bms_ble:491]:   State Class: 'measurement'
[19:26:00][C][basen_bms_ble:491]:   Unit of Measurement: 'A'
[19:26:00][C][basen_bms_ble:491]:   Accuracy Decimals: 3
[19:26:00][C][basen_bms_ble:491]:   Icon: 'mdi:current-dc'
[19:26:00][C][basen_bms_ble:492]: Power 'basen-bms-ble power'
[19:26:00][C][basen_bms_ble:492]:   Device Class: 'power'
[19:26:00][C][basen_bms_ble:492]:   State Class: 'measurement'
[19:26:00][C][basen_bms_ble:492]:   Unit of Measurement: 'W'
[19:26:00][C][basen_bms_ble:492]:   Accuracy Decimals: 2
[19:26:00][C][basen_bms_ble:493]: Charging power 'basen-bms-ble charging power'
[19:26:00][C][basen_bms_ble:493]:   Device Class: 'power'
[19:26:00][C][basen_bms_ble:493]:   State Class: 'measurement'
[19:26:00][C][basen_bms_ble:493]:   Unit of Measurement: 'W'
[19:26:00][C][basen_bms_ble:493]:   Accuracy Decimals: 2
[19:26:00][C][basen_bms_ble:494]: Discharging power 'basen-bms-ble discharging power'
[19:26:00][C][basen_bms_ble:494]:   Device Class: 'power'
[19:26:00][C][basen_bms_ble:494]:   State Class: 'measurement'
[19:26:00][C][basen_bms_ble:494]:   Unit of Measurement: 'W'
[19:26:00][C][basen_bms_ble:494]:   Accuracy Decimals: 2
[19:26:00][C][basen_bms_ble:495]: Capacity remaining 'basen-bms-ble capacity remaining'
[19:26:00][C][basen_bms_ble:495]:   State Class: 'measurement'
[19:26:00][C][basen_bms_ble:495]:   Unit of Measurement: 'Ah'
[19:26:00][C][basen_bms_ble:495]:   Accuracy Decimals: 3
[19:26:00][C][basen_bms_ble:495]:   Icon: 'mdi:battery-50'
[19:26:00][C][basen_bms_ble:496]: Charging states bitmask 'basen-bms-ble charging states bitmask'
[19:26:00][C][basen_bms_ble:496]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:496]:   Unit of Measurement: ''
[19:26:01][C][basen_bms_ble:496]:   Accuracy Decimals: 0
[19:26:01][C][basen_bms_ble:496]:   Icon: 'mdi:alert-circle-outline'
[19:26:01][C][basen_bms_ble:497]: Discharging states bitmask 'basen-bms-ble discharging states bitmask'
[19:26:01][C][basen_bms_ble:497]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:497]:   Unit of Measurement: ''
[19:26:01][C][basen_bms_ble:497]:   Accuracy Decimals: 0
[19:26:01][C][basen_bms_ble:497]:   Icon: 'mdi:alert-circle-outline'
[19:26:01][C][basen_bms_ble:498]: Charging warnings bitmask 'basen-bms-ble charging warnings bitmask'
[19:26:01][C][basen_bms_ble:498]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:498]:   Unit of Measurement: ''
[19:26:01][C][basen_bms_ble:498]:   Accuracy Decimals: 0
[19:26:01][C][basen_bms_ble:498]:   Icon: 'mdi:alert-circle-outline'
[19:26:01][C][basen_bms_ble:499]: Discharging warnings bitmask 'basen-bms-ble discharging warnings bitmask'
[19:26:01][C][basen_bms_ble:499]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:499]:   Unit of Measurement: ''
[19:26:01][C][basen_bms_ble:499]:   Accuracy Decimals: 0
[19:26:01][C][basen_bms_ble:499]:   Icon: 'mdi:alert-circle-outline'
[19:26:01][C][basen_bms_ble:500]: State of charge 'basen-bms-ble state of charge'
[19:26:01][C][basen_bms_ble:500]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:500]:   Unit of Measurement: '%'
[19:26:01][C][basen_bms_ble:500]:   Accuracy Decimals: 0
[19:26:01][C][basen_bms_ble:500]:   Icon: 'mdi:battery-50'
[19:26:01][C][basen_bms_ble:501]: Nominal capacity 'basen-bms-ble nominal capacity'
[19:26:01][C][basen_bms_ble:501]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:501]:   Unit of Measurement: 'Ah'
[19:26:01][C][basen_bms_ble:501]:   Accuracy Decimals: 3
[19:26:01][C][basen_bms_ble:501]:   Icon: 'mdi:battery-50'
[19:26:01][C][basen_bms_ble:502]: Nominal voltage 'basen-bms-ble nominal voltage'
[19:26:01][C][basen_bms_ble:502]:   Device Class: 'voltage'
[19:26:01][C][basen_bms_ble:502]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:502]:   Unit of Measurement: 'V'
[19:26:01][C][basen_bms_ble:502]:   Accuracy Decimals: 3
[19:26:01][C][basen_bms_ble:503]: Real capacity 'basen-bms-ble real capacity'
[19:26:01][C][basen_bms_ble:503]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:503]:   Unit of Measurement: 'Ah'
[19:26:01][C][basen_bms_ble:503]:   Accuracy Decimals: 3
[19:26:01][C][basen_bms_ble:503]:   Icon: 'mdi:battery-high'
[19:26:01][C][basen_bms_ble:504]: Serial number 'basen-bms-ble serial number'
[19:26:01][C][basen_bms_ble:504]:   State Class: ''
[19:26:01][C][basen_bms_ble:504]:   Unit of Measurement: ''
[19:26:01][C][basen_bms_ble:504]:   Accuracy Decimals: 0
[19:26:01][C][basen_bms_ble:504]:   Icon: 'mdi:numeric'
[19:26:01][C][basen_bms_ble:505]: Charging cycles 'basen-bms-ble charging cycles'
[19:26:01][C][basen_bms_ble:505]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:505]:   Unit of Measurement: ''
[19:26:01][C][basen_bms_ble:505]:   Accuracy Decimals: 0
[19:26:01][C][basen_bms_ble:505]:   Icon: 'mdi:battery-sync'
[19:26:01][C][basen_bms_ble:506]: Min cell voltage 'basen-bms-ble min cell voltage'
[19:26:01][C][basen_bms_ble:506]:   Device Class: 'voltage'
[19:26:01][C][basen_bms_ble:506]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:506]:   Unit of Measurement: 'V'
[19:26:01][C][basen_bms_ble:506]:   Accuracy Decimals: 3
[19:26:01][C][basen_bms_ble:506]:   Icon: 'mdi:battery-minus-outline'
[19:26:01][C][basen_bms_ble:507]: Max cell voltage 'basen-bms-ble max cell voltage'
[19:26:01][C][basen_bms_ble:507]:   Device Class: 'voltage'
[19:26:01][C][basen_bms_ble:507]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:507]:   Unit of Measurement: 'V'
[19:26:01][C][basen_bms_ble:507]:   Accuracy Decimals: 3
[19:26:01][C][basen_bms_ble:507]:   Icon: 'mdi:battery-plus-outline'
[19:26:01][C][basen_bms_ble:508]: Min voltage cell 'basen-bms-ble min voltage cell'
[19:26:01][C][basen_bms_ble:508]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:508]:   Unit of Measurement: ''
[19:26:01][C][basen_bms_ble:508]:   Accuracy Decimals: 0
[19:26:01][C][basen_bms_ble:508]:   Icon: 'mdi:battery-minus-outline'
[19:26:01][C][basen_bms_ble:509]: Max voltage cell 'basen-bms-ble max voltage cell'
[19:26:01][C][basen_bms_ble:509]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:509]:   Unit of Measurement: ''
[19:26:01][C][basen_bms_ble:509]:   Accuracy Decimals: 0
[19:26:01][C][basen_bms_ble:509]:   Icon: 'mdi:battery-plus-outline'
[19:26:01][C][basen_bms_ble:510]: Delta cell voltage 'basen-bms-ble delta cell voltage'
[19:26:01][C][basen_bms_ble:510]:   Device Class: 'voltage'
[19:26:01][C][basen_bms_ble:510]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:510]:   Unit of Measurement: 'V'
[19:26:01][C][basen_bms_ble:510]:   Accuracy Decimals: 4
[19:26:01][C][basen_bms_ble:511]: Temperature 1 'basen-bms-ble temperature 1'
[19:26:01][C][basen_bms_ble:511]:   Device Class: 'temperature'
[19:26:01][C][basen_bms_ble:511]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:511]:   Unit of Measurement: '°C'
[19:26:01][C][basen_bms_ble:511]:   Accuracy Decimals: 0
[19:26:01][C][basen_bms_ble:512]: Temperature 2 'basen-bms-ble temperature 2'
[19:26:01][C][basen_bms_ble:512]:   Device Class: 'temperature'
[19:26:01][C][basen_bms_ble:512]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:512]:   Unit of Measurement: '°C'
[19:26:01][C][basen_bms_ble:512]:   Accuracy Decimals: 0
[19:26:01][C][basen_bms_ble:513]: Temperature 3 'basen-bms-ble temperature 3'
[19:26:01][C][basen_bms_ble:513]:   Device Class: 'temperature'
[19:26:01][C][basen_bms_ble:513]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:513]:   Unit of Measurement: '°C'
[19:26:01][C][basen_bms_ble:513]:   Accuracy Decimals: 0
[19:26:01][C][basen_bms_ble:514]: Temperature 4 'basen-bms-ble temperature 4'
[19:26:01][C][basen_bms_ble:514]:   Device Class: 'temperature'
[19:26:01][C][basen_bms_ble:514]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:514]:   Unit of Measurement: '°C'
[19:26:01][C][basen_bms_ble:514]:   Accuracy Decimals: 0
[19:26:01][C][basen_bms_ble:515]: Cell Voltage 1 'basen-bms-ble cell voltage 1'
[19:26:01][C][basen_bms_ble:515]:   Device Class: 'voltage'
[19:26:01][C][basen_bms_ble:515]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:515]:   Unit of Measurement: 'V'
[19:26:01][C][basen_bms_ble:515]:   Accuracy Decimals: 3
[19:26:01][C][basen_bms_ble:516]: Cell Voltage 2 'basen-bms-ble cell voltage 2'
[19:26:01][C][basen_bms_ble:516]:   Device Class: 'voltage'
[19:26:01][C][basen_bms_ble:516]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:516]:   Unit of Measurement: 'V'
[19:26:01][C][basen_bms_ble:516]:   Accuracy Decimals: 3
[19:26:01][C][basen_bms_ble:517]: Cell Voltage 3 'basen-bms-ble cell voltage 3'
[19:26:01][C][basen_bms_ble:517]:   Device Class: 'voltage'
[19:26:01][C][basen_bms_ble:517]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:517]:   Unit of Measurement: 'V'
[19:26:01][C][basen_bms_ble:517]:   Accuracy Decimals: 3
[19:26:01][C][basen_bms_ble:518]: Cell Voltage 4 'basen-bms-ble cell voltage 4'
[19:26:01][C][basen_bms_ble:518]:   Device Class: 'voltage'
[19:26:01][C][basen_bms_ble:518]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:518]:   Unit of Measurement: 'V'
[19:26:01][C][basen_bms_ble:518]:   Accuracy Decimals: 3
[19:26:01][C][basen_bms_ble:519]: Cell Voltage 5 'basen-bms-ble cell voltage 5'
[19:26:01][C][basen_bms_ble:519]:   Device Class: 'voltage'
[19:26:01][C][basen_bms_ble:519]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:519]:   Unit of Measurement: 'V'
[19:26:01][C][basen_bms_ble:519]:   Accuracy Decimals: 3
[19:26:01][C][basen_bms_ble:520]: Cell Voltage 6 'basen-bms-ble cell voltage 6'
[19:26:01][C][basen_bms_ble:520]:   Device Class: 'voltage'
[19:26:01][C][basen_bms_ble:520]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:520]:   Unit of Measurement: 'V'
[19:26:01][C][basen_bms_ble:520]:   Accuracy Decimals: 3
[19:26:01][C][basen_bms_ble:521]: Cell Voltage 7 'basen-bms-ble cell voltage 7'
[19:26:01][C][basen_bms_ble:521]:   Device Class: 'voltage'
[19:26:01][C][basen_bms_ble:521]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:521]:   Unit of Measurement: 'V'
[19:26:01][C][basen_bms_ble:521]:   Accuracy Decimals: 3
[19:26:01][C][basen_bms_ble:522]: Cell Voltage 8 'basen-bms-ble cell voltage 8'
[19:26:01][C][basen_bms_ble:522]:   Device Class: 'voltage'
[19:26:01][C][basen_bms_ble:522]:   State Class: 'measurement'
[19:26:01][C][basen_bms_ble:522]:   Unit of Measurement: 'V'
[19:26:01][C][basen_bms_ble:522]:   Accuracy Decimals: 3
[19:26:01][C][basen_bms_ble:550]: Charging states 'basen-bms-ble charging states'
[19:26:01][C][basen_bms_ble:550]:   Icon: 'mdi:alert-circle-outline'
[19:26:01][C][basen_bms_ble:551]: Discharging states 'basen-bms-ble discharging states'
[19:26:01][C][basen_bms_ble:551]:   Icon: 'mdi:alert-circle-outline'
[19:26:01][C][basen_bms_ble:552]: Charging warnings 'basen-bms-ble charging warnings'
[19:26:01][C][basen_bms_ble:552]:   Icon: 'mdi:alert-circle-outline'
[19:26:01][C][basen_bms_ble:553]: Discharging warnings 'basen-bms-ble discharging warnings'
[19:26:01][C][basen_bms_ble:553]:   Icon: 'mdi:alert-circle-outline'
[19:26:01][V][wifi_esp32:651]: Event: Got IPv6 address=fe80:0000:0000:0000:ae67:b2ff:fef9:cda8
[19:26:01][C][ble_switch:076]: BLE Client Switch 'basen-bms-ble enable bluetooth connection'
[19:26:01][C][ble_switch:078]:   Icon: 'mdi:bluetooth'
[19:26:01][C][ble_switch:099]:   Restore Mode: restore defaults to OFF
[19:26:01][C][basen_bms_ble.switch:076]: BasenBmsBle Switch 'basen-bms-ble charging'
[19:26:01][C][basen_bms_ble.switch:078]:   Icon: 'mdi:battery-charging-50'
[19:26:01][C][basen_bms_ble.switch:099]:   Restore Mode: restore defaults to OFF
[19:26:01][C][basen_bms_ble.switch:076]: BasenBmsBle Switch 'basen-bms-ble discharging'
[19:26:01][C][basen_bms_ble.switch:078]:   Icon: 'mdi:battery-charging-50'
[19:26:01][C][basen_bms_ble.switch:099]:   Restore Mode: restore defaults to OFF
[19:26:01][C][esp32_ble:214]: ESP32 BLE:
[19:26:01][C][esp32_ble_tracker:583]: BLE Tracker:
[19:26:01][C][esp32_ble_tracker:584]:   Scan Duration: 300 s
[19:26:01][C][esp32_ble_tracker:585]:   Scan Interval: 320.0 ms
[19:26:01][C][esp32_ble_tracker:586]:   Scan Window: 30.0 ms
[19:26:02][C][esp32_ble_tracker:587]:   Scan Type: ACTIVE
[19:26:02][C][esp32_ble_tracker:588]:   Continuous Scanning: True
[19:26:02][C][ble_client:027]: BLE Client:
[19:26:02][C][ble_client:028]:   Address: A4:C1:38:27:48:9A
[19:26:02][C][mdns:108]: mDNS:
[19:26:02][C][mdns:109]:   Hostname: basen-bms-ble
[19:26:02][V][mdns:110]:   Services:
[19:26:02][V][mdns:112]:   - _esphomelib, _tcp, 6053
[19:26:02][V][mdns:114]:     TXT: version = 2023.2.4
[19:26:02][V][mdns:114]:     TXT: mac = ac67b2f9cda8
[19:26:02][V][mdns:114]:     TXT: platform = ESP32
[19:26:02][V][mdns:114]:     TXT: board = esp32dev
[19:26:02][V][mdns:114]:     TXT: network = wifi
[19:26:02][V][mdns:114]:     TXT: project_name = syssi.esphome-basen-bms
[19:26:02][V][mdns:114]:     TXT: project_version = 1.3.0
[19:26:02][C][ota:093]: Over-The-Air Updates:
[19:26:02][C][ota:094]:   Address: basen-bms-ble.local:3232
[19:26:02][C][api:138]: API Server:
[19:26:02][C][api:139]:   Address: basen-bms-ble.local:6053
[19:26:02][C][api:143]:   Using noise encryption: NO
[19:26:02][W][basen_bms_ble:242]: [A4:C1:38:27:48:9A] Not connected
[19:26:04][W][basen_bms_ble:242]: [A4:C1:38:27:48:9A] Not connected
[19:26:06][W][basen_bms_ble:242]: [A4:C1:38:27:48:9A] Not connected
[19:26:08][D][esp32_ble_client:048]: [0] [A4:C1:38:27:48:9A] Found device
[19:26:08][D][esp32_ble_tracker:206]: Pausing scan to make connection...
[19:26:08][D][esp32_ble_tracker:206]: Pausing scan to make connection...
[19:26:08][VV][esp-idf:000]: E (18097) BT_BTM: BTM_BleScan scan not active
[19:26:08][VV][esp-idf:000]: W (18099) BT_APPL:  bta_dm_ble_scan stop scan failed, status=0x6
[19:26:08][I][esp32_ble_client:064]: [0] [A4:C1:38:27:48:9A] 0x00 Attempting BLE connection
[19:26:08][W][basen_bms_ble:242]: [A4:C1:38:27:48:9A] Not connected
[19:26:09][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=40 gattc_if=3
[19:26:09][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=2 gattc_if=3
[19:26:09][V][esp32_ble_client:126]: [0] [A4:C1:38:27:48:9A] ESP_GATTC_OPEN_EVT
[19:26:10][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=46 gattc_if=3
[19:26:10][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=7 gattc_if=3
[19:26:10][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=7 gattc_if=3
[19:26:10][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=7 gattc_if=3
[19:26:10][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=7 gattc_if=3
[19:26:10][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=6 gattc_if=3
[19:26:10][V][esp32_ble_client:186]: [0] [A4:C1:38:27:48:9A] ESP_GATTC_SEARCH_CMPL_EVT
[19:26:10][V][esp32_ble_client:189]: [0] [A4:C1:38:27:48:9A] Service UUID: 0x1800
[19:26:10][V][esp32_ble_client:191]: [0] [A4:C1:38:27:48:9A]  start_handle: 0x1  end_handle: 0x7
[19:26:10][V][esp32_ble_client:189]: [0] [A4:C1:38:27:48:9A] Service UUID: 0x1801
[19:26:10][V][esp32_ble_client:191]: [0] [A4:C1:38:27:48:9A]  start_handle: 0x8  end_handle: 0xb
[19:26:10][V][esp32_ble_client:189]: [0] [A4:C1:38:27:48:9A] Service UUID: 0x180A
[19:26:10][V][esp32_ble_client:191]: [0] [A4:C1:38:27:48:9A]  start_handle: 0xc  end_handle: 0xe
[19:26:10][V][esp32_ble_client:189]: [0] [A4:C1:38:27:48:9A] Service UUID: 0xFA00
[19:26:10][V][esp32_ble_client:191]: [0] [A4:C1:38:27:48:9A]  start_handle: 0xf  end_handle: 0x16
[19:26:10][I][esp32_ble_client:193]: [0] [A4:C1:38:27:48:9A] Connected
[19:26:10][V][esp32_ble_client:069]: [0] [A4:C1:38:27:48:9A]  characteristic 0xFA01, handle 0x11, properties 0x12
[19:26:10][V][esp32_ble_client:069]: [0] [A4:C1:38:27:48:9A]  characteristic 0xFA02, handle 0x15, properties 0x6
[19:26:10][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=18 gattc_if=3
[19:26:10][V][esp32_ble_client:157]: [0] [A4:C1:38:27:48:9A] cfg_mtu status 0, mtu 23
[19:26:10][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=38 gattc_if=3
[19:26:10][V][basen_bms_ble:604]: Send command (handle 0x15): 3B.16.2A.<IP_ADDRESS>.0D.0A (9)
[19:26:10][D][esp32_ble_tracker:238]: Starting scan...
[19:26:10][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=9 gattc_if=3
[19:26:10][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[19:26:10][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[19:26:10][VV][basen_bms_ble:161]: Notification received (handle 0x11): 3B.16.2A.18.62.E8.FF.FF.FB.<IP_ADDRESS>.<IP_ADDRESS>.9E.00.00 (20)
[19:26:10][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[19:26:10][VV][basen_bms_ble:161]: Notification received (handle 0x11): <IP_ADDRESS>.<IP_ADDRESS>.51.07.0D.0A (12)
[19:26:10][I][basen_bms_ble:286]: Status frame (28+4 bytes):
[19:26:10][D][basen_bms_ble:287]:   3B.16.2A.18.62.E8.FF.FF.FB.<IP_ADDRESS>.<IP_ADDRESS>.9E.<IP_ADDRESS>.<IP_ADDRESS>.00.00 (28)
[19:26:10][D][sensor:127]: 'basen-bms-ble current': Sending state -6.04600 A with 3 decimals of accuracy
[19:26:10][D][sensor:127]: 'basen-bms-ble total voltage': Sending state 26.10700 V with 3 decimals of accuracy
[19:26:10][D][sensor:127]: 'basen-bms-ble temperature 1': Sending state 20.00000 °C with 0 decimals of accuracy
[19:26:10][D][sensor:127]: 'basen-bms-ble temperature 2': Sending state 21.00000 °C with 0 decimals of accuracy
[19:26:10][D][sensor:127]: 'basen-bms-ble temperature 3': Sending state 25.00000 °C with 0 decimals of accuracy
[19:26:10][D][sensor:127]: 'basen-bms-ble temperature 4': Sending state 25.00000 °C with 0 decimals of accuracy
[19:26:10][D][sensor:127]: 'basen-bms-ble capacity remaining': Sending state 40.49600 Ah with 3 decimals of accuracy
[19:26:10][D][sensor:127]: 'basen-bms-ble charging states bitmask': Sending state 128.00000  with 0 decimals of accuracy
[19:26:10][V][text_sensor:016]: 'basen-bms-ble charging states': Received new state Charging MOS (CHG)
[19:26:10][D][text_sensor:067]: 'basen-bms-ble charging states': Sending state 'Charging MOS (CHG)'
[19:26:10][D][binary_sensor:036]: 'basen-bms-ble charging': Sending state ON
[19:26:10][D][switch:056]: 'basen-bms-ble charging': Sending state ON
[19:26:10][D][sensor:127]: 'basen-bms-ble discharging states bitmask': Sending state 128.00000  with 0 decimals of accuracy
[19:26:10][V][text_sensor:016]: 'basen-bms-ble discharging states': Received new state Discharging MOS (DSG)
[19:26:10][D][text_sensor:067]: 'basen-bms-ble discharging states': Sending state 'Discharging MOS (DSG)'
[19:26:10][D][binary_sensor:036]: 'basen-bms-ble discharging': Sending state ON
[19:26:10][D][switch:056]: 'basen-bms-ble discharging': Sending state ON
[19:26:10][D][sensor:127]: 'basen-bms-ble charging warnings bitmask': Sending state 0.00000  with 0 decimals of accuracy
[19:26:10][V][text_sensor:016]: 'basen-bms-ble charging warnings': Received new state
[19:26:10][D][text_sensor:067]: 'basen-bms-ble charging warnings': Sending state ''
[19:26:10][D][sensor:127]: 'basen-bms-ble charging warnings bitmask': Sending state 0.00000  with 0 decimals of accuracy
[19:26:10][V][text_sensor:016]: 'basen-bms-ble charging warnings': Received new state
[19:26:10][D][text_sensor:067]: 'basen-bms-ble charging warnings': Sending state ''
[19:26:10][D][sensor:127]: 'basen-bms-ble state of charge': Sending state 38.00000 % with 0 decimals of accuracy
[19:26:10][V][basen_bms_ble:604]: Send command (handle 0x15): 3A.16.2A.<IP_ADDRESS>.0D.0A (9)
[19:26:10][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[19:26:10][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[19:26:10][VV][basen_bms_ble:161]: Notification received (handle 0x11): 3A.16.2A.18.62.E8.FF.FF.F<IP_ADDRESS>.<IP_ADDRESS>.30.9E.00.00 (20)
[19:26:11][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[19:26:11][VV][basen_bms_ble:161]: Notification received (handle 0x11): <IP_ADDRESS>.<IP_ADDRESS>.4D.07.0D.0A (12)
[19:26:11][I][basen_bms_ble:286]: Status frame (28+4 bytes):
[19:26:11][D][basen_bms_ble:287]:   3A.16.2A.18.62.E8.FF.FF.F<IP_ADDRESS>.<IP_ADDRESS>.30.9E.<IP_ADDRESS>.<IP_ADDRESS>.00.00 (28)
[19:26:11][D][sensor:127]: 'basen-bms-ble current': Sending state -6.04600 A with 3 decimals of accuracy
[19:26:11][D][sensor:127]: 'basen-bms-ble total voltage': Sending state 26.10300 V with 3 decimals of accuracy
[19:26:11][D][sensor:127]: 'basen-bms-ble temperature 1': Sending state 20.00000 °C with 0 decimals of accuracy
[19:26:11][D][sensor:127]: 'basen-bms-ble temperature 2': Sending state 21.00000 °C with 0 decimals of accuracy
[19:26:11][D][sensor:127]: 'basen-bms-ble temperature 3': Sending state 25.00000 °C with 0 decimals of accuracy
[19:26:11][D][sensor:127]: 'basen-bms-ble temperature 4': Sending state 25.00000 °C with 0 decimals of accuracy
[19:26:11][D][sensor:127]: 'basen-bms-ble capacity remaining': Sending state 40.49600 Ah with 3 decimals of accuracy
[19:26:11][D][sensor:127]: 'basen-bms-ble charging states bitmask': Sending state 128.00000  with 0 decimals of accuracy
[19:26:11][V][text_sensor:016]: 'basen-bms-ble charging states': Received new state Charging MOS (CHG)
[19:26:11][D][text_sensor:067]: 'basen-bms-ble charging states': Sending state 'Charging MOS (CHG)'
[19:26:11][D][sensor:127]: 'basen-bms-ble discharging states bitmask': Sending state 128.00000  with 0 decimals of accuracy
[19:26:11][V][text_sensor:016]: 'basen-bms-ble discharging states': Received new state Discharging MOS (DSG)
[19:26:11][D][text_sensor:067]: 'basen-bms-ble discharging states': Sending state 'Discharging MOS (DSG)'
[19:26:11][D][sensor:127]: 'basen-bms-ble charging warnings bitmask': Sending state 0.00000  with 0 decimals of accuracy
[19:26:11][V][text_sensor:016]: 'basen-bms-ble charging warnings': Received new state
[19:26:11][D][text_sensor:067]: 'basen-bms-ble charging warnings': Sending state ''
[19:26:11][D][sensor:127]: 'basen-bms-ble charging warnings bitmask': Sending state 0.00000  with 0 decimals of accuracy
[19:26:11][V][text_sensor:016]: 'basen-bms-ble charging warnings': Received new state
[19:26:11][D][text_sensor:067]: 'basen-bms-ble charging warnings': Sending state ''
[19:26:11][D][sensor:127]: 'basen-bms-ble state of charge': Sending state 38.00000 % with 0 decimals of accuracy
[19:26:12][V][basen_bms_ble:604]: Send command (handle 0x15): 3A.16.2B.<IP_ADDRESS>.0D.0A (9)
[19:26:12][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[19:26:12][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[19:26:12][VV][basen_bms_ble:161]: Notification received (handle 0x11): 3A.16.2B.18.A<IP_ADDRESS>.<IP_ADDRESS>.9C.A<IP_ADDRESS>.00.00.00 (20)
[19:26:12][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[19:26:12][VV][basen_bms_ble:161]: Notification received (handle 0x11): <IP_ADDRESS>.<IP_ADDRESS>.9C.04.0D.0A (12)
[19:26:12][I][basen_bms_ble:351]: General info frame (28+4 bytes):
[19:26:12][D][basen_bms_ble:352]:   3A.16.2B.18.A<IP_ADDRESS>.<IP_ADDRESS>.9C.A<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.53.12.00 (28)
[19:26:12][D][sensor:127]: 'basen-bms-ble nominal capacity': Sending state 100.00001 Ah with 3 decimals of accuracy
[19:26:12][D][sensor:127]: 'basen-bms-ble nominal voltage': Sending state 25.60000 V with 3 decimals of accuracy
[19:26:12][D][sensor:127]: 'basen-bms-ble real capacity': Sending state 106.65201 Ah with 3 decimals of accuracy
[19:26:12][D][sensor:127]: 'basen-bms-ble serial number': Sending state<PHONE_NUMBER>.00000  with 0 decimals of accuracy
[19:26:12][I][basen_bms_ble:379]:   Manufacturing date: 2021.11.17
[19:26:12][D][sensor:127]: 'basen-bms-ble charging cycles': Sending state 775159808.00000  with 0 decimals of accuracy
[19:26:14][V][basen_bms_ble:604]: Send command (handle 0x15): 3A.<IP_ADDRESS>.3B.00.0D.0A (9)
[19:26:14][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=4 gattc_if=3
[19:26:14][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[19:26:14][VV][basen_bms_ble:161]: Notification received (handle 0x11): 3A.16.24.18.BE.0C.BE.0C.C0.0C.BE.0C.BE.0C.C0.0C.C0.0C.BF.0C (20)
[19:26:14][V][esp32_ble_client:111]: [0] [A4:C1:38:27:48:9A] gattc_event_handler: event=10 gattc_if=3
[19:26:14][VV][basen_bms_ble:161]: Notification received (handle 0x11): <IP_ADDRESS>.<IP_ADDRESS>.A9.06.0D.0A (12)
[19:26:14][I][basen_bms_ble:398]: Cell voltages frame (chunk 0, 28+4 bytes):
[19:26:14][D][basen_bms_ble:399]:   3A.16.24.18.BE.0C.BE.0C.C0.0C.BE.0C.BE.0C.C0.0C.C0.0C.BF.0C.<IP_ADDRESS>.<IP_ADDRESS> (28)
[19:26:14][D][sensor:127]: 'basen-bms-ble cell voltage 1': Sending state 3.26200 V with 3 decimals of accuracy
[19:26:14][D][sensor:127]: 'basen-bms-ble cell voltage 2': Sending state 3.26200 V with 3 decimals of accuracy
[19:26:14][D][sensor:127]: 'basen-bms-ble cell voltage 3': Sending state 3.26400 V with 3 decimals of accuracy
[19:26:14][D][sensor:127]: 'basen-bms-ble cell voltage 4': Sending state 3.26200 V with 3 decimals of accuracy
[19:26:14][D][sensor:127]: 'basen-bms-ble cell voltage 5': Sending state 3.26200 V with 3 decimals of accuracy
[19:26:14][D][sensor:127]: 'basen-bms-ble cell voltage 6': Sending state 3.26400 V with 3 decimals of accuracy
[19:26:14][D][sensor:127]: 'basen-bms-ble cell voltage 7': Sending state 3.26400 V with 3 decimals of accuracy
[19:26:14][D][sensor:127]: 'basen-bms-ble cell voltage 8': Sending state 3.26300 V with 3 decimals of accuracy
[19:26:14][D][sensor:127]: 'basen-bms-ble min cell voltage': Sending state 3.26200 V with 3 decimals of accuracy
[19:26:14][D][sensor:127]: 'basen-bms-ble max cell voltage': Sending state 3.26400 V with 3 decimals of accuracy
[19:26:14][D][sensor:127]: 'basen-bms-ble max voltage cell': Sending state 3.00000  with 0 decimals of accuracy
[19:26:14][D][sensor:127]: 'basen-bms-ble min voltage cell': Sending state 1.00000  with 0 decimals of accuracy
[19:26:14][D][sensor:127]: 'basen-bms-ble delta cell voltage': Sending state 0.00200 V with 4 decimals of accuracy

Charging cycles sollte 17 sein (oder max. 18 wenn er schon wieder hochgezählt hat)
Delta cell voltage springt zwischen -100V und dem korrekten Wert, ebenso max cell voltage, max voltage cell, min cell voltage, min voltage cell
serial number lt. app "0"
Die Werte sind immer mal wieder "not available", aber im Großen und Ganzen schon sehr fein!

Charging cycles sollte 17 sein (oder max. 18 wenn er schon wieder hochgezählt hat)

fixed.

Delta cell voltage springt zwischen -100V und dem korrekten Wert, ebenso max cell voltage, max voltage cell, min cell voltage, min voltage cell

It's broken. I've to think about it. Please track this issue: #8

serial number lt. app "0"

fixed.

Die Werte sind immer mal wieder "not available", aber im Großen und Ganzen schon sehr fein!

Please decrease the log level by removing the full logger section and add this line instead:
logger:

Ich würde "remaining capacity" mit einer Nachkommastelle und "total voltage" mit 2 Nachkommastellen angeben

The resolution of the BMS are 3 decimals but this can be reducated per sensor:
sensor:
  - platform: basen_bms_ble
    total_voltage:
      name: "${name} total voltage"
      accuracy_decimals: 2
    capacity_remaining:
      name: "${name} capacity remaining"
      accuracy_decimals: 0

ich würde die Temperaturen mit 1 Nachkommastelle angeben (oder gibt es nur ganzzahlige Werte?)

The temperature values doesn't have decimals. If you like a permanent .0 or .00 you could use:
    temperature_1:
      name: "${name} temperature 1"
      accuracy_decimals: 2

PS: reducing logging level did fix the availabilty problems. I've added "bluetooth_proxy:" so my XIAOMI BT thermometers are proxied into HA (the EPS32 was used for that purpose before; nice to have another function added)

I've another question: At your screenshot of the single cell voltages view one cell is colored orange. Is this a balancing indicator or what's the meaning of the color?

I think so, but there is no documentation to verify.

Found some documentation: https://manuals.plus/weimei/vip-bms-ble01-bluetooth-module-manual
http://www.vip-bms.com/en.html#page2
But not very usefull... even tried in chinese with google translate

To clean up your setup please remove all cell voltages sensor above 8 from the YAML and compile + flash again. This will reduce the number of entities and avoids publishing sensor measurements with zeros.

Did that already. Temp 3+4 are not connected on my battery, they constantly report 25°C. Worked flawley over night. Will do to BTsnoop later...
Am 26. Februar 2023 07:59:25 MEZ schrieb Sebastian Muszynski @.***>:

To clean up your setup please remove all cell voltages sensor above 8 from the YAML and compile + flash again. This will reduce the number of entities and avoids publishing sensor measurements with zeros.
--
Reply to this email directly or view it on GitHub:
https://github.com/syssi/esphome-basen-bms/issues/1#issuecomment-1445283086
You are receiving this because you were mentioned.
Message ID: @.***>

I've restructured the retrieval process: Once per update_interval all frame types are requested now. In the past one command per update_interval got executed. Could you try the updated version and adjust the update_interval to your needs?

If the new revision works for you I will prepare the first official release and close this issue. The most important tasks are done. Adding some controls is just sugar. Take your time doing the btsnoop capture. I've added some credits for your good job to the docs! :-)

My logs: http://filedump.to/download/6a503538fb7d4d04bdb893ef517a67cd/btsnoop_hci.log
I toggled DISCHARGE a few times, left it "off", then toggled CHARGE a few times, left it "on", then switched DISCHARGE "on"
It was not possible to switch CHARGE when DISCHARGE was on.
I've adjusted the update interval to 5 sec.

PS: looks very polished, great work, thank you so much, Sebastian, for making my China battery pack talk to HomeAssistant!

You are welcome! :-)

@mager33 The filedump.to service is broken (error 500). It looks like any uploaded file cannot be downloaded. Could you send the file via mail<EMAIL_ADDRESS>