JohNan/homeassistant-wellbeing

v1.0.14 Integration Startup failure due to timeout

Closed this issue · 50 comments

Been fine for literally ever for me (great work), until the last few days where I get timeout upo integration start.

I have reloadd, redownloaded, deleted and reinstalled (tried 1.0.13 too) but still the same error:

2024-02-01 08:45:39.070 ERROR (MainThread) [custom_components.wellbeing] Timeout error fetching information from https://api.ocp.electrolux.one/appliance/api/v2/appliances

Mine stopped working today.
I updated to 1.0.14 tried to go back to 1.0.12 but same problem.

Line 128: 2024-02-04 13:18:56.760 INFO (MainThread) [homeassistant.setup] Setting up wellbeing
Line 129: 2024-02-04 13:18:56.760 INFO (MainThread) [homeassistant.setup] Setup of domain wellbeing took 0.0 seconds
Line 897: 2024-02-04 13:23:01.391 DEBUG (MainThread) [custom_components.wellbeing] Current token is not set or expired
Line 898: 2024-02-04 13:23:01.902 DEBUG (MainThread) [custom_components.wellbeing] Received new token sucssfully
Line 899: 2024-02-04 13:23:01.928 DEBUG (MainThread) [custom_components.wellbeing] Fetched data: None
Line 900: 2024-02-04 13:23:01.929 DEBUG (MainThread) [custom_components.wellbeing] Finished fetching wellbeing data in 0.026 seconds (success: False)

same here!
removed, redownloaded, reinstalled, readded an entry - no luck. 'failed to set-up the integration'.
noticed this error while on 1.0.13, 1.0.14 did not resolve it.

Got the same issue since last HA update.

Samma här den slutade funka igår för mig.
Privat att uppdatera till 1.14 men hjälper inte tyvärr.

Same problem for me

Same problem here, something changed in the way the API is handled within Home Assistant it seems

Same for me. Since 2 days ago, integration stopped working, reporting failure.
Have tried to remove and re-add from HACS, reconfigured, but no luck.
Seems to be a common issue. Whether with HA or AEG API..

If you downgrade to Home Assistant Core 2024.1.5, it will work again.

Same for me, stopped working. Have not tried downgrading, will wait for a fix :)

Downgrading did the job for me.

Running HA Core 2024.1.5 (hadn't updated to 2024.1.6 yet)
About every other API update fails and the sensors become unavailable. Then they have values, then they're unavailable.

Downgrading to 2024.1.5 worked.
I used the command- ha core update --version 2024.1.5

thank you. this is great information. I saw that they bumped aiohttp in 2024.1.6 and I wonder if that is the cause. I'm currently looking into is.

I just tried the integration in my dev environment and it runs without issues. It is however the latest from the dev branch. Maybe they have done some changes that made it work again.

When checking out 2024.1.6 in my dev environment i don't get any data. Content-Length of the returned data is 0. I cannot find any reason why.

So my suggestion is to either revert back to 2024.1.5 or wait for 2024.2.x

I confirm downgrade to 2024.1.5 worked for me too.

Can also confirm downgrade to 2024.5 worked. Thanks :)

I can confirm it works again with 2024.2.0! Thanks!

Same here, it does work again with 2024.2.0! Thanks

Update:
After a couple of hours it becomes unstable.Screenshot_20240209_001236_Home Assistant.jpg

hey, for me still something's wrong. The purifyer entities become unavailable every couple of minutes, then come back online for several seconds, then offline again
image
image

hey, for me still something's wrong. The purifyer entities become unavailable every couple of minutes, then come back online for several seconds, then offline again image image

I’m experiencing the same behavior. When reloading the integration, it works for ~30 seconds and then turns to unavailable

It worked flawlessly for me for a couple of hours, but it suddenly became more unstable after a while.

image

I see some errors in the debug log:
2024-02-07 22:35:33.396 ERROR (MainThread) [custom_components.wellbeing] Timeout error fetching information from https://api.ocp.electrolux.one/one-account-authorization/api/v1/token -
2024-02-07 22:35:33.397 ERROR (MainThread) [custom_components.wellbeing] AccessToken 1 is missing
2024-02-08 03:59:46.836 ERROR (MainThread) [custom_components.wellbeing] Error fetching wellbeing data:

I wonder if the API just became unstable (bad timing with the update...) or if it's something else? Anyone still on 2024.1.5 that can confirm it works with the previous version?

Yes I have now noted the integration on either 2024.1.5, or 2024.2.0 is having the behaviours of "unavailable" and "working" frequently.

I downgraded to 2024.1.5 and it works for 6 hours without any issue.

I can confirm it works fine with 2024.2.1 since update (2h ago)
Zrzut ekranu 2024-02-9 o 16 14 18

Thanks for all the info. I wonder if the problem might be in the API after all. Maybe they have added some kind of rate limits.

When I was debugging the request and response the content was empty, which make me believe it is the API rather than HA. The strange thing is that it seems to work the first time after an upgrade/downgrade. Maybe because it take some time between the polling.

I will look into increasing the poll time to see if it helps.

edit: Apparently I have already added the interval as an option. Press Configure on the integration and increase the time interval. Maybe to 120 seconds or something.

I can confirm it works fine with 2024.2.1 since update (2h ago) Zrzut ekranu 2024-02-9 o 16 14 18

Yes my entities look like this now too, look as though the 2024.2.1 update has resolved the issue.

are you guys serious? again, issue is not fixed in 2024.2.1!
image

are you guys serious? again, issue is not fixed in 2024.2.1! image

It would appear the initial analysis was a little premature, it is intermittent again but not as bad as previously,.

Just did the update and intergration is working and devices back as entities. Hopes it stays working!

image

Can it be because the aiohttp.ClientSession is configured with async_get_clientsession during init, and not fetched from hass-object during every sync-period ?
I can rewrite the WellbeingApiClient to fetch the session from hass-object instead of being given the session from init.

Can it be because the aiohttp.ClientSession is configured with async_get_clientsession during init, and not fetched from hass-object during every sync-period ?
I can rewrite the WellbeingApiClient to fetch the session from hass-object instead of being given the session from init.

Might be! At least it's worth a try. Push a PR and I'll approve it!

It does not seem like became better.
Still
2024-02-11 21:34:16.466 DEBUG (MainThread) [custom_components.wellbeing] Current token is not set or expired
2024-02-11 21:34:17.078 DEBUG (MainThread) [custom_components.wellbeing] Received new token sucssfully
2024-02-11 21:34:17.104 DEBUG (MainThread) [custom_components.wellbeing] Fetched data: None
2024-02-11 21:34:17.105 DEBUG (MainThread) [custom_components.wellbeing] Finished fetching wellbeing data in 0.026 seconds (success: False)

I seem to get http-status 429 (Too Many requests) on many requests from HA.

If I change User-Agent we get the data no problem, but if we send with default User-agent we get blocked with HTTP/429 Too Many requests

So it looks like they implemented API Rate Limiting for HA users, right? Is there a method to send API requests with custom User-Agent by this integration? Maybe also one could add this as a config option so everybody can enter custom one.

@JohNan do you have any contact with Electrolux so we can talk to their API-team about this?

@JohNan do you have any contact with Electrolux so we can talk to their API-team about this?

Unfortunately not. Maybe @androidand has some contacts?

We are all also using the same API key and client secret since it is hard coded and extracted from the app. What if we change to use the same User-Agent as the app?

I'm using

User-Agent: HomeAssistant/WellBeing

for my install at home. That works really good right now.

Great, thanks! That works, let's see how long.

This is the User-Agent the app uses: https://github.com/JohNan/homeassistant-wellbeing/pull/84/files#diff-3da8c1a6ea10e2885c00e772ec540f7756569f6a13e8186b5acb9ddc3ff56439R24

Let's see how it works out. New release available

Installing now, will revert with news :)

Just updated, everything online again! Thanks guys for all the work!

Its working again! Thanks!

Since 14:57 time of upgrade it appears to have been rock solid:

image

I wil check again later :)

Good to hear that it is working again!

Let's keep the issue open until tomorrow.

Hi guys, I can finally confirm - integration is working flawlessly for almost 24 hours now. Thank you for all the magic you did!

To add:

image

Great work :)

Closing this issue now, and let's hope it will keep working 😊