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

Bug: connection constantly lost mug 1 #68

Open
mcmasterp opened this issue Jan 3, 2025 · 2 comments
Open

Bug: connection constantly lost mug 1 #68

mcmasterp opened this issue Jan 3, 2025 · 2 comments
Assignees
Labels
bug Something isn't working connection issue

Comments

@mcmasterp
Copy link

mcmasterp commented Jan 3, 2025

Home Assistant Version

2024.12.5

Ember Mug Integration Version

1.2.1

What device(s) are you using?

Mug

Which device(s) are you using for Bluetooth?

Integrated Bluetooth Adapter of pi5

Unexpected behaviour

the mug is constantly dropping off and not available etc.

Expected behaviour

hoping for reasonably consistent connection

Errors/Logs

2025-01-03 15:56:08.135 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Pauls Mug for ember_mug
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 640, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ember_mug/__init__.py", line 106, in async_setup_entry
    await mug_coordinator.async_config_entry_first_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 305, in async_config_entry_first_refresh
    if await self.__wrap_async_setup():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 318, in __wrap_async_setup
    await self._async_setup()
  File "/config/custom_components/ember_mug/coordinator.py", line 71, in _async_setup
    await self.mug.update_initial()
  File "/usr/local/lib/python3.13/site-packages/ember_mug/mug.py", line 400, in update_initial
    return await self._update_multiple(INITIAL_ATTRS)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/ember_mug/mug.py", line 411, in _update_multiple
    await self._ensure_connection()
  File "/usr/local/lib/python3.13/site-packages/ember_mug/mug.py", line 150, in _ensure_connection
    client = await establish_connection(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<5 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/bleak_retry_connector/__init__.py", line 363, in establish_connection
    await client.connect(
    ...<3 lines>...
    )
  File "/usr/local/lib/python3.13/site-packages/habluetooth/wrappers.py", line 311, in connect
    connected = await super().connect(**kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/bleak/__init__.py", line 615, in connect
    return await self._backend.connect(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/bleak/backends/bluezdbus/client.py", line 214, in connect
    reply = await self._bus.call(
            ^^^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/dbus_fast/aio/message_bus.py", line 385, in call
    await future
asyncio.exceptions.CancelledError
@mcmasterp mcmasterp added the bug Something isn't working label Jan 3, 2025
@sopelj
Copy link
Owner

sopelj commented Jan 4, 2025

Hi! From the logs this seems to just be a connection issue. Have you tried the troubleshooting tips in the Home Assistant documentation on Bluetooth?
A few other questions/suggestions:

  • Are you sure you do not have another device like your phone that is still paired with it? (they could be fighting to connect)
  • Is your mug close to the Raspberry Pi? If not, do you have fewer issues closer?
  • I see the Home Assistant documentation says there are reliability issues with the Pi 3 and 4, not sure if that applies to the 5 as well.
  • Do you have anything that may cause interference?
  • Do you have another dongle or ESP32 you could try to see if that works better?
  • Have you tried removing the device and adding it again (remove device and remove via bluetoothctl)
  • Are you running Home Assistant OS directly on the PI or are you doing some kind of device passthrough that could be causing problems?

@mcmasterp
Copy link
Author

Hey I also thought maybe plain old signal strength but I know nothing. I am using HA OS direct (on nvme if it matters) and I tried the pi is in the center of my small house so it's no more than 20ft at any moment but I realize interference can easily defeat 20ft. not paired with my phone or any other device. I did remove and re-add a few times as well as hot pair it same works for a few minutes then gone. even if the mug hasn't moved, on or off the charger.

I am building a full pc now for HA as I want best all local voice performance so in a few days Ill be using a z790 mobo with external bt antenna so things will likely be way different

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working connection issue
Projects
None yet
Development

No branches or pull requests

2 participants