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.
Same here. #76 (comment)
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!
It worked flawlessly for me for a couple of hours, but it suddenly became more unstable after a while.
![image](https://private-user-images.githubusercontent.com/5821559/303307250-0bb21064-7278-48d0-b259-1c9f6d66e662.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUwMTgyMDEsIm5iZiI6MTcyNTAxNzkwMSwicGF0aCI6Ii81ODIxNTU5LzMwMzMwNzI1MC0wYmIyMTA2NC03Mjc4LTQ4ZDAtYjI1OS0xYzlmNmQ2NmU2NjIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgzMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MzBUMTEzODIxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZjU5MjdlYmU5MWRhYzdjNGFlNjdiNzc2MGFjYjA3NjYzYWY2ZDNkNTgxYmYxMmE5MTY3MDg5MTRjMDViN2Q5MyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.AGO2myWCWcdeBBHzrE_3n7rHxlrJXZKUPk1k5EK6bPc)
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.
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.
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.
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
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!
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!
Closing this issue now, and let's hope it will keep working 😊