Skip to content

1.92 wrong work #341

@ISanteiI

Description

@ISanteiI

Hi. My config

concurrent_sampling: true
keep_alive: true
verbose_log: false
sample_period: 9
publish_period: 10
invert_current: true
watchdog: true
expire_values_after: 180
bt_power_cycle: true

I have 16 JBD BMS & 3 BT adapters (one is Raspberry)
1.90 work perfect
1.91 Not so good, I had several lost batteries during the day, but they recovered themselves
At 1.92 I first encountered the fact that my interval was 120 seconds (expire_values_after) stopped working and it turned out that the BMS polling was going slower and after some time I didn't have any of the 16 batteries, I increased the time to 180 seconds
The current version is much more convenient – ​​you can immediately see the signal strength and adapter! This is simply excellent.
Thank you so much for this feature
But I encountered the fact that after some time I stop seeing some batteries, as was the case with older versions before 1.90, in my case 1.90 was the most stable, my record is 8 days of data from all 16 BMS without interruption.
I eventually rolled back to 1.90 and am using it now. But the 1.92 functionality is still bugging me ))))
Look, here's the log, but in the end, batteries 4, 7, 9, and 15 still haven't connected after 20 minutes. Even though they were initially visible to the app and their signal was quite stable.

01:45:58 INFO [bt] BT A5:C2:37:49:DA:E9 4 -68
01:45:58 INFO [bt] BT A5:C2:37:40:46:2B 7 -66
01:45:58 INFO [bt] BT A5:C2:37:40:40:AB 9 -58
01:45:58 INFO [bt] BT A5:C2:37:4C:E9:50 15 -56

I'm very grateful for the app; your 1.90 is completely sufficient for me. In addition to my solar station, I've already set up five more stations with batteries. I know at least 11 families who are very grateful to you for the ability to control their batteries separately from the inverter. We don't have the budget for expensive branded batteries, so we build them ourselves.

If you need any data to debug your JBD app, we're happy to provide it.

The errors just keep happening.

MQTT broker:     addons@core-mosquitto:1883
01:45:45 INFO [main] Started in pair-only mode (bleak 0.13.1a1)
01:45:45 INFO [main] No PSK, nothing to pair
01:45:47 INFO [main] Power cycle bluetooth hardware
Unable to open mgmt_socket
01:45:47 INFO [bt] Powering off controller homeassistant #1 [default] (8A:88:1B:C0:15:A8)
Unable to open mgmt_socket
Unable to open mgmt_socket
01:45:48 INFO [bt] Powering off controller homeassistant #2 (00:E0:4C:43:C0:65)
Unable to open mgmt_socket
Unable to open mgmt_socket
01:45:48 INFO [bt] Powering off controller homeassistant (E4:5F:01:3D:DC:D7)
Unable to open mgmt_socket
Unable to open mgmt_socket
Unable to open mgmt_socket
01:45:50 INFO [bt] Powering on controller homeassistant #1 [default] (8A:88:1B:C0:15:A8)
Unable to open mgmt_socket
Unable to open mgmt_socket
01:45:50 INFO [bt] Powering on controller homeassistant #2 (00:E0:4C:43:C0:65)
Unable to open mgmt_socket
Unable to open mgmt_socket
01:45:50 INFO [bt] Powering on controller homeassistant (E4:5F:01:3D:DC:D7)
Unable to open mgmt_socket
Unable to open mgmt_socket
01:45:53 INFO [bt] BT Discovery (5 seconds):
01:45:58 INFO [bt] BT               addr                       name rssi
01:45:58 INFO [bt] BT  58:B6:23:41:0D:43                       None  -54
01:45:58 INFO [bt] BT  00:00:00:FB:09:D1                 GR2PWS_BLE  -58
01:45:58 INFO [bt] BT  A5:C2:37:4C:E6:B1                         14  -56
01:45:58 INFO [bt] BT  A5:C2:37:40:43:E2                         10  -72
01:45:58 INFO [bt] BT  A5:C2:37:3B:DF:B4              100AH_Battery  -56
01:45:58 INFO [bt] BT  A5:C2:37:4C:E9:50                         15  -56
01:45:58 INFO [bt] BT  A5:C2:37:49:DA:E9                          4  -68
01:45:58 INFO [bt] BT  A5:C2:37:4C:E9:5B                          1  -58
01:45:58 INFO [bt] BT  58:B6:23:46:0A:D4                       None  -54
01:45:58 INFO [bt] BT  A5:C2:37:49:DB:4B                          3  -70
01:45:58 INFO [bt] BT  A5:C2:37:40:40:AB                          9  -58
01:45:58 INFO [bt] BT  A5:C2:37:40:3E:08                         13  -62
01:45:58 INFO [bt] BT  A5:C2:37:4C:E9:20                         12  -52
01:45:58 INFO [bt] BT  A5:C2:37:4C:E9:42                         11  -58
01:45:58 INFO [bt] BT  A5:C2:37:40:45:FF                          8  -62
01:45:58 INFO [bt] BT  A5:C2:37:49:DA:EA                          2  -64
01:45:58 INFO [bt] BT  A5:C2:37:40:46:2B                          7  -66
01:45:58 INFO [bt] BT  98:06:3A:4A:FE:27                       None  -52
01:45:58 INFO [bt] BT  A4:C1:38:61:C6:55                 LYWSD03MMC  -48
01:45:58 INFO [bt] BT  A5:C2:37:4C:E6:9D                          6  -54
01:45:58 INFO [bt] BT  58:B6:23:6D:B6:60                       None  -66
01:45:58 INFO [bt] BT  A5:C2:37:49:DA:F0                          5  -60
01:45:58 INFO [bt] BT  00:00:00:9E:E0:14                 GR2PWS_BLE  -64
01:45:58 INFO [bt] BT  A4:C1:38:B2:9E:06                 LYWSD03MMC  -80
01:45:58 INFO [main] Batmon ver 1.92, aiobmsble ver 0.12.0, Bleak ver 1.1.1, BtBackend ver bluez-v5.82
01:45:58 INFO [bt] Using adapter hci2 to connect to A5:C2:37:3B:DF:B4 (100AH_Battery)
01:45:58 INFO [bt] Using adapter hci2 to connect to A5:C2:37:4C:E6:9D (Battery_6)
01:45:58 INFO [bt] Using adapter hci2 to connect to A5:C2:37:4C:E6:B1 (Battery_14)
01:45:58 INFO [bt] Using adapter hci2 to connect to A5:C2:37:49:DA:F0 (Battery_5)
01:45:58 INFO [bt] Using adapter hci2 to connect to A5:C2:37:4C:E9:5B (Battery_1)
01:45:58 INFO [bt] Using adapter hci1 to connect to A5:C2:37:4C:E9:50 (Battery_15)
01:45:58 INFO [bt] Using adapter hci1 to connect to A5:C2:37:49:DA:EA (Battery_2)
01:45:58 INFO [bt] Using adapter hci1 to connect to A5:C2:37:49:DB:4B (Battery_3)
01:45:58 INFO [bt] Using adapter hci1 to connect to A5:C2:37:49:DA:E9 (Battery_4)
01:45:58 INFO [bt] Using adapter hci1 to connect to A5:C2:37:40:3E:08 (Battery_13)
01:45:58 INFO [bt] Using adapter hci1 to connect to A5:C2:37:4C:E9:20 (Battery_12)
01:45:58 INFO [bt] Using adapter hci0 to connect to A5:C2:37:4C:E9:42 (Battery_11)
01:45:58 INFO [bt] Using adapter hci1 to connect to A5:C2:37:40:43:E2 (Battery_10)
01:45:58 INFO [bt] Using adapter hci0 to connect to A5:C2:37:40:40:AB (Battery_9)
01:45:58 INFO [bt] Using adapter hci0 to connect to A5:C2:37:40:45:FF (Battery_8)
01:45:58 INFO [bt] Using adapter hci0 to connect to A5:C2:37:40:46:2B (Battery_7)
01:45:58 INFO [main] connecting mqtt santei@core-mosquitto.local.hass.io:1883
01:45:58 INFO [main] Fetching 16 BMS + 0 virtual + 0 others concurrently, period=9.00s, keep_alive=True
01:45:58 ERROR [sampling] Battery_15 error (#1): [org.bluez.Error.InProgress] Operation already in progress
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 231, in _sample_inner
    async with bms:
               ^^^
  File "/app/bmslib/bt.py", line 439, 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 336, in connect
    await self._connect_client(timeout=timeout)
  File "/app/bmslib/bt.py", line 271, in _connect_client
    dev = await resolve_address(self.address, self._adapter, timeout=timeout)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/bmslib/scan.py", line 71, in resolve_address
    sc = await get_shared_scanner(adapter)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/bmslib/scan.py", line 33, in get_shared_scanner
    await sc.start()
  File "/app/venv/lib/python3.12/site-packages/bleak/__init__.py", line 153, in start
    await self._backend.start()
  File "/app/venv/lib/python3.12/site-packages/bleak/backends/bluezdbus/scanner.py", line 137, in start
    self._stop = await manager.active_scan(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/bleak/backends/bluezdbus/manager.py", line 442, in active_scan
    assert_reply(reply)
  File "/app/venv/lib/python3.12/site-packages/bleak/backends/bluezdbus/utils.py", line 27, in assert_reply
    raise BleakDBusError(reply.error_name, reply.body)
bleak.exc.BleakDBusError: [org.bluez.Error.InProgress] Operation already in progress
01:46:18 WARNING [bt] Battery_14: device A5:C2:37:4C:E6:B1 not discovered, trying to connect anyway
01:46:18 INFO [bt] Using adapter hci2 to connect to A5:C2:37:4C:E6:B1 (Battery_14)
01:46:20 INFO [sampling] connected bms JbdBt(A5:C2:37:4C:E6:B1,Battery_14)!
01:46:21 INFO [sampling] Battery_14 subscribing for {'discharge': True, 'charge': True} switch change
01:46:21 INFO [sampling] Battery_14: BmsSampl(97.5%,U=53.9V,I=1.50A,P=81W,Q=39/40Ah,mos=nan°C)
01:46:21 INFO [sampling] Battery_14 volt=[3368,3370,3370,3369,3368,3370,3371,3372,3369,3372,3372,3371,3372,3371,3371,3373] temp=[30.4, 27.9, 27.2]
01:46:21 INFO [sampling] Sending HA discovery for Battery_14 (num_samples=0)
01:46:22 INFO [sampling] JbdBt(A5:C2:37:4C:E6:B1,Battery_14) times: connect=22.60s fetch=1.21s
01:46:42 WARNING [bt] 100AH_Battery: device A5:C2:37:3B:DF:B4 not discovered, trying to connect anyway
01:46:42 INFO [bt] Using adapter hci2 to connect to A5:C2:37:3B:DF:B4 (100AH_Battery)
01:47:00 INFO [sampling] connected bms JbdBt(A5:C2:37:3B:DF:B4,100AH_Battery)!
01:47:16 ERROR [sampling] 100AH_Battery error (#1): timeout waiting for 3
Traceback (most recent call last):
  File "/usr/lib/python3.12/asyncio/tasks.py", line 520, in wait_for
    return await fut
           ^^^^^^^^^
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/app/bmslib/__init__.py", line 81, in wait_for
    return await asyncio.wait_for(self._futures.get(name), timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/tasks.py", line 519, in wait_for
    async with timeouts.timeout(timeout):
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/timeouts.py", line 115, in __aexit__
    raise TimeoutError from exc_val
TimeoutError
During handling of the above exception, another exception occurred:
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 241, in _sample_inner
    sample = await bms.fetch()
             ^^^^^^^^^^^^^^^^^
  File "/app/bmslib/models/jbd.py", line 73, in fetch
    buf = await self._q(cmd=0x03)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/bmslib/models/jbd.py", line 67, in _q
    return await self._fetch_futures.wait_for(cmd, self.TIMEOUT)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/bmslib/__init__.py", line 84, in wait_for
    raise asyncio.TimeoutError("timeout waiting for %s" % name)
TimeoutError: timeout waiting for 3
01:47:36 WARNING [bt] Battery_4: device A5:C2:37:49:DA:E9 not discovered, trying to connect anyway
01:47:36 INFO [bt] Using adapter hci1 to connect to A5:C2:37:49:DA:E9 (Battery_4)
01:47:43 INFO [sampling] connected bms JbdBt(A5:C2:37:49:DA:E9,Battery_4)!
01:47:44 INFO [sampling] Battery_4 subscribing for {'discharge': True, 'charge': True} switch change
01:47:44 INFO [sampling] Battery_4: BmsSampl(97.5%,U=53.9V,I=1.89A,P=102W,Q=39/40Ah,mos=nan°C)
01:47:44 INFO [sampling] Battery_4 volt=[3366,3366,3367,3367,3367,3367,3367,3367,3366,3366,3367,3366,3367,3367,3367,3367] temp=[41.0, 24.1, 24.1]
01:47:44 INFO [sampling] Sending HA discovery for Battery_4 (num_samples=0)
01:47:45 INFO [sampling] JbdBt(A5:C2:37:49:DA:E9,Battery_4) times: connect=26.69s fetch=1.93s
01:48:05 WARNING [bt] Battery_10: device A5:C2:37:40:43:E2 not discovered, trying to connect anyway
01:48:05 INFO [bt] Using adapter hci1 to connect to A5:C2:37:40:43:E2 (Battery_10)
01:48:27 ERROR [sampling] Battery_10 error (#1): <class 'TimeoutError'>
Traceback (most recent call last):
  File "/app/venv/lib/python3.12/site-packages/bleak/backends/bluezdbus/client.py", line 299, in connect
    reply = await self._bus.call(
            ^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/dbus_fast/aio/message_bus.py", line 409, in call
    await future
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
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 231, in _sample_inner
    async with bms:
               ^^^
  File "/app/bmslib/bt.py", line 439, 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 336, in connect
    await self._connect_client(timeout=timeout)
  File "/app/bmslib/bt.py", line 283, in _connect_client
    await asyncio.wait_for(self.client.connect(timeout=timeout), timeout=timeout + 2)
  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 156, in connect
    async with async_timeout(timeout):
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/timeouts.py", line 115, in __aexit__
    raise TimeoutError from exc_val
TimeoutError
01:48:47 WARNING [bt] Battery_3: device A5:C2:37:49:DB:4B not discovered, trying to connect anyway
01:48:47 INFO [bt] Using adapter hci1 to connect to A5:C2:37:49:DB:4B (Battery_3)
01:48:52 ERROR [sampling] Battery_3 error (#1): failed to discover services, device disconnected
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 231, in _sample_inner
    async with bms:
               ^^^
  File "/app/bmslib/bt.py", line 439, 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 336, in connect
    await self._connect_client(timeout=timeout)
  File "/app/bmslib/bt.py", line 283, in _connect_client
    await asyncio.wait_for(self.client.connect(timeout=timeout), timeout=timeout + 2)
  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 355, in connect
    await self._get_services(
  File "/app/venv/lib/python3.12/site-packages/bleak/backends/bluezdbus/client.py", line 713, in _get_services
    self.services = await manager.get_services(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/bleak/backends/bluezdbus/manager.py", line 687, in get_services
    await self._wait_for_services_discovery(device_path)
  File "/app/venv/lib/python3.12/site-packages/bleak/backends/bluezdbus/manager.py", line 857, in _wait_for_services_discovery
    raise BleakError("failed to discover services, device disconnected")
bleak.exc.BleakError: failed to discover services, device disconnected
01:49:12 WARNING [bt] Battery_13: device A5:C2:37:40:3E:08 not discovered, trying to connect anyway
01:49:12 INFO [bt] Using adapter hci1 to connect to A5:C2:37:40:3E:08 (Battery_13)
01:49:24 ERROR [sampling] Battery_13 error (#1): failed to discover services, device disconnected
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 231, in _sample_inner
    async with bms:
               ^^^
  File "/app/bmslib/bt.py", line 439, 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 336, in connect
    await self._connect_client(timeout=timeout)
  File "/app/bmslib/bt.py", line 283, in _connect_client
    await asyncio.wait_for(self.client.connect(timeout=timeout), timeout=timeout + 2)
  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 355, in connect
    await self._get_services(
  File "/app/venv/lib/python3.12/site-packages/bleak/backends/bluezdbus/client.py", line 713, in _get_services
    self.services = await manager.get_services(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/bleak/backends/bluezdbus/manager.py", line 687, in get_services
    await self._wait_for_services_discovery(device_path)
  File "/app/venv/lib/python3.12/site-packages/bleak/backends/bluezdbus/manager.py", line 857, in _wait_for_services_discovery
    raise BleakError("failed to discover services, device disconnected")
bleak.exc.BleakError: failed to discover services, device disconnected
01:49:44 WARNING [bt] Battery_7: device A5:C2:37:40:46:2B not discovered, trying to connect anyway
01:49:44 INFO [bt] Using adapter hci0 to connect to A5:C2:37:40:46:2B (Battery_7)
01:50:04 ERROR [bt] Device with address A5:C2:37:40:46:2B was not found., starting scanner
01:50:04 INFO [bt] BT Discovery (5 seconds):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions