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

No reconnecting after a restart of Home Assistant #31

Closed
z-master42 opened this issue Jun 8, 2023 · 11 comments
Closed

No reconnecting after a restart of Home Assistant #31

z-master42 opened this issue Jun 8, 2023 · 11 comments

Comments

@z-master42
Copy link

  • Home Assistant Version (eg. 2023.2): 2023.6
  • Ember Mug Component Version (eg. 0.5.0): 0.7.1

Description

After restarting Home Assistant, the integration cannot complete the setup because it fails to re-establish a Bluetooth connection to the Mug/Cup.

What I Did

To complete the setup, the Mug/Cup must be set to pairing mode. This is necessary each time after a restart. Before this, all entities are not available.

Logs / Errors

This error was caused by a custom integration
Logger: ember_mug.mug
Source: custom_components/ember_mug/coordinator.py:62
Integration: Ember Mug (documentation, issues)
First occurred: 19:10:40 (6 occurrences)
Last logged: 19:20:10

EF:70:A4:DA:3F:B0: Ember Cup 2: Failed to connect to the mug: (EF:70:A4:DA:3F:B0) - EF:70:A4:DA:3F:B0: Failed to connect:

This error was caused by a custom integration

Logger: custom_components.ember_mug.coordinator
Source: custom_components/ember_mug/coordinator.py:72
Integration: Ember Mug (documentation, issues)
First occurred: 19:10:40 (6 occurrences)
Last logged: 19:20:10

An error occurred whilst updating the Ember Cup 2: (EF:70:A4:DA:3F:B0) - EF:70:A4:DA:3F:B0: Failed to connect:
@sopelj
Copy link
Owner

sopelj commented Jun 14, 2023

Oh, that's very strange. I restart relatively often, and it has not happened to me. Are you using Bluetooth Proxies or a Bluetooth dongle?

@z-master42
Copy link
Author

No, neither a dongle nor a proxy.

@sopelj
Copy link
Owner

sopelj commented Jun 15, 2023

No, neither a dongle nor a proxy.

What are you using then? A built-in Bluetooth card with the Bluetooth integration? On HassOS or something else?
You didn't have issues before 2023.6?

@z-master42
Copy link
Author

I have Home Assistant (Hass OS) running on a Raspberry Pi 3 with the integrated Bluetooth chip. The behavior was already given with previous versions. Had tried so far to fix it maybe.

@sopelj
Copy link
Owner

sopelj commented Jun 24, 2023

Oh OK. So it's not a regression then.
This used to be a problem with proxies, but never seemed to affect dongles. Not sure why it would be a problem with built-in Bluetooth.
Do you have any other devices using the Bluetooth?
Perhaps you can try and click "configure" on the Bluetooth Integration see if there are any options that might help? If not, you could also try manually connecting/pairing via bluetoothctl to see if it can help if reconnect better in future. Normally it should automatically try and reconnect unless it absolutely has to wait for a Bluetooth event.

@rybackisback
Copy link

Thanks @sopelj no other bluetooth devices. running bluetoothctl fixed it.

@sopelj
Copy link
Owner

sopelj commented Jun 25, 2023

Thanks @sopelj no other bluetooth devices. running bluetoothctl fixed it.

Oh perfect! Does it persist through reboots now?

@z-master42
Copy link
Author

I have now also been able to test it and can confirm that the connection remains after using bluetoothctl, even after restarting Home Assistant.

But I have another point: I also have an Ember Travel Mug 2, but when I scan for devices via bluetoothctl, its MAC address does not even appear...

@sopelj
Copy link
Owner

sopelj commented Jun 29, 2023

@z-master42 Ok, thanks! I'll add that to the troubleshooting guide and then close this issue.

For the Travel Mug 2, is it in pairing mode? We can do an issue for that. The person who helped me test the travel mug it had the first generation I think. The second should work though. It may have a different Bluetooth name or service UUID. You should be able to detect it with bluetoothctl though so long as it is in pairing mode (ie. says "PAIR" on the screen). If you could check the service UUID that would be super cool too.

@z-master42
Copy link
Author

Yes, I had paired in with the app, then deleted there again, reset and then turned on scan mode in bluetoothctl and put the mug in pairing mode. I will try again and if I get stuck open a new issue. This one can then be closed.

@sopelj
Copy link
Owner

sopelj commented Jun 30, 2023

@z-master42 Ok, thanks! If you can confirm it works please let me know too and I'll update the doc to list it as tested. It may have a different name than the travel mug 1. Thanks!

@sopelj sopelj closed this as completed Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants