Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rate limit exceeded #78

Open
bbrandow opened this issue May 14, 2022 · 30 comments
Open

Rate limit exceeded #78

bbrandow opened this issue May 14, 2022 · 30 comments

Comments

@bbrandow
Copy link

I've had this problem for the last couple of weeks where Home Assistant can't connect to Govee API due to rate limit exceeded.

Logs:

2022-05-14 06:32:50 WARNING (MainThread) [custom_components.govee] Could not connect to Govee API: API: API-Error 429: {"message":"rate limited! the limit is 10000 requests every 24 hours. X-RateLimit-Reset in Http Response Header shows the reset time."}
2022-05-14 06:32:50 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry govee for govee
  File "/config/custom_components/govee/__init__.py", line 67, in async_setup_entry
AttributeError: 'Govee' object has no attribute 'rate_limit_delay'

I don't have any other API connection to Govee, and the few automations I have run a few times daily.

govee v0.2.2
home assistant 2022.5.4 (though it started with 2022.4.x)

A few days after it originally happened, it just started working again for a day or two, but now it's back to blocked.
I tried to downgrade to 0.2.1 by redownloading it via HACS, but after restart it's still at 0.2.2. Do I have to uninstall it first? I haven't tried an uninstall since I didn't want to mess up my entities.

@raven42
Copy link

raven42 commented May 14, 2022

Following. I've been seeing this too with a similar setup.

@bbrandow
Copy link
Author

I removed the integration and reinstalled 0.2.1 and it's working again

@bbrandow
Copy link
Author

Never mind, it broke again a day later with the same error in 0.2.1, though this time with more information in the error:

2022-05-16 06:06:52 WARNING (MainThread) [govee_api_laggat.api] Rate limit exceeded, check if other devices also utilize the govee API
2022-05-16 06:06:52 WARNING (MainThread) [govee_api_laggat.govee_api_laggat] error getting state for device GoveeDevice(device='FA:63:D6:31:30:30:65:2D', model='H6199', device_name='TV', controllable=True, retrievable=True, support_cmds=['turn', 'brightness', 'color', 'colorTem'], support_turn=True, support_brightness=True, support_color=True, support_color_tem=True, online=True, power_state=False, brightness=248, color=(0, 0, 255), color_temp=0, timestamp=1652700901.220386, source=<GoveeSource.API: 'api'>, error='API-Error 429: {"message":"rate limited! the limit is 10000 requests every 24 hours. X-RateLimit-Reset in Http Response Header shows the reset time."}', lock_set_until=1652677931.055981, lock_get_until=1652677932.056008, learned_set_brightness_max=100, learned_get_brightness_max=100, before_set_brightness_turn_on=False, config_offline_is_off=False): API-Error 429: {"message":"rate limited! the limit is 10000 requests every 24 hours. X-RateLimit-Reset in Http Response Header shows the reset time."}

The above two messages show in the logs 3 times a second every 10 seconds. So it seems the integration is checking too frequently to get the device state, and the rate_limit_delay was either changed or removed, so it's creating a lock out.

@ssurovich
Copy link

I have been fighting the same issue - the API is only used by Govee and I have about 10 different Govee devices - 1/2 the time my Govee integration doesnt work due to the rate limit - I understand the limit, but no idea what could cause 10 devices to generate 10,000 requests in a 24 hour period? I have increased the refresh rate to 30 seconds and that didnt really help at all.

@justfly1111
Copy link

im havbintg the same issue so i got another api key and neither api keys are qworking now im guessing this has to do wqith govees servers but who knows

@njsaunders
Copy link

Same thing here - Govee lights operations now work about 10% of the time.

@softwaretech
Copy link

softwaretech commented May 20, 2022

Same here. I saw the limit is 10000 per 24 hours. Does that mean, I've hit it that many times in a 24-hour period or does that count all of the HA users?

@Xerig
Copy link

Xerig commented May 21, 2022

Same error for me - is this issue being worked on, or is it just a limitation we'll have to live with??

@gawdzilla-dev
Copy link

+1 on this issue. This went from stable to API throttling without making any configuration changes. 2 Govee devices total, and 1 is even disabled right now.

@CharlieBoyDev
Copy link

CharlieBoyDev commented May 24, 2022

Same here. I tried all the fixes mentioned above and have had the same results. I also have the Govee skill enabled on Alexa so I thought that might be the issue. However, I disabled the Alexa skill, tried all the fixes again, and same result - works for a bit, then I've hit the limit. This is a recent issue for me too btw.

Anyway, the Govee skill through Alexa has been dependable so I've resorted to automate what I can through there. Though I'd prefer to keep scripts and automations on HA, the Govee integration still requires cloud connection to work anyway, so... I dk, I guess I'm okay with moving what I can to Alexa or the Govee app.

Actually the Govee app updated somewhat recently and they've upgraded their automation abilities. It's not as capable as HA but maybe that's a fix for some of us.

@atv2016
Copy link

atv2016 commented May 30, 2022

+1. Only have 3 or 4 strips or so, value set to 120 and still get these messages.

@molander
Copy link

same

@EmilyNerdGirl
Copy link

Running into this as well.

@chriscantu214
Copy link

having same issue for a few weeks now.. I have 14 govee devices so it's happening quite frequently for me to the point it is unusable.

@russgmoore
Copy link

Having the same issue. I have two lights and maybe make 2-3 adjustments per day.

@kah1010
Copy link

kah1010 commented Jun 3, 2022

Having the same issue, however seems that the API works to turn off a light consistently (if manually turned on), but my automation won’t turn on light…..

@tchellomello
Copy link

tchellomello commented Jun 8, 2022

Hitting the same issue as well.

Could not connect to Govee API: 
  API: API-Error 429: {"message":"rate limited! the limit is 10000 requests every 24 hours.
   X-RateLimit-Reset in Http Response Header shows the reset time."} 

I currently have 3 lights in my house. So I modified the CONF_DELAY (POLL_INTERVAL) to 30 and let's see how it goes.

3600 secs == 1hr

3600sec / 30sec  = 120 reqs per hour per light

120 req * 24 = 2880 req per day per light 

2880 * 3 =  8640 req per day for all 3 lights

Before I had each 10 seconds, so it was easily hitting 25920 reqs/per day for all lights.

I'll report the results.

This is also good information https://github.com/LaggAt/hacs-govee#caveats

@innovatorgit
Copy link

Same issue

@orangelizard
Copy link

Sadly the same issue here. :(

@kah1010
Copy link

kah1010 commented Jun 21, 2022

Had the same issue with only 2 light strips, but after changing Govee Integration Poll Interval from 10 to 30 things have been stabile (so far)

@tchellomello
Copy link

tchellomello commented Jun 21, 2022

So I have not experience any issues after making the change. It looks an expected issue when the poll interval is too short vs the number of lights. So I think this issue can be closed or maybe add more emphasis on this topic on the official documentation or README.md.

@atv2016
Copy link

atv2016 commented Jun 22, 2022 via email

@tchellomello
Copy link

@atv2016 you can see my notes here -> #78 (comment)

@atv2016
Copy link

atv2016 commented Jun 27, 2022 via email

@Neekster
Copy link
Contributor

Below is the developer documentation for the Govee API. This should help you diagnose your issue.
Screenshot_20220627-071130.png

@Maikuh
Copy link

Maikuh commented Aug 7, 2022

Hitting the same issue as well.

Could not connect to Govee API: 
  API: API-Error 429: {"message":"rate limited! the limit is 10000 requests every 24 hours.
   X-RateLimit-Reset in Http Response Header shows the reset time."} 

I currently have 3 lights in my house. So I modified the CONF_DELAY (POLL_INTERVAL) to 30 and let's see how it goes.

3600 secs == 1hr

3600sec / 30sec  = 120 reqs per hour per light

120 req * 24 = 2880 req per day per light 

2880 * 3 =  8640 req per day for all 3 lights

Before I had each 10 seconds, so it was easily hitting 25920 reqs/per day for all lights.

I'll report the results.

This is also good information https://github.com/LaggAt/hacs-govee#caveats

This actually helped. The default poll interval is 10, which is fine for just one device (most people will probably just get one their first time as I did), but I recently added more devices and started getting rate limited. Didn't have to think about that until now.

I feel like the Caveats section should be moved to the top of the README, or at least a small warning (and maybe inside the Integration's UI) should be put so that people are more aware since I think most people, like me, may start adding more devices later on

Hopefully, Govee does indeed add an endpoint to get a list of devices' states instead of having to pull each one separately, to mitigate this issue.

@atv2016
Copy link

atv2016 commented Sep 16, 2022

It doesn't matter, i have it set to 120, have only 4 devices

control 02:22:7C:A6:B0:5D:24:FA failed: API-Error 429 on command {'name': 'turn', 'value': 'on'}: Rate limit exceeded, retry in 7 seconds. for device GoveeDevice(device='02:22:7C:A6:B0:5D:24:FA', model='H618A', device_name='Kitchen Light 1', controllable=True, retrievable=True, support_cmds=['turn', 'brightness', 'color', 'colorTem'], support_turn=True, support_brightness=True, support_color=True, support_color_tem=True, online=True, power_state=True, brightness=254, color=(111, 45, 189), color_temp=0, timestamp=1663308233.895837, source=<GoveeSource.HISTORY: 'history'>, error=None, lock_set_until=1663308234.895407, lock_get_until=1663308235.895426, learned_set_brightness_max=100, learned_get_brightness_max=100, before_set_brightness_turn_on=False, config_offline_is_off=False)

@Cmacellaro
Copy link

Has this issue been resolved yet? I heard rumors of changes GOVEE may be making that would fix this issue in Home assistant

@atv2016
Copy link

atv2016 commented Oct 26, 2022 via email

@LordNex
Copy link

LordNex commented Nov 17, 2022

having same issue, was working great and now im getting this error

This error originated from a custom integration.

Logger: homeassistant.config_entries
Source: custom_components/govee/__init__.py:67
Integration: Govee (documentation, issues)
First occurred: 11:46:05 PM (2 occurrences)
Last logged: 11:47:53 PM

Error setting up entry govee for govee
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 365, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/govee/__init__.py", line 67, in async_setup_entry
    await hub.rate_limit_delay()
AttributeError: 'Govee' object has no attribute 'rate_limit_delay'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests