-
Notifications
You must be signed in to change notification settings - Fork 90
Description
My HA is installed on a Raspberry Pi 4b Home Assistant OS.
All the latest updates are installed.
I've been using Batmon since version 1.53.
The system has three Raspberry Pi Bluetooth adapters and two USB adapters.
There are also add-ons that use these adapters.
- Standard HA Bluetooth: all adapters enabled, active scanning.
- Passive BLE monitor: all adapters enabled, active scanning.
Batmon settings:
concurrent_sampling: true
keep_alive: true
verbose_log: false
sample_period: 9
publish_period: 11
invert_current: true
watchdog: true
expire_values_after: 120
bt_power_cycle: true
16 JBD BMS are connected.
After each HA reboot, I only see 15 BMSs. One random BMS is always unconnected; they're always different BMSs. The add-on can work for three days without BMS4. After a reboot, everything will be fine with BMS4, but it will work without BMS2. You can reboot immediately, or after a few days, BMS2 will be visible, but BMS14 won't connect. So, only 15 of the 16 will always be visible. BT Discovery sees all 16 BMS.
What I did:
- Disabled Standard Bluetooth HA - no change.
- Disabled Passive BLE Monitor - no change.
- Enabled and disabled Bluetooth options 1 and 2 in different sequences - no change.
- In the settings before 1.87, I tried using the adapter, but I got the "unknown parameter: adapter" error. In 1.88 and 1.89, I separated the adapters into BMS in different orders - no change.
- Changed the concurrent_sampling, keep_alive, sample_period, and publish_period parameters - no change (the current working configuration is shown above).
- Changed the number of BMS. Any 8 BMSs always work. I can leave any BMSs in the configuration up to 8, and all will be connected and transmit data. If I add 1 or 2, problems begin. If there are more than 8 BMSs, 1 or 2 will always be unavailable.
Here is a typical error with BMS12
If you look at the RSSI signal, it is -59, while devices with a signal worse than -70 work normally (9 devices)
I can reboot the system or stop the add-on, switch the bluetooth controllers(Bluetoothctl) and start the add-on again and everything will be fine with BMS12, but some other BMSX will have the same error
16:51:27 ERROR [sampling] Battery_12 error (#18): device 'dev_A5_C2_37_4C_E9_20' not found
Traceback (most recent call last):
File "/app/bmslib/sampling.py", line 155, in __call__
s = await self._sample_inner()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/bmslib/sampling.py", line 229, in _sample_inner
async with bms:
^^^
File "/app/bmslib/bt.py", line 372, in __aenter__
await self.connect()
File "/app/bmslib/models/jbd.py", line 51, in connect
await super().connect(**kwargs)
File "/app/bmslib/bt.py", line 262, in connect
await self._connect_client(timeout=timeout)
File "/app/bmslib/bt.py", line 211, in _connect_client
await asyncio.wait_for(self.client.connect(timeout=timeout), timeout=timeout + 1)
File "/usr/lib/python3.12/asyncio/tasks.py", line 520, in wait_for
return await fut
^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/bleak/__init__.py", line 580, in connect
await self._backend.connect(self._pair_before_connect, **kwargs)
File "/app/venv/lib/python3.12/site-packages/bleak/backends/bluezdbus/client.py", line 192, in connect
watcher = manager.add_device_watcher(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/bleak/backends/bluezdbus/manager.py", line 624, in add_device_watcher
self._check_device(device_path)
File "/app/venv/lib/python3.12/site-packages/bleak/backends/bluezdbus/manager.py", line 206, in _check_device
raise BleakError(f"device '{device_path.split('/')[-1]}' not found")
bleak.exc.BleakError: device 'dev_A5_C2_37_4C_E9_20' not found
16:51:27 INFO [sampling] Bleak version 1.1.0
16:51:27 ERROR [main] Error (num 17, max 200) reading BMS: device 'dev_A5_C2_37_4C_E9_20' not found
16:51:27 ERROR [main] Stack: Traceback (most recent call last):
File "/app/main.py", line 37, in fetch_loop
if await fn():
^^^^^^^^^^
File "/app/bmslib/sampling.py", line 155, in __call__
s = await self._sample_inner()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/bmslib/sampling.py", line 229, in _sample_inner
async with bms:
^^^
File "/app/bmslib/bt.py", line 372, in __aenter__
await self.connect()
File "/app/bmslib/models/jbd.py", line 51, in connect
await super().connect(**kwargs)
File "/app/bmslib/bt.py", line 262, in connect
await self._connect_client(timeout=timeout)
File "/app/bmslib/bt.py", line 211, in _connect_client
await asyncio.wait_for(self.client.connect(timeout=timeout), timeout=timeout + 1)
File "/usr/lib/python3.12/asyncio/tasks.py", line 520, in wait_for
return await fut
^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/bleak/__init__.py", line 580, in connect
await self._backend.connect(self._pair_before_connect, **kwargs)
File "/app/venv/lib/python3.12/site-packages/bleak/backends/bluezdbus/client.py", line 192, in connect
watcher = manager.add_device_watcher(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/bleak/backends/bluezdbus/manager.py", line 624, in add_device_watcher
self._check_device(device_path)
File "/app/venv/lib/python3.12/site-packages/bleak/backends/bluezdbus/manager.py", line 206, in _check_device
raise BleakError(f"device '{device_path.split('/')[-1]}' not found")
bleak.exc.BleakError: device 'dev_A5_C2_37_4C_E9_20' not found