Open TTLucian opened 1 year ago
I have the same issue's, after restarting homeassistant the integration is stuck on starting and causes homeassistent to hang until a timeout is reached (takes up to 5 minutes)
Then i have to remove the gardena device and add it again, but for this i also have to delete the API token/secret and create a new one, as i can not reuse it using the integration.
For me it doesn't hang. Just throws the error. Also, when adding, it works with the same keys.
I get this error , after the time out exceeds:
403 : {'Message': 'User is not authorized to access this resource with an explicit deny'} When i test the same API key and secret with the curl command it is succesfull, but for the hass integration it does not work. Happens after a restart of homeassistant.
Logger: homeassistant.config_entries
Source: config_entries.py:399
First occurred: 6:48:34 PM (1 occurrences)
Last logged: 6:48:34 PM
Error setting up entry for gardena_smart_system
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 151, in retry
ret = await target(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/gardena/smart_system.py", line 141, in __call_smart_system_get
if self.__response_has_errors(response):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/gardena/smart_system.py", line 131, in __response_has_errors
response.raise_for_status()
File "/usr/local/lib/python3.11/site-packages/httpx/_models.py", line 749, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '403 Forbidden' for url 'https://api.smart.gardena.dev/v1/locations'
For more information check: https://httpstatuses.com/403
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 399, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/gardena_smart_system/__init__.py", line 49, in async_setup_entry
await gardena_system.start()
File "/config/custom_components/gardena_smart_system/__init__.py", line 86, in start
await self.smart_system.update_locations()
File "/usr/local/lib/python3.11/site-packages/gardena/smart_system.py", line 146, in update_locations
response_data = await self.__call_smart_system_get(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 183, in retry
await asyncio.sleep(seconds)
File "/usr/local/lib/python3.11/asyncio/tasks.py", line 639, in sleep
return await future
^^^^^^^^^^^^
asyncio.exceptions.CancelledError: Global task timeout
Same issue here, after HA restart sometimes this integration has not setup correctly. My current environment: Core 2023.12.3 Supervisor 2023.12.0 Operating System 11.2 Frontend 20231208.2
My current manual "workaround" is to deactivate the integration and activate it again afterwards.
This happens on almost every HA restart (not always though). Only fix I found is to delete the entry and add again.