Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth integration acts up on Home Assistant Supervised #102185

Closed
marcgarciamarti opened this issue Oct 17, 2023 · 3 comments
Closed

Bluetooth integration acts up on Home Assistant Supervised #102185

marcgarciamarti opened this issue Oct 17, 2023 · 3 comments

Comments

@marcgarciamarti
Copy link

marcgarciamarti commented Oct 17, 2023

The problem

I'm running a couple of Switchbot devices in my installation. They appear in my front-end just fine but they are frequently offline. I've noticed that they start to work as soon as I reload the bluetooth integration. Once I do, the two Switchbots work just fine for a short time, and as soon as I reload the integration, I can again control the 2 devices for a short period of time before they are marked as offline.

2023-10-15 23:46:22.615 ERROR (MainThread) [switchbot.devices.device] E8-74-7F-0D-C7-F0 (E8:74:7F:0D:C7:F0): communication failed; Stopping trying; RSSI: -71
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/bleak_retry_connector/__init__.py", line 350, in establish_connection
await client.connect(
File "/usr/src/homeassistant/homeassistant/components/bluetooth/wrappers.py", line 273, in connect
wrapped_backend = self._async_get_best_available_backend_and_device(manager)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/bluetooth/wrappers.py", line 375, in _async_get_best_available_backend_and_device
raise BleakError(
bleak.exc.BleakError: No backend with an available connection slot that can reach address E8:74:7F:0D:C7:F0 was found
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/switchbot/devices/device.py", line 180, in _send_command
return await self._send_command_locked(key, command)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/switchbot/devices/device.py", line 414, in _send_command_locked
await self._ensure_connected()
File "/usr/local/lib/python3.11/site-packages/switchbot/devices/device.py", line 274, in _ensure_connected
client: BleakClientWithServiceCache = await establish_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/bleak_retry_connector/__init__.py", line 438, in establish_connection
_raise_if_needed(name, device.address, exc)
File "/usr/local/lib/python3.11/site-packages/bleak_retry_connector/__init__.py", line 319, in _raise_if_needed
raise BleakOutOfConnectionSlotsError(
bleak_retry_connector.BleakOutOfConnectionSlotsError: E8-74-7F-0D-C7-F0 (E8:74:7F:0D:C7:F0) - E8:74:7F:0D:C7:F0: Failed to connect after 9 attempt(s): No backend with an available connection slot that can reach address E8:74:7F:0D:C7:F0 was found: The proxy/adapter is out of connection slots or the device is no longer reachable; Add additional proxies (https://esphome.github.io/bluetooth-proxies/) near this device
2023-10-15 23:46:22.621 ERROR (MainThread) [switchbot.devices.device] F6-9A-38-18-CA-CD (F6:9A:38:18:CA:CD): communication failed; Stopping trying; RSSI: -80
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/bleak_retry_connector/__init__.py", line 350, in establish_connection
await client.connect(
File "/usr/src/homeassistant/homeassistant/components/bluetooth/wrappers.py", line 273, in connect
wrapped_backend = self._async_get_best_available_backend_and_device(manager)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/bluetooth/wrappers.py", line 375, in _async_get_best_available_backend_and_device
raise BleakError(
bleak.exc.BleakError: No backend with an available connection slot that can reach address F6:9A:38:18:CA:CD was found
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/switchbot/devices/device.py", line 180, in _send_command
return await self._send_command_locked(key, command)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/switchbot/devices/device.py", line 414, in _send_command_locked
await self._ensure_connected()
File "/usr/local/lib/python3.11/site-packages/switchbot/devices/device.py", line 274, in _ensure_connected
client: BleakClientWithServiceCache = await establish_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/bleak_retry_connector/__init__.py", line 438, in establish_connection
_raise_if_needed(name, device.address, exc)
File "/usr/local/lib/python3.11/site-packages/bleak_retry_connector/__init__.py", line 319, in _raise_if_needed
raise BleakOutOfConnectionSlotsError(
bleak_retry_connector.BleakOutOfConnectionSlotsError: F6-9A-38-18-CA-CD (F6:9A:38:18:CA:CD) - F6:9A:38:18:CA:CD: Failed to connect after 9 attempt(s): No backend with an available connection slot that can reach address F6:9A:38:18:CA:CD was found: The proxy/adapter is out of connection slots or the device is no longer reachable; Add additional proxies (https://esphome.github.io/bluetooth-proxies/) near this device

I suspect there is something wrong with the bluetooth integration, because as soon as the integration is reloaded, the Switchbot devices immediately are shown as available. Would appreciate some guidance to further troubleshoot what is going on.

Thanks!!

What version of Home Assistant Core has the issue?

Can't tell. I just purchased the new Switchbots.

What was the last working version of Home Assistant Core?

n/a

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Blueooth

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

Hey there @bdraco, mind taking a look at this issue as it has been labeled with an integration (bluetooth) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of bluetooth can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign bluetooth Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


bluetooth documentation
bluetooth source
(message by IssueLinks)

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@issue-triage-workflows issue-triage-workflows bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 28, 2024
@andorardo
Copy link

andorardo commented Jan 28, 2024 via email

@github-actions github-actions bot locked and limited conversation to collaborators Feb 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants