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

Integration slow to load #53

Open
jhemak opened this issue Apr 4, 2024 · 4 comments
Open

Integration slow to load #53

jhemak opened this issue Apr 4, 2024 · 4 comments

Comments

@jhemak
Copy link

jhemak commented Apr 4, 2024

  • Home Assistant Version (eg. 2023.11): 2024.04
  • Ember Mug Component Version (eg. 0.8.0): 1.0.0
  • Which device(s) are you using for Bluetooth (e.g. Bluetooth Dongle / ESPHome Proxy): ESPHome Proxy

Description

This is a great integration! However, it is also the slowest (by far) of any of my integrations to load. I am now even seeing errors in the logs from it. Anything that can be done to speed it up? By the way, it is always the slowest and worse when the Mug is outside the range of bluetooth during the restart (e.g. most recently 112s with everything else <10s.

What I Did

Rebooted

Logs / Errors

2024-04-04 08:52:00.382 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: {('ember_mug', 'redacted'): redacted}

If possible/applicable, please enable logging, reproduce the issue and include any related errors below.
This greatly helps with debugging and is much appreciated.
(If you aren't sure how to enable it, please see the debugging section in the README)

@sopelj
Copy link
Owner

sopelj commented Apr 5, 2024

Hi! Thanks! Glad you like it.

Hmm, that is quite a long time. Is that the time that's reported in Settings -> System -> Repairs -> integration startup time?

On mine, it is not light-speed, but it is reasonably fast at 4s.
image

There isn't much that can be done to speed it up from the integration standpoint except if we were to not try to connect to the device, however that would only appease the startup time stats and would prevent one being alerted from actual failures.

Do you have a lot of connection issues in your logs? You might need to enable debug logging. Perhaps your mug is far from the proxy it may have a tough time establishing a connection.

@jhemak
Copy link
Author

jhemak commented Apr 6, 2024

Yes, I took that timing from the screen you noted. It does seem the time varies ... I just tried 3 reboots in a row and got timings of 22.68, 2.76, and then 22.83s. No mention of the string "error" in the debug log either.

@sopelj
Copy link
Owner

sopelj commented Apr 8, 2024

Yeah, that's because on startup it will try to connect to your device. If it connect immediately it only takes a second or two. However, if it has trouble connecting to your device, like if it's offline, far await, poor signal, used by your phone or something then it will take long as it will keep retrying for a little while.

This doesn't however, impact the availability of your home assistant instance and this happens with many integrations. For example, I use the WLED integration and my lights are outside and have poor wifi so sometimes it takes like 230s to startup.

You won't see an error, but you may might see connection failed. You do need to enable "debug logging" though. You can see the debugging section of the README for more info.

Is your device a good distance from the Proxy or are there things like a wifi adapter or USB 3 cables nearby that could cause interference? The Home Assistant page on Bluetooth has some good tips for connection issues.

@jhemak
Copy link
Author

jhemak commented Apr 9, 2024

Got it - OK, thank you! Overall, it's working well and I don't think there are phone issues or predictable interference. Probably nothing to lose sleep over. Thanks again!

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

2 participants