core: Home connect initialization freezes and hangs, fails in the end

The problem

I have this error with home connect:

homeassistant  | 2024-08-29 01:43:50.690 WARNING (MainThread) [homeassistant.helpers.service] Referenced entities light.office_combined are missing or not currently available
homeassistant  | 2024-08-29 01:43:53.421 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: {('home_connect', '01J6CV1F6WE4KEZWKR9NY0QZ3V'): 182994.493163482}
homeassistant  | 2024-08-29 01:44:53.496 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: {('home_connect', '01J6CV1F6WE4KEZWKR9NY0QZ3V'): 182994.493163482}
homeassistant  | 2024-08-29 01:45:53.575 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: {('home_connect', '01J6CV1F6WE4KEZWKR9NY0QZ3V'): 182994.493163482}
homeassistant  | 2024-08-29 01:46:53.661 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: {('home_connect', '01J6CV1F6WE4KEZWKR9NY0QZ3V'): 182994.493163482}
homeassistant  | 2024-08-29 01:47:53.701 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry XXXX for home_connect
homeassistant  | Traceback (most recent call last):
homeassistant  |   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup
homeassistant  |     result = await component.async_setup_entry(hass, self)
homeassistant  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/components/home_connect/__init__.py", line 230, in async_setup_entry
homeassistant  |     await update_all_devices(hass, entry)
homeassistant  |   File "/usr/src/homeassistant/homeassistant/components/home_connect/__init__.py", line 254, in update_all_devices
homeassistant  |     await hass.async_add_executor_job(hc_api.get_devices)
homeassistant  | asyncio.exceptions.CancelledError: Global task timeout
homeassistant  | 2024-08-29 01:47:53.706 WARNING (MainThread) [homeassistant.bootstrap] Setup timed out for stage 2 waiting on set() - moving forward

I was debugging my custom module, so I was doing restarts of HA very often. Perhaps I reached the rate limit? I dont know, but what happens is that the extension is initializing for long time, and then it fails. If it is the rate limit, Id appreciate some message. maybe I am firewalled by their API servers? so I dont even get error message?

What version of Home Assistant Core has the issue?

core-2024.8.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Home Assistant

Link to integration documentation on our website

https://www.home-assistant.io/integrations/home_connect/

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

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17

Most upvoted comments

Mine’s working again but curious, how do you automate rebooting the integration? Thanks!

With this automation: I point to one of the sensors provided by the Home Connect integration and I call the homeassistant.reload_config_entry as an action, it starts a 4:00am :

alias: Reload Home Connect
description: ""
mode: single
triggers:
  - at: "04:00:00"
    trigger: time
conditions: []
actions:
  - target:
      entity_id: sensor.dishwasher_operation_state
    data: {}
    action: homeassistant.reload_config_entry

I jumped the ship and switched to Home Connect Alt integration and so far everything is working fine.

A few notes, it may be that this issue is related to the rate limiting feature of Home Connect. This is based on my observation that after switching to “Home Connect Alt” the new integration was in BLOCKED state (due to rate limiting) for 8 hours before it was finally able to add my devices. Or the rate limiting was triggered by my persistent debugging of the default Home Connect integration.

Either way, the Home Connect Alt integration provides more useful information during the debug state and it’s much easier to determine what the problem is.