core: August integration makes too many requests and hits rate limits
The problem
It appears august has recently implemented stricter rate limits.
Environment
Home Assistant 0.104.3
- Home Assistant release with the issue:
- Last working Home Assistant release (if known):
- Operating environment (Hass.io/Docker/Windows/etc.):
- Integration causing this issue: august
- Link to integration documentation on our website: https://www.home-assistant.io/integrations/august/
Problem-relevant configuration.yaml
n/a
august:
login_method: email
username: !secret august_username
password: !secret august_password
Traceback/Error logs
2020-02-04 20:17:01 ERROR (SyncWorker_14) [homeassistant.components.august] Request error trying to retrieve door status for [removed] Garage Side Door. 429 Client Error: Too Many Requests for url: https://api-production.august.com/locks/[removed]/status
2020-02-04 20:17:01 ERROR (SyncWorker_14) [homeassistant.components.august] Request error trying to retrieve door details for [removed] Garage Side Door. 429 Client Error: Too Many Requests for url: https://api-production.august.com/locks/[removed]
2020-02-04 20:17:01 ERROR (MainThread) [homeassistant.helpers.entity] Update for lock.alexander_front_door fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 461, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/august/lock.py", line 58, in update
self._lock.device_id, ActivityType.LOCK_OPERATION
File "/usr/src/homeassistant/homeassistant/components/august/__init__.py", line 218, in get_latest_device_activity
activities = self.get_device_activities(device_id, *activity_types)
File "/usr/src/homeassistant/homeassistant/components/august/__init__.py", line 209, in get_device_activities
self._update_device_activities()
File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 240, in wrapper
result = method(*args, **kwargs)
File "/usr/src/homeassistant/homeassistant/components/august/__init__.py", line 229, in _update_device_activities
self._access_token, house_id, limit=limit
File "/usr/local/lib/python3.7/site-packages/august/api.py", line 188, in get_house_activities
"limit": limit,
File "/usr/local/lib/python3.7/site-packages/august/api.py", line 296, in _call_api
response.raise_for_status()
File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://api-production.august.com/houses/[removed]/activities?limit=10
Additional information
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 19
- Comments: 40 (12 by maintainers)
PR to fix is here: https://github.com/home-assistant/home-assistant/pull/31558
I’m not particularly happy with the slow update times. I’ll try to find some time to see if there is a way to reduce the number of requests first and increase the updates a bit before sending anything.
august is an official component of HASS which is being fixed here due to changes in August’s API, the instructions from @bdraco are to apply the fix in the interim, before this PR is reviewed, merged and released, there’s no point in adding it to HACS since this is not a community component.