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

Gardena integration not available/loaded #199

Open
Pilot2023 opened this issue Feb 12, 2024 · 22 comments
Open

Gardena integration not available/loaded #199

Pilot2023 opened this issue Feb 12, 2024 · 22 comments

Comments

@Pilot2023
Copy link

Dears,
I recognized a few days ago that the Gardena integration is not available any more.
Within the integrations its listet as "not loaded" as attached. Reboot or any other action does not show any positive effects...
Is this a common issue temporary or some fault on my side?

Thanks a lot in advance !

BR
Alex

Gardena not loaded

@grm
Copy link
Contributor

grm commented Feb 12, 2024 via email

@Pilot2023
Copy link
Author

Pilot2023 commented Feb 12, 2024 via email

@Pilot2023
Copy link
Author

Pilot2023 commented Feb 12, 2024 via email

@martinw72
Copy link

you need version 1.1.0 or 1.1.1-rc1

@clipse2004
Copy link

Hi, unfortunately I have the same problem. I have already tried deleting everything and everything worked again until I restarted. I'm using the latest beta version (1.1.1-rc1), but it's the same problem.

I have also tried to create a new API, unfortunately the same result.

Greetings

@JSamsom72
Copy link

Same behavior here. It seems to me it’s not reliable on restart/reboot HA. Sometimes it works, sometimes not. I am on all latest supported versions.

@TTLucian
Copy link

TTLucian commented Feb 26, 2024

Same here. Integration not loaded (failed to set up; reload not available):

Logger: homeassistant.config_entries
Source: config_entries.py:444
First occurred: 01:26:21 (1 occurrences)
Last logged: 01:26:21

Error setting up entry for gardena_smart_system
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/anyio/_core/_tasks.py", line 115, in fail_after
    yield cancel_scope
  File "/usr/local/lib/python3.12/site-packages/httpcore/_backends/anyio.py", line 114, in connect_tcp
    stream: anyio.abc.ByteStream = await anyio.connect_tcp(
                                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/anyio/_core/_sockets.py", line 222, in connect_tcp
    await event.wait()
  File "/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 1613, in wait
    await self._event.wait()
  File "/usr/local/lib/python3.12/asyncio/locks.py", line 212, in wait
    await fut
asyncio.exceptions.CancelledError: Cancelled by cancel scope 7f61af5098b0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/httpcore/_exceptions.py", line 10, in map_exceptions
    yield
  File "/usr/local/lib/python3.12/site-packages/httpcore/_backends/anyio.py", line 113, in connect_tcp
    with anyio.fail_after(timeout):
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/usr/local/lib/python3.12/site-packages/anyio/_core/_tasks.py", line 118, in fail_after
    raise TimeoutError
TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py", line 67, in map_httpcore_exceptions
    yield
  File "/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py", line 371, in handle_async_request
    resp = await self._pool.handle_async_request(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 268, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 251, in handle_async_request
    response = await connection.handle_async_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py", line 99, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py", line 76, in handle_async_request
    stream = await self._connect(request)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py", line 124, in _connect
    stream = await self._network_backend.connect_tcp(**kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpcore/_backends/auto.py", line 30, in connect_tcp
    return await self._backend.connect_tcp(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpcore/_backends/anyio.py", line 112, in connect_tcp
    with map_exceptions(exc_map):
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/usr/local/lib/python3.12/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
    raise to_exc(exc) from exc
httpcore.ConnectTimeout

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 444, 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 85, in start
    await self.smart_system.authenticate()
  File "/usr/local/lib/python3.12/site-packages/gardena/smart_system.py", line 80, in authenticate
    self.token_manager.load_from_oauth2_token(await self.client.fetch_token(
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/authlib/integrations/httpx_client/oauth2_client.py", line 125, in _fetch_token
    resp = await self.post(
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1877, in post
    return await self.request(
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/authlib/integrations/httpx_client/oauth2_client.py", line 90, in request
    return await super().request(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1559, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1646, in send
    response = await self._send_handling_auth(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1674, in _send_handling_auth
    response = await self._send_handling_redirects(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1711, in _send_handling_redirects
    response = await self._send_single_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1748, in _send_single_request
    response = await transport.handle_async_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py", line 370, in handle_async_request
    with map_httpcore_exceptions():
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py", line 84, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ConnectTimeout

@bastiaanterhorst
Copy link

Same issue. For me it broke in this way directly after the update to 2024.2.4

@kizio1000
Copy link

Hi guys. Same here but I found that every time it will not work it is possible to force it to work by disabling integration and then enabling it again. Seams that since last changes in HA there is some issue with vacuums that affects movers too. I am concluding it from fact that my roborock integration does the same and same method helps to get it working.

@grm
Copy link
Contributor

grm commented Mar 17, 2024

There is a new beta release 1.1.1-rc2

can you try ? (i am not sure it will help, but I'll try to have a look after your feedback)

@TTLucian
Copy link

TTLucian commented Mar 17, 2024

1.1.1-rc3 seems to be working after one core restart. Needs further testing! Why not implement the reload service for this integration? It's the only one I've encountered so far that doesn't have a reload service!

Spoke too soon. After the seconds restart I get the same timeout error. Disabling and enabling the integration works.

@grm
Copy link
Contributor

grm commented Mar 17, 2024

Hello,
I am not sure to understand what you are talking about when saying ' reload service'.

Do you have an example ?

@TTLucian
Copy link

TTLucian commented Mar 17, 2024

#173

https://community.home-assistant.io/t/wth-is-there-no-reload-integration-service/467191
Screenshot_2024-03-17-23-58-46-92_c3a231c25ed346e59462e84656a70e50
Screenshot_2024-03-17-23-58-33-82_c3a231c25ed346e59462e84656a70e50
As you can see, the Gardena integration doesn't have a reload option...

@Doppelkeks
Copy link

Doppelkeks commented Mar 20, 2024

I also have this problem after restarting HA, i usually have to disable and enable this integration again.

@marcoraddatz
Copy link

marcoraddatz commented Mar 21, 2024

Even though I cannot contribute much information: I got the same issue that I always need to reload it manually after a restart (v1.1.1-rc3).

@jeff1975
Copy link

I got the same issue that I always need to reload it manually after a restart

@kizio1000
Copy link

After update to RC3 first start of system was ok and each following restart shows that problem is still present

@bpcrocke
Copy link

bpcrocke commented Apr 6, 2024

Same problem here. Sometimes even restarting does not help. Only creating new API credentials worked. So there also seems to be something wrong with API polling and/or API limits.

@freddeh
Copy link

freddeh commented Apr 7, 2024

I got the same issue that I always need to reload it manually after a restart

Exactly the same here...

@Elle4u
Copy link

Elle4u commented Apr 11, 2024

The same by me, again. Version 1.1.1-rc3 did solve the problem for some time but now the problem came back.
Sometimes its running without problems after restart. Mostly I have to disable/enable the integration manually...

@somansch
Copy link

I have the same issue and see it after I had (nightly) internet connection interruption (03:47). It seems, that normally this integration or the remote server reconnects each 2 hours?
image

@k0taperk0t
Copy link

k0taperk0t commented May 21, 2024

Hi everyone! I didn't find information about which exactly version of GARDENA smart system API is supported by this integration. Probably version 1.1 is not supported, but there was made breaking changes. Probably this is the root issue?

Changes from v1.0 to v1.1

  • Response bodies of error responses:
    • conform now to JsonApiErrorObject as specified (but no longer contain properties “code” and “detail”), except for request with missing/invalid Authorization header or X-Api-Key (these return json with a “message” property):
      • e.g. when sending VALVE_CONTROL command START_SECONDS_TO_OVERRIDE with duration = 0 ("seconds"), user receives the following “detail” message: “duration must be at least 1 and at most 36000 seconds, you provided: 0"
    • slightly different / improved error messages in some cases
  • Request headers:
    • Authorization-Provider: husqvarna is not required anymore
  • Commands:
    • the "seconds" attribute now enforces integers as it was specified in v1.0
      • strings are now rejected with status 400 (Bad Request)
        this should only be an issue when having implemented a request using a string despite the specification of an integer
    • still generally return a 400 (Bad request) but may also in some edge cases return a status 502 (Bad Gateway)
      • e.g. when sending VALVE_CONTROL command to a smart Power

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