home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
74.08k stars 31.09k forks source link

Home-connect - Rate limit reached #119129

Open christian1986 opened 5 months ago

christian1986 commented 5 months ago

The problem

Home-connect not working, rate limit reached.

homeconnect.api.HomeConnectError: {'description': 'The rate limit "1000 calls in 1 day" was reached. Requests are blocked during the remaining period of 50460 seconds.', 'key': '429'} 2024-06-08 10:49:00.265 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Configuration.yaml for home_connect File "/usr/src/homeassistant/homeassistant/components/home_connect/init.py", line 230, in async_setup_entry File "/usr/src/homeassistant/homeassistant/components/home_connect/init.py", line 254, in update_all_devices File "/usr/src/homeassistant/homeassistant/components/home_connect/api.py", line 70, in get_devices File "/usr/local/lib/python3.12/site-packages/homeconnect/api.py", line 136, in get_appliances File "/usr/local/lib/python3.12/site-packages/homeconnect/api.py", line 91, in get raise HomeConnectError(res["error"])

What version of Home Assistant Core has the issue?

core-2024.6.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

home-connect

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?

homeconnect.api.HomeConnectError: {'description': 'The rate limit "1000 calls in 1 day" was reached. Requests are blocked during the remaining period of 50460 seconds.', 'key': '429'}
2024-06-08 10:49:00.265 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Configuration.yaml for home_connect
  File "/usr/src/homeassistant/homeassistant/components/home_connect/__init__.py", line 230, in async_setup_entry
  File "/usr/src/homeassistant/homeassistant/components/home_connect/__init__.py", line 254, in update_all_devices
  File "/usr/src/homeassistant/homeassistant/components/home_connect/api.py", line 70, in get_devices
  File "/usr/local/lib/python3.12/site-packages/homeconnect/api.py", line 136, in get_appliances
  File "/usr/local/lib/python3.12/site-packages/homeconnect/api.py", line 91, in get
    raise HomeConnectError(res["error"])

Additional information

No response

home-assistant[bot] commented 5 months ago

Hey there @davidmstraub, mind taking a look at this issue as it has been labeled with an integration (home_connect) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `home_connect` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign home_connect` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


home_connect documentation home_connect source (message by IssueLinks)

beastie29a commented 5 months ago

There's a PR open with the library repo that would address this.

pjmpessers commented 4 months ago

This problem also exist by mine. I have 3 home connect appliance's. I switch off 2 of them. And i only use the hood for switching on and off the light and all other in intergrations for the hood are off. Still i get the rate limit reached and been blocked for hours.

storebatfar commented 4 months ago

I am experiencing the same issue with rate limiting.

christian1986 commented 3 months ago

Still an issue

beastie29a commented 3 months ago

Still an issue

@christian1986 , can you try updating to 2024.8.0 or later? The potential fix didn't make it until this release.

christian1986 commented 3 months ago

Well, upgraded and no luck. Tried to reinstall it, than it sort of work.

Now we have another problem, the devices become unavailable every minute or so. Is this a result of the rate limit?

Skjermbilde 2024-08-08 kl  08 12 42
beastie29a commented 3 months ago

Is this a result of the rate limit?

It's possible, need to check if your HA logs have any more HomeConnectError messages with the 429 response code.

Would you be able to enable debugging then disable it after a few minutes and post the log?

christian1986 commented 3 months ago

Looks like it's related. Installed the "home connect alt" from HACS, works without problems.

This is from the "official":

File "/usr/local/lib/python3.12/site-packages/urllib3/util/retry.py", line 594, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.home-connect.com', port=443): Max retries exceeded with url: /api/homeappliances/events (Caused by ResponseError('too many 429 error responses'))

beastie29a commented 3 months ago

File "/usr/local/lib/python3.12/site-packages/urllib3/util/retry.py", line 594, in increment

I see it there, it retries once per request then this message will keep showing up and devices will become unavailable. The "alt" version I believe makes several more API calls and home connect has such a low limit of API requests per day. There's methods to get around that such as creating multiple users, though I don't think those are viable solutions and ask a lot of the user.

christian1986 commented 3 months ago

Yes, looks like it. It's unavailable now.

Question is if there is some way to make even fewer requests. It will be a problem that's it's unavailable every other minute.

pjmpessers commented 3 months ago

For me it worked when I disabled as much of the entities of the devices from home connect in hasc and only let the one enabled that i really use. I have a dishwasher, coffeemaker and hood. I disabled the coffeemaker and dishwasher and disabled a lot of entities for the hood, because I only use the light of the hood.

Now i don't have no problems anymore. It is not the best solution, but it works for me.

christian1986 commented 3 months ago

Will try, I have five devices with a lot of entities👌🏻

pjmpessers commented 3 months ago

And some are maybe polling for data. Like my dishwasher did for his program progression. Maybe it is pulling for data instead of getting data. And maybe that is why the limit is reached very fast on the home connect server.

I hope it works.

Verzonden vanaf mijn Galaxy

-------- Oorspronkelijk bericht -------- Van: christian1986 @.> Datum: 09-08-2024 00:04 (GMT+01:00) Aan: home-assistant/core @.> Cc: Pieter @.>, Comment @.> Onderwerp: Re: [home-assistant/core] Home-connect - Rate limit reached (Issue #119129)

Will try, I have five devices with a lot of entities👌🏻

— Reply to this email directly, view it on GitHubhttps://github.com/home-assistant/core/issues/119129#issuecomment-2276744173, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIHBC5G34AL2DD7FDZMAY3TZQPTQBAVCNFSM6AAAAABI74BLRWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZWG42DIMJXGM. You are receiving this because you commented.Message ID: @.***>

christian1986 commented 3 months ago

My bad, looks like the alt version works without doing anything. Has been stable on the other devices, my washing machine was without power.

Skjermbilde 2024-08-09 kl  11 44 06

The good news is that the HACS version has been working for a full day, with five devices connected. Bad news is that we have to use HACS to get these devices to work from now on.

christian1986 commented 3 months ago

Been using "Home Connect Alt" for a week without any problems. Perhaps the alt version in hacs and the official should be switched🤨

Vergil365 commented 1 month ago

i have the same issue in HA 2024.9.3, i will try the HACS Version.