lkempf/casambi-bt-hass

Failed to connect with new long range bt dongle

Closed this issue · 1 comments

Describe the bug
The integration is working fine with an older tp-link bt 4.0 dongle but not with a newer by 5.3 long range dongle. I have Casambi lamps both in the kitchen and the living room but with the old bt 4.0 usb stick, I cannot reach both rooms. I am running HA OS latest version and the HA Bluetooth integration is working with both these usb devices.

Logs
Logger: CasambiBt._client
Source: /usr/local/lib/python3.12/site-packages/CasambiBt/_client.py:124
First occurred: 21:05:40 (1 occurrences)
Last logged: 21:05:40

Failed to find client.
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/bleak/backends/bluezdbus/client.py", line 209, in connect
reply = await self._bus.call(
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/dbus_fast/aio/message_bus.py", line 384, in call
await future
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/bleak_retry_connector/init.py", line 363, in establish_connection
await client.connect(
File "/usr/local/lib/python3.12/site-packages/habluetooth/wrappers.py", line 300, in connect
connected = await super().connect(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/bleak/init.py", line 605, in connect
return await self._backend.connect(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/bleak/backends/bluezdbus/client.py", line 146, in connect
async with async_timeout(timeout):
File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in aexit
raise TimeoutError from exc_val
TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/CasambiBt/_client.py", line 119, in connect
self._gattClient = await establish_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/bleak_retry_connector/init.py", line 387, in establish_connection
_raise_if_needed(name, device.address, exc)
File "/usr/local/lib/python3.12/site-packages/bleak_retry_connector/init.py", line 327, in _raise_if_needed
raise BleakNotFoundError(msg) from exc
bleak_retry_connector.BleakNotFoundError: Casambi Network - 52:47:62:47:71:08: Failed to connect after 4 attempt(s): TimeoutError

It seems that the problem was related to different lamps using different frequencies. I had the same issues with the app, having to restart it and having to turn off/on bluetooth on the phone. With the HA integration, reloading resulted in being able to control different lamps randomly. I unpaired all the Casambi devices and deleted and recreated the network. Now I am able Ito control all the lamps from HA. Many thanks for this integration and apologies for reporting this. The issue may be closed.