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

Govee' object has no attribute 'rate_limit_delay'. Did you mean: 'rate_limit_reset #164

Open
ThierryBegin opened this issue May 24, 2024 · 3 comments

Comments

@ThierryBegin
Copy link

Version of the custom_component

22023.11.1

Configuration

No YAML, using the Integration path.

Describe the bug

Rate Limits are exceeding, the integration fail to connect.

Debug log

2024-05-24 09:46:46.993 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry govee for govee
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 575, 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'. Did you mean: 'rate_limit_reset'?
2024-05-24 09:46:58.976 WARNING (MainThread) [custom_components.govee] API is back online.
2024-05-24 09:46:58.977 WARNING (MainThread) [govee_api_laggat.api] Rate limit exceeded, check if other devices also utilize the govee API
2024-05-24 09:46:58.977 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."}
2024-05-24 09:46:58.978 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry govee for govee
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 575, 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'. Did you mean: 'rate_limit_reset'?

@Dapounet
Copy link

Dapounet commented Jun 18, 2024

Hi there,
the message is pretty clear here:
2024-05-24 09:46:58.977 WARNING (MainThread) [govee_api_laggat.api] **Rate limit exceeded**, check if other devices also utilize the govee API

message":"rate limited! the limit is 10000 requests every 24 hours

Govee is limiting the API calls per day/minutes : https://govee.readme.io/reference/rate-limiting

You have to find the right pulling time. It depends on how much Govee devices you have.

There's no universal answer to this, everyone's setup is different.

@sam-eureka
Copy link

sam-eureka commented Jun 24, 2024

Found the answer in a few previous by searching for "polling"

Change from the default 10s polling to 60s, and restart the service:
image

@Dapounet
Copy link

@sam-eureka : be careful, the poll interval set depends on how many Govee devices you have on your network.
While 60 can be the right value, it can be something else for somebody else.

1 request per minute (60 seconds) = 60 requests per hour = 1440 requests/day.
You can have up to 7 devices with this value (7 devices * 1440 requests/day = 9800 requests/day, below the 10 000 limit).

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

3 participants