patman15 / BMS_BLE-HA

This integration allows to monitor Bluetooth Low Energy (BLE) battery management systems (BMS) from within Home Assistant.
GNU Lesser General Public License v2.1
34 stars 8 forks source link

JiKong BMS timout during initialization #90

Open SkeLLLa opened 1 day ago

SkeLLLa commented 1 day ago

Checklist

Provide the type of BMS you used:

Jikong Smart BMS

Describe the issue

I've installed this integration in addition to batmon to see if it works. Initially it wasn't picking up battery at all, but eventually (maybe after upgrading to 1.9.1 and upgrading HA to latest version) I've received a notification that the battery was discovered.

So I've added the battery, however it failed during initialization step. I suspect that the problem is somewhere on my end, since batmon addon didn't work either. However if my debug info will help to make this integration better or fix some issues for other users, I'll be glad to help.

I also suspect that my BMS might not satisfy the requirement "(HW version >=11 required)", but didn't know how to check that.

I see that there's a timeout issue there, so might be it's possible to configure bigger timeout values somehow?

Reproduction steps

1. Add integration to HA, and enable debug logs
2. Wait until battery is discovered
3. Add the battery to integration
4. Battery starts initialization but fails with timeout error.

Debug logs

2024-11-17 12:24:36.248 DEBUG (MainThread) [custom_components.bms_ble] Setup of <ConfigEntry entry_id=01JCWNPAZRY0AZ2JZ2HE9BZJ7K version=1 domain=bms_ble title=12v420a state=ConfigEntryState.SETUP_IN_PROGRESS unique_id=C8:47:80:14:D0:C2>
2024-11-17 12:24:36.249 DEBUG (MainThread) [custom_components.bms_ble] Initializing coordinator for 12v420a (C8:47:80:14:D0:C2) as Jikong Smart BMS
2024-11-17 12:24:36.249 DEBUG (MainThread) [custom_components.bms_ble] device data: {'name': '12v420a', 'address': 'C8:47:80:14:D0:C2', 'rssi': -72, 'manufacturer_data': {2917: b'\x88\xa0\xc8G\x80\x14\xd0\xc2'}, 'service_data': {}, 'service_uuids': ['00001800-0000-1000-8000-00805f9b34fb', '00001801-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', '0000180f-0000-1000-8000-00805f9b34fb', '0000ffe0-0000-1000-8000-00805f9b34fb', 'f000ffc0-0451-4000-b000-000000000000'], 'source': 'DC:A6:32:DA:44:EC', 'advertisement': AdvertisementData(local_name='12v420a', manufacturer_data={2917: b'\x88\xa0\xc8G\x80\x14\xd0\xc2'}, service_uuids=['00001800-0000-1000-8000-00805f9b34fb', '00001801-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', '0000180f-0000-1000-8000-00805f9b34fb', '0000ffe0-0000-1000-8000-00805f9b34fb', 'f000ffc0-0451-4000-b000-000000000000'], rssi=-72), 'device': BLEDevice(C8:47:80:14:D0:C2, 12v420a), 'connectable': True, 'time': 4465821.940952145, 'tx_power': None}
2024-11-17 12:24:36.250 DEBUG (MainThread) [custom_components.bms_ble] 12v420a: BMS data update
2024-11-17 12:24:36.250 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] Connecting BMS (12v420a)
2024-11-17 12:24:36.251 DEBUG (MainThread) [bleak_retry_connector] C8:47:80:14:D0:C2 - C8:47:80:14:D0:C2: Connection attempt: 1
2024-11-17 12:24:39.971 DEBUG (MainThread) [bleak_retry_connector] C8:47:80:14:D0:C2 - C8:47:80:14:D0:C2: Connected after 1 attempts
2024-11-17 12:24:39.971 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a19-0000-1000-8000-00805f9b34fb (#40): ['read', 'notify']
2024-11-17 12:24:39.971 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a27-0000-1000-8000-00805f9b34fb (#27): ['read']
2024-11-17 12:24:39.972 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a50-0000-1000-8000-00805f9b34fb (#37): ['read']
2024-11-17 12:24:39.972 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a28-0000-1000-8000-00805f9b34fb (#31): ['read']
2024-11-17 12:24:39.972 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a2a-0000-1000-8000-00805f9b34fb (#35): ['read']
2024-11-17 12:24:39.973 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a25-0000-1000-8000-00805f9b34fb (#25): ['read']
2024-11-17 12:24:39.973 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a26-0000-1000-8000-00805f9b34fb (#29): ['read']
2024-11-17 12:24:39.973 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a23-0000-1000-8000-00805f9b34fb (#33): ['read']
2024-11-17 12:24:39.973 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a24-0000-1000-8000-00805f9b34fb (#23): ['read']
2024-11-17 12:24:39.973 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a29-0000-1000-8000-00805f9b34fb (#21): ['read']
2024-11-17 12:24:39.974 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 0000ffe1-0000-1000-8000-00805f9b34fb (#17): ['write-without-response', 'write', 'notify']
2024-11-17 12:24:39.974 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 0000ffe2-0000-1000-8000-00805f9b34fb (#15): ['write-without-response']
2024-11-17 12:24:39.974 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a05-0000-1000-8000-00805f9b34fb (#11): ['read', 'indicate']
2024-11-17 12:24:39.974 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered f000ffc2-0451-4000-b000-000000000000 (#48): ['write-without-response', 'write', 'notify']
2024-11-17 12:24:39.975 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered f000ffc1-0451-4000-b000-000000000000 (#44): ['write-without-response', 'write', 'notify']
2024-11-17 12:24:39.975 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a04-0000-1000-8000-00805f9b34fb (#8): ['read']
2024-11-17 12:24:39.975 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a01-0000-1000-8000-00805f9b34fb (#4): ['read', 'write']
2024-11-17 12:24:39.975 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a00-0000-1000-8000-00805f9b34fb (#2): ['read', 'write']
2024-11-17 12:24:39.976 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a02-0000-1000-8000-00805f9b34fb (#6): ['read']
2024-11-17 12:24:39.976 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Using characteristics handle #17 (notify), #17 (write)
2024-11-17 12:24:50.578 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) request cell info
2024-11-17 12:24:51.478 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Rx BLE data (start): bytearray(b'U\xaa\xeb\x90\x03\x98JK_B2A8S20P\x00\x00\x00\x00\x0011.XA\x00\x00\x0011.48\x00\x00\x00\xe4\xa7F\x00\x07\x00\x00\x0012v420a\x00\x00\x00\x00\x00\x00\x00\x00\x001234\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00240704\x00\x00404092C2262\x00000\x00Input Userdata\x00\x00140703\x00\x00\x00\x00')
2024-11-17 12:24:51.480 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Rx BLE data (cnt.): bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
2024-11-17 12:24:51.873 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Rx BLE data (cnt.): bytearray(b'\xfe\xf9\xff\xff\x1f-\x00\x02\x00\x00\x00\x00\x90\x1f\x00\x00\x00\x00\xc0\xd8\xe72\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00d\x00\x00\x00_\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
2024-11-17 12:24:52.265 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Rx BLE data (cnt.): bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfe\xbf!\x06\x00\x00\x00\x00\x00\x00\x00\x00\xcd')
2024-11-17 12:24:52.266 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Rx BLE data (cnt.): bytearray(b'\xaaU\x90\xeb\xc8\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00D')
2024-11-17 12:24:54.740 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Rx BLE data (start): bytearray(b'U\xaa\xeb\x90\x01\x98\xac\r\x00\x00(\n\x00\x00\xc2\x0b\x00\x00\x10\x0e\x00\x00z\r\x00\x00\n\x00\x00\x00\x84\r\x00\x00\xb8\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc4\t\x00\x00@\r\x03\x00\x1e\x00\x00\x00<\x00\x00\x00@\r\x03\x00,\x01\x00\x00<\x00\x00\x00<\x00\x00\x00\xd0\x07\x00\x00&\x02\x00\x00\xf4\x01\x00\x00&\x02\x00\x00\xf4\x01\x00\x00\x14\x00\x00\x002\x00\x00\x00\xe8\x03\x00\x00 \x03\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00')
2024-11-17 12:24:55.041 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Rx BLE data (cnt.): bytearray(b'\x00\x00\xa0h\x06\x00\xdc\x05\x00\x00\xe4\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
2024-11-17 12:25:01.768 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] Disconnected from BMS (12v420a)
2024-11-17 12:25:03.167 DEBUG (MainThread) [custom_components.bms_ble] 12v420a: device communication timed out
2024-11-17 12:25:03.167 DEBUG (MainThread) [custom_components.bms_ble] Finished fetching 12v420a data in 26.917 seconds (success: False)
2024-11-17 12:25:03.168 DEBUG (MainThread) [custom_components.bms_ble] 12v420a: shuting down BMS device
2024-11-17 12:25:22.161 DEBUG (MainThread) [custom_components.bms_ble] Setup of <ConfigEntry entry_id=01JCWNPAZRY0AZ2JZ2HE9BZJ7K version=1 domain=bms_ble title=12v420a state=ConfigEntryState.SETUP_IN_PROGRESS unique_id=C8:47:80:14:D0:C2>
2024-11-17 12:25:22.162 DEBUG (MainThread) [custom_components.bms_ble] Initializing coordinator for 12v420a (C8:47:80:14:D0:C2) as Jikong Smart BMS
2024-11-17 12:25:22.163 DEBUG (MainThread) [custom_components.bms_ble] device data: {'name': '12v420a', 'address': 'C8:47:80:14:D0:C2', 'rssi': -71, 'manufacturer_data': {2917: b'\x88\xa0\xc8G\x80\x14\xd0\xc2'}, 'service_data': {}, 'service_uuids': ['00001800-0000-1000-8000-00805f9b34fb', '00001801-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', '0000180f-0000-1000-8000-00805f9b34fb', '0000ffe0-0000-1000-8000-00805f9b34fb', 'f000ffc0-0451-4000-b000-000000000000'], 'source': 'DC:A6:32:DA:44:EC', 'advertisement': AdvertisementData(local_name='12v420a', manufacturer_data={2917: b'\x88\xa0\xc8G\x80\x14\xd0\xc2'}, service_uuids=['00001800-0000-1000-8000-00805f9b34fb', '00001801-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', '0000180f-0000-1000-8000-00805f9b34fb', '0000ffe0-0000-1000-8000-00805f9b34fb', 'f000ffc0-0451-4000-b000-000000000000'], rssi=-71), 'device': BLEDevice(C8:47:80:14:D0:C2, 12v420a), 'connectable': True, 'time': 4465870.600427386, 'tx_power': None}
2024-11-17 12:25:22.164 DEBUG (MainThread) [custom_components.bms_ble] 12v420a: BMS data update
2024-11-17 12:25:22.165 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] Connecting BMS (12v420a)
2024-11-17 12:25:22.165 DEBUG (MainThread) [bleak_retry_connector] C8:47:80:14:D0:C2 - C8:47:80:14:D0:C2: Connection attempt: 1
2024-11-17 12:25:24.836 DEBUG (MainThread) [bleak_retry_connector] C8:47:80:14:D0:C2 - C8:47:80:14:D0:C2: Connected after 1 attempts
2024-11-17 12:25:24.836 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a19-0000-1000-8000-00805f9b34fb (#40): ['read', 'notify']
2024-11-17 12:25:24.837 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a27-0000-1000-8000-00805f9b34fb (#27): ['read']
2024-11-17 12:25:24.837 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a50-0000-1000-8000-00805f9b34fb (#37): ['read']
2024-11-17 12:25:24.838 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a28-0000-1000-8000-00805f9b34fb (#31): ['read']
2024-11-17 12:25:24.838 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a2a-0000-1000-8000-00805f9b34fb (#35): ['read']
2024-11-17 12:25:24.838 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a25-0000-1000-8000-00805f9b34fb (#25): ['read']
2024-11-17 12:25:24.839 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a26-0000-1000-8000-00805f9b34fb (#29): ['read']
2024-11-17 12:25:24.839 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a23-0000-1000-8000-00805f9b34fb (#33): ['read']
2024-11-17 12:25:24.839 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a24-0000-1000-8000-00805f9b34fb (#23): ['read']
2024-11-17 12:25:24.840 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a29-0000-1000-8000-00805f9b34fb (#21): ['read']
2024-11-17 12:25:24.840 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 0000ffe1-0000-1000-8000-00805f9b34fb (#17): ['write-without-response', 'write', 'notify']
2024-11-17 12:25:24.840 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 0000ffe2-0000-1000-8000-00805f9b34fb (#15): ['write-without-response']
2024-11-17 12:25:24.841 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a05-0000-1000-8000-00805f9b34fb (#11): ['read', 'indicate']
2024-11-17 12:25:24.842 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered f000ffc2-0451-4000-b000-000000000000 (#48): ['write-without-response', 'write', 'notify']
2024-11-17 12:25:24.842 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered f000ffc1-0451-4000-b000-000000000000 (#44): ['write-without-response', 'write', 'notify']
2024-11-17 12:25:24.842 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a04-0000-1000-8000-00805f9b34fb (#8): ['read']
2024-11-17 12:25:24.842 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a01-0000-1000-8000-00805f9b34fb (#4): ['read', 'write']
2024-11-17 12:25:24.842 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a00-0000-1000-8000-00805f9b34fb (#2): ['read', 'write']
2024-11-17 12:25:24.843 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a02-0000-1000-8000-00805f9b34fb (#6): ['read']
2024-11-17 12:25:24.843 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Using characteristics handle #17 (notify), #17 (write)
2024-11-17 12:25:35.158 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) request cell info
2024-11-17 12:25:37.934 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Rx BLE data (start): bytearray(b'U\xaa\xeb\x90\x03\x9eJK_B2A8S20P\x00\x00\x00\x00\x0011.XA\x00\x00\x0011.48\x00\x00\x00\xe4\xa7F\x00\x07\x00\x00\x0012v420a\x00\x00\x00\x00\x00\x00\x00\x00\x001234\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00240704\x00\x00404092C2262\x00000\x00Input Userdata\x00\x00140703\x00\x00\x00\x00')
2024-11-17 12:25:38.027 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Rx BLE data (cnt.): bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
2024-11-17 12:25:41.497 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Rx BLE data (cnt.): bytearray(b'\xfe\xf9\xff\xff\x1f-\x00\x02\x00\x00\x00\x00\x90\x1f\x00\x00\x00\x00\xc0\xd8\xe72\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00d\x00\x00\x00_\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
2024-11-17 12:25:42.996 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Rx BLE data (cnt.): bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfe\xbf!\x06\x00\x00\x00\x00\x00\x00\x00\x00\xd3')
2024-11-17 12:25:43.877 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Rx BLE data (cnt.): bytearray(b'\xaaU\x90\xeb\xc8\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00D')
2024-11-17 12:25:52.391 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] Disconnected from BMS (12v420a)
2024-11-17 12:25:55.265 DEBUG (MainThread) [custom_components.bms_ble] 12v420a: device communication timed out
2024-11-17 12:25:55.266 DEBUG (MainThread) [custom_components.bms_ble] Finished fetching 12v420a data in 33.102 seconds (success: False)
2024-11-17 12:25:55.266 DEBUG (MainThread) [custom_components.bms_ble] 12v420a: shuting down BMS device
2024-11-17 12:26:00.683 DEBUG (MainThread) [custom_components.bms_ble] Setup of <ConfigEntry entry_id=01JCWNPAZRY0AZ2JZ2HE9BZJ7K version=1 domain=bms_ble title=12v420a state=ConfigEntryState.SETUP_IN_PROGRESS unique_id=C8:47:80:14:D0:C2>
2024-11-17 12:26:00.684 DEBUG (MainThread) [custom_components.bms_ble] Initializing coordinator for 12v420a (C8:47:80:14:D0:C2) as Jikong Smart BMS
2024-11-17 12:26:00.685 DEBUG (MainThread) [custom_components.bms_ble] device data: {'name': '12v420a', 'address': 'C8:47:80:14:D0:C2', 'rssi': -72, 'manufacturer_data': {2917: b'\x88\xa0\xc8G\x80\x14\xd0\xc2'}, 'service_data': {}, 'service_uuids': ['00001800-0000-1000-8000-00805f9b34fb', '00001801-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', '0000180f-0000-1000-8000-00805f9b34fb', '0000ffe0-0000-1000-8000-00805f9b34fb', 'f000ffc0-0451-4000-b000-000000000000'], 'source': 'DC:A6:32:DA:44:EC', 'advertisement': AdvertisementData(local_name='12v420a', manufacturer_data={2917: b'\x88\xa0\xc8G\x80\x14\xd0\xc2'}, service_uuids=['00001800-0000-1000-8000-00805f9b34fb', '00001801-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', '0000180f-0000-1000-8000-00805f9b34fb', '0000ffe0-0000-1000-8000-00805f9b34fb', 'f000ffc0-0451-4000-b000-000000000000'], rssi=-72), 'device': BLEDevice(C8:47:80:14:D0:C2, 12v420a), 'connectable': True, 'time': 4465909.784000312, 'tx_power': None}
2024-11-17 12:26:00.685 DEBUG (MainThread) [custom_components.bms_ble] 12v420a: BMS data update
2024-11-17 12:26:00.685 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] Connecting BMS (12v420a)
2024-11-17 12:26:00.686 DEBUG (MainThread) [bleak_retry_connector] C8:47:80:14:D0:C2 - C8:47:80:14:D0:C2: Connection attempt: 1
2024-11-17 12:26:04.131 DEBUG (MainThread) [bleak_retry_connector] C8:47:80:14:D0:C2 - C8:47:80:14:D0:C2: Connected after 1 attempts
2024-11-17 12:26:04.131 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a19-0000-1000-8000-00805f9b34fb (#40): ['read', 'notify']
2024-11-17 12:26:04.132 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a27-0000-1000-8000-00805f9b34fb (#27): ['read']
2024-11-17 12:26:04.132 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a50-0000-1000-8000-00805f9b34fb (#37): ['read']
2024-11-17 12:26:04.132 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a28-0000-1000-8000-00805f9b34fb (#31): ['read']
2024-11-17 12:26:04.132 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a2a-0000-1000-8000-00805f9b34fb (#35): ['read']
2024-11-17 12:26:04.132 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a25-0000-1000-8000-00805f9b34fb (#25): ['read']
2024-11-17 12:26:04.133 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a26-0000-1000-8000-00805f9b34fb (#29): ['read']
2024-11-17 12:26:04.133 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a23-0000-1000-8000-00805f9b34fb (#33): ['read']
2024-11-17 12:26:04.133 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a24-0000-1000-8000-00805f9b34fb (#23): ['read']
2024-11-17 12:26:04.133 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a29-0000-1000-8000-00805f9b34fb (#21): ['read']
2024-11-17 12:26:04.133 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 0000ffe1-0000-1000-8000-00805f9b34fb (#17): ['write-without-response', 'write', 'notify']
2024-11-17 12:26:04.134 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 0000ffe2-0000-1000-8000-00805f9b34fb (#15): ['write-without-response']
2024-11-17 12:26:04.134 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a05-0000-1000-8000-00805f9b34fb (#11): ['read', 'indicate']
2024-11-17 12:26:04.134 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered f000ffc2-0451-4000-b000-000000000000 (#48): ['write-without-response', 'write', 'notify']
2024-11-17 12:26:04.134 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered f000ffc1-0451-4000-b000-000000000000 (#44): ['write-without-response', 'write', 'notify']
2024-11-17 12:26:04.134 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a04-0000-1000-8000-00805f9b34fb (#8): ['read']
2024-11-17 12:26:04.135 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a01-0000-1000-8000-00805f9b34fb (#4): ['read', 'write']
2024-11-17 12:26:04.135 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a00-0000-1000-8000-00805f9b34fb (#2): ['read', 'write']
2024-11-17 12:26:04.135 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Discovered 00002a02-0000-1000-8000-00805f9b34fb (#6): ['read']
2024-11-17 12:26:04.135 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Using characteristics handle #17 (notify), #17 (write)
2024-11-17 12:26:13.540 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) request cell info
2024-11-17 12:26:15.939 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Rx BLE data (start): bytearray(b'U\xaa\xeb\x90\x03\xa3JK_B2A8S20P\x00\x00\x00\x00\x0011.XA\x00\x00\x0011.48\x00\x00\x00\xe4\xa7F\x00\x07\x00\x00\x0012v420a\x00\x00\x00\x00\x00\x00\x00\x00\x001234\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00240704\x00\x00404092C2262\x00000\x00Input Userdata\x00\x00140703\x00\x00\x00\x00')
2024-11-17 12:26:15.941 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Rx BLE data (cnt.): bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
2024-11-17 12:26:17.701 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Rx BLE data (cnt.): bytearray(b'\xfe\xf9\xff\xff\x1f-\x00\x02\x00\x00\x00\x00\x90\x1f\x00\x00\x00\x00\xc0\xd8\xe72\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00d\x00\x00\x00_\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
2024-11-17 12:26:18.771 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Rx BLE data (cnt.): bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfe\xbf!\x06\x00\x00\x00\x00\x00\x00\x00\x00\xd8')
2024-11-17 12:26:20.158 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Rx BLE data (cnt.): bytearray(b'\xaaU\x90\xeb\xc8\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00D')
2024-11-17 12:26:23.571 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Rx BLE data (start): bytearray(b'U\xaa\xeb\x90\x01\xa3\xac\r\x00\x00(\n\x00\x00\xc2\x0b\x00\x00\x10\x0e\x00\x00z\r\x00\x00\n\x00\x00\x00\x84\r\x00\x00\xb8\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc4\t\x00\x00@\r\x03\x00\x1e\x00\x00\x00<\x00\x00\x00@\r\x03\x00,\x01\x00\x00<\x00\x00\x00<\x00\x00\x00\xd0\x07\x00\x00&\x02\x00\x00\xf4\x01\x00\x00&\x02\x00\x00\xf4\x01\x00\x00\x14\x00\x00\x002\x00\x00\x00\xe8\x03\x00\x00 \x03\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00')
2024-11-17 12:26:23.573 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] (12v420a) Rx BLE data (cnt.): bytearray(b'\x00\x00\xa0h\x06\x00\xdc\x05\x00\x00\xe4\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
2024-11-17 12:26:29.604 DEBUG (MainThread) [custom_components.bms_ble.plugins.jikong_bms] Disconnected from BMS (12v420a)
2024-11-17 12:26:32.185 DEBUG (MainThread) [custom_components.bms_ble] 12v420a: device communication timed out
2024-11-17 12:26:32.185 DEBUG (MainThread) [custom_components.bms_ble] Finished fetching 12v420a data in 31.500 seconds (success: False)
2024-11-17 12:26:32.186 DEBUG (MainThread) [custom_components.bms_ble] 12v420a: shuting down BMS device
patman15 commented 23 hours ago

Hi! Thanks for the report. I can see the BMS react in different way than expected, so most probably there is a mismatch in the protocol version, or similar. Need to check more details. Have you installed the latest firmware? You can try to change the timeout (if you know how to edit the source on your installation), although I doubt it will help, here: https://github.com/patman15/BMS_BLE-HA/blob/adc63b3eeff069de50098760ccf023b61bb024a6/custom_components/bms_ble/plugins/jikong_bms.py#L30

SkeLLLa commented 1 hour ago

@patman15 I've already tried to change the timeouts, but likely forgot to send the message with updated and logs. It didn't help a lot. Same error.

I'll try to connect with mobile app and see what firmware is there and also will try updating it to see if it helps, thanks.