core: Hydrawise still polls too often and causes HTTP 429 errors
The problem
the problem was already reported and tried to be fixed via https://github.com/home-assistant/core/pull/128090, but I still get the errors in the log from time to time. This causes 1 error each 60 seconds. The only way out I found is to deactivate the integration for at least 30 minutes and then activate again, but it comes back after a while.
Might the interval be increased further or could the nextpoll attribute be used to throttle the integration? See this document from hunter: Hydrawise REST API Ver 1.6_0.pdf
What version of Home Assistant Core has the issue?
2024.10.4
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
hydrawise
Link to integration documentation on our website
https://www.home-assistant.io/integrations/hydrawise
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
2024-11-08 13:42:22.078 ERROR (MainThread) [homeassistant.components.hydrawise] Unexpected error fetching hydrawise data
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/gql/transport/aiohttp.py", line 319, in raise_response_error
resp.raise_for_status()
File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1121, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 429, message='Too Many Requests', url='https://app.hydrawise.com/api/v2/graph'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/hydrawise/coordinator.py", line 46, in _async_update_data
user = await self.api.get_user(fetch_zones=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pydrawise/client.py", line 109, in get_user
result = await self._query(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pydrawise/client.py", line 88, in _query
return await session.execute(dsl_gql(DSLQuery(selector)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/gql/client.py", line 1628, in execute
result = await self._execute(
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/gql/client.py", line 1537, in _execute
result = await self.transport.execute(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/gql/transport/aiohttp.py", line 341, in execute
await raise_response_error(resp, "Not a JSON answer")
File "/usr/local/lib/python3.12/site-packages/gql/transport/aiohttp.py", line 321, in raise_response_error
raise TransportServerError(str(e), e.status) from e
gql.transport.exceptions.TransportServerError: 429, message='Too Many Requests', url='https://app.hydrawise.com/api/v2/graph'
2024-11-08 13:43:23.089 ERROR (MainThread) [homeassistant.components.hydrawise] Unexpected error fetching hydrawise data
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/gql/transport/aiohttp.py", line 319, in raise_response_error
resp.raise_for_status()
File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1121, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 429, message='Too Many Requests', url='https://app.hydrawise.com/api/v2/graph'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/hydrawise/coordinator.py", line 46, in _async_update_data
user = await self.api.get_user(fetch_zones=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pydrawise/client.py", line 109, in get_user
result = await self._query(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pydrawise/client.py", line 88, in _query
return await session.execute(dsl_gql(DSLQuery(selector)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/gql/client.py", line 1628, in execute
result = await self._execute(
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/gql/client.py", line 1537, in _execute
result = await self.transport.execute(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/gql/transport/aiohttp.py", line 341, in execute
await raise_response_error(resp, "Not a JSON answer")
File "/usr/local/lib/python3.12/site-packages/gql/transport/aiohttp.py", line 321, in raise_response_error
raise TransportServerError(str(e), e.status) from e
gql.transport.exceptions.TransportServerError: 429, message='Too Many Requests', url='https://app.hydrawise.com/api/v2/graph'
### Additional information
_No response_
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 6
- Comments: 40 (15 by maintainers)
There’s a PR in review to fix the issue: https://github.com/home-assistant/core/pull/130289
I think we should significantly decrease the rate that we’re pulling water use summaries. Those are expensive to compute on our end, so I can only imagine they’re causing problems on the Hydrawise server-side as well. They’re also daily summaries, so they don’t need to be polled every 60s.
@dknowles2 i got a response from Anthony. Send me your email at Pete dot sage at iCloud dot com and I’ll get you on that thread.
https://github.com/home-assistant/core/pull/130759 increases the polling interval to 5 minutes, and should be included in the next point release.
As I mentioned elsewhere, I’ve reached out to Hydrawise support to see if there’s something more sustainable we can do as well.
Thanks for the advice hiltctn Ive successfuly re-installed about a day later. Ive turned off polling and will try an automation in place until the polling issue can be resolved
@home-assistant reopen
When is this issue getting resolved?
Following as well as I’ve also been having the same issue. As a workaround, I’ve disabled manual polling and instead, I’ve set an automation to refresh the Hydrawise integration once every hour. I just set this automation up and I may increase this time longer if it still has polling issues. This can be achieved by setting an automation to trigger every hour or however long you want it to, and then the action is to perform a "Home Assistant Core Integration ‘Reload config entry’ ", and then set the Config entry ID to Hydrawise. I’m unsure if the Config entry ID is the same or different for everyone, but the entry ID can be found in the core.config_entries file under config/.storage/. Hope this helps someone else out there.
Same issue here. Many 429s. No sensors - one 8-valve system.
The presence of the sensors don’t matter. The integration is still requesting that the server re-compute usage summaries between start-of-day and time-of-refresh for every controller on every polling period.
I’m seeing those errors frequently and I don’t have either rain or flow sensors.
Since I’m in the northern hemisphere, I disabled the integration until next spring to prevent the excessive noise in my logs and contributing to a load on their servers.
If the polling isn’t reduced or made smarter there is always the risk of hyrdawise blocking the integration. Note that a contributing factor with MyQ was that the integration polled so much that it wound up on their radar.
also it wound be good for this condition to not generate a stack trace.
Got it. Thank you.
In the Hydrawise Integration Panel press the three dots and select system options. There you can disable it.
Same thing here. I deactivated polling for entity updates so I can at least control the valves.