schmittx / home-assistant-eero

Eero integration for Home Assistant
MIT License
108 stars 22 forks source link

Initialization Failure #61

Closed humphrep closed 12 months ago

humphrep commented 1 year ago

I am able to get through the authentication and select the items I want to add. It says it integration is successful, however then i get an error saying "Failed to setup". I see this in the logs:

2023-07-07 16:31:26.260 ERROR (MainThread) [custom_components.eero] Timeout fetching Eero (Paul Humphreys) data 2023-07-07 16:31:26.264 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Paul Humphreys for eero Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 390, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/eero/init.py", line 310, in async_setup_entry if any([eero.is_eero_beacon for network in coordinator.data.networks for eero in network.eeros]): ^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'networks'

schmittx commented 1 year ago

I just released 1.4.1 which adds more debug level logging to help diagnose this. Please update and try a fresh install of the integration, then share your results.

humphrep commented 1 year ago

Sorry for the delay. There are a lot of entries in the logs. It seems like it is getting tons of data. One thing I noticed, is that it is calling for the data of multiple networks, even though I only selected one. I have 4 networks tied to my account. Since I am only choosing one, I would expect it to only get the data from the one I choose.

Here is the beginning entry: 2023-07-13 22:45:58.726 DEBUG (SyncWorker_2) [custom_components.eero.api] Called /2.2/account via get and got response 200

Then there are a bunch of get requests and responses, they all look normal. Then there is this timeout. However, there are get requests before and after that don't complain and the json looks clean.

2023-07-13 22:46:07.896 ERROR (MainThread) [custom_components.eero] Timeout fetching Eero ( ) data 2023-07-13 22:46:07.900 DEBUG (MainThread) [custom_components.eero] Finished fetching Eero ( ) data in 10.005 seconds (success: False) 2023-07-13 22:46:07.903 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry ***** for eero Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 390, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/eero/init.py", line 318, in async_setup_entry if any([eero.is_eero_beacon for network in coordinator.data.networks for eero in network.eeros]): ^^^^^^^^^^^^^^^^^^^^^^^^^

All the communication looks right, but it seems like there is a 10 second limit, and since it's grabbing the data from all 4 networks (the one I want is the last one it is pulling the data from), I think it's timing out.

Let me know if this is enough to go on, I can give you more from the log, but there is a bunch of data in it.

Thanks!

schmittx commented 1 year ago

I just released 1.4.2 which only grabs data from the configured network(s) after the initial setup. If there's still problems, then I may need to adjust the default timeout. Please update and let me know your feedback.

humphrep commented 12 months ago

That did it. I didn't have to do anything. After installing the update and restarting HA, it came up with all the items. Thanks!