Giter Club home page Giter Club logo

Comments (17)

grm avatar grm commented on August 16, 2024

Yes, it seem very long foir the integration to connect :)

Could you put the plugin in debug mode and share the home assistant logs please ?

from hass-gardena-smart-system.

jacky-coke avatar jacky-coke commented on August 16, 2024

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: gardena.smart_system
Source: custom_components/gardena_smart_system/init.py:86
Integration: Gardena Smart System integration (documentation, issues)
First occurred: 20:57:31 (9 occurrences)
Last logged: 20:59:42

404 : {r['errors'][0]['title']} - {r['errors'][0]['detail']}

from hass-gardena-smart-system.

grm avatar grm commented on August 16, 2024

Hum, have you activated the authentication api in the husqvarna website ?

Did you set the level of the logs to debug for the plugin ? (think about hiding/masking your client id client secret if there are in the logs).

from hass-gardena-smart-system.

jacky-coke avatar jacky-coke commented on August 16, 2024

Not sure what especially you mean:
After creating the application, I added "Gardena smart system API" as well so I see this:
image

Also not used to work with HA logs yet; all I could get out is the following:

2024-01-04 20:57:31.009 ERROR (MainThread) [gardena.smart_system] 404 : {r['errors'][0]['title']} - {r['errors'][0]['detail']} 2024-01-04 20:57:31.010 INFO (MainThread) [gardena.smart_system] Backing off __call_smart_system_get(...) for 0.1s (httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://api.smart.gardena.dev/v1/locations' 2024-01-04 20:57:31.232 ERROR (MainThread) [gardena.smart_system] 404 : {r['errors'][0]['title']} - {r['errors'][0]['detail']} 2024-01-04 20:57:31.233 INFO (MainThread) [gardena.smart_system] Backing off __call_smart_system_get(...) for 1.1s (httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://api.smart.gardena.dev/v1/locations' 2024-01-04 20:57:32.417 ERROR (MainThread) [gardena.smart_system] 404 : {r['errors'][0]['title']} - {r['errors'][0]['detail']} 2024-01-04 20:57:32.418 INFO (MainThread) [gardena.smart_system] Backing off __call_smart_system_get(...) for 0.6s (httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://api.smart.gardena.dev/v1/locations' 2024-01-04 20:57:33.161 ERROR (MainThread) [gardena.smart_system] 404 : {r['errors'][0]['title']} - {r['errors'][0]['detail']} 2024-01-04 20:57:33.162 INFO (MainThread) [gardena.smart_system] Backing off __call_smart_system_get(...) for 4.4s (httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://api.smart.gardena.dev/v1/locations' 2024-01-04 20:57:37.679 ERROR (MainThread) [gardena.smart_system] 404 : {r['errors'][0]['title']} - {r['errors'][0]['detail']} 2024-01-04 20:57:37.680 INFO (MainThread) [gardena.smart_system] Backing off __call_smart_system_get(...) for 14.7s (httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://api.smart.gardena.dev/v1/locations' 2024-01-04 20:57:52.569 ERROR (MainThread) [gardena.smart_system] 404 : {r['errors'][0]['title']} - {r['errors'][0]['detail']} 2024-01-04 20:57:52.570 INFO (MainThread) [gardena.smart_system] Backing off __call_smart_system_get(...) for 3.8s (httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://api.smart.gardena.dev/v1/locations' 2024-01-04 20:57:56.526 ERROR (MainThread) [gardena.smart_system] 404 : {r['errors'][0]['title']} - {r['errors'][0]['detail']} 2024-01-04 20:57:56.527 INFO (MainThread) [gardena.smart_system] Backing off __call_smart_system_get(...) for 25.7s (httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://api.smart.gardena.dev/v1/locations' 2024-01-04 20:58:22.518 ERROR (MainThread) [gardena.smart_system] 404 : {r['errors'][0]['title']} - {r['errors'][0]['detail']} 2024-01-04 20:58:22.519 INFO (MainThread) [gardena.smart_system] Backing off __call_smart_system_get(...) for 79.5s (httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://api.smart.gardena.dev/v1/locations' 2024-01-04 20:59:42.215 ERROR (MainThread) [gardena.smart_system] 404 : {r['errors'][0]['title']} - {r['errors'][0]['detail']} 2024-01-04 20:59:42.216 INFO (MainThread) [gardena.smart_system] Backing off __call_smart_system_get(...) for 200.5s (httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://api.smart.gardena.dev/v1/locations' 2024-01-04 21:03:02.912 ERROR (MainThread) [gardena.smart_system] 404 : {r['errors'][0]['title']} - {r['errors'][0]['detail']} 2024-01-04 21:03:02.913 INFO (MainThread) [gardena.smart_system] Backing off __call_smart_system_get(...) for 186.0s (httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://api.smart.gardena.dev/v1/locations' 2024-01-04 21:06:09.215 ERROR (MainThread) [gardena.smart_system] 404 : {r['errors'][0]['title']} - {r['errors'][0]['detail']} 2024-01-04 21:06:09.216 INFO (MainThread) [gardena.smart_system] Backing off __call_smart_system_get(...) for 895.9s (httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://api.smart.gardena.dev/v1/locations' 2024-01-04 21:07:02.661 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry for gardena_smart_system File "/usr/local/lib/python3.11/site-packages/gardena/smart_system.py", line 141, in __call_smart_system_get File "/usr/local/lib/python3.11/site-packages/gardena/smart_system.py", line 131, in __response_has_errors httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://api.smart.gardena.dev/v1/locations' 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 File "/usr/local/lib/python3.11/site-packages/gardena/smart_system.py", line 146, in update_locations

Oh, this time I'm getting at least some feedback:

image

from hass-gardena-smart-system.

schluetter avatar schluetter commented on August 16, 2024

I have the same problem, I deactivated the integration for now (as there's not much gardening going on currently). The Husqvarna Website is not too snappy either, but I can login there and the example 'curl' commands for my application get me an authorization token.

But when I try the OpenAPI SwaggerUI at https://developer.husqvarnagroup.cloud/apis/gardena-smart-system-api?tab=openapi, I also get errors - usually "TypeError: Load failed":

image

Using curl from my machine, this one yields something:

$ curl -X 'GET' \ 'https://api.smart.gardena.dev/v1/health' \ -H 'accept: */*'

Yes I am alive%

So it seems as if Husqvarna/Gardena did something with their API, although I don't know what. Somehow my authentication doesn't seem to work, as I can use the "authorize" button on the SwaggerUI, but there I won't get any valid response (again: "TypeError: Load failed"). But using curl (redacted API key here, but I used mine from the Website) I get:

curl -X 'GET' \ 'https://api.smart.gardena.dev/v1/locations' \ -H 'accept: application/vnd.api+json' \ -H 'X-Api-Key: 12345678-0000-0000-0000-701ee3456666'

{"message":"Unauthorized"}%

from hass-gardena-smart-system.

grm avatar grm commented on August 16, 2024

hum, that is a strange behaviour.

I am not sure the health endpoint requires a token.
Have you tried to renew your token ?

from hass-gardena-smart-system.

grm avatar grm commented on August 16, 2024

__call_smart_system_get

After creating the application, I added "Gardena smart system API" as well so I see this:

Yes, I was talking of these 2 APIs

from hass-gardena-smart-system.

schluetter avatar schluetter commented on August 16, 2024

hum, that is a strange behaviour.

I am not sure the health endpoint requires a token. Have you tried to renew your token ?

What I wanted to say is, that the API call via curl does work (without authentication when checking the 'health' endpoint), but their website - or the SwaggerUI frontend on the site - does not work. I can generate new authentication Tokens via curl, but they can't be used within the SwaggerUI, always resulting in the error message "TypeError: LoadFailed". Even when I authorize with both API key (see below) and a fresh token.

I generated a new client secret and tried again, which did get me a fresh token. My main problem was choosing the right UUID for the API key. In the documentation they call it , but it is not the "client secret", it's the "client id" from the developer portal. When I tried to use that, it did indeed work - but I don't have any locations set up yet:

curl -X 'GET' \ 'https://api.smart.gardena.dev/v1/locations' \ -H 'accept: application/vnd.api+json' \ -H 'X-Api-Key: <redacted, the client_id>' \ -H 'Authorization: Bearer eyJhbGci...5362KPPn'

{"errors":[{"id":"<another UUID>","status":"Not Found","title":"List Locations","detail":"No locations found for user: <redacted>"}]}%

So maybe the lag in the HomeAssistant integration might come from that.

from hass-gardena-smart-system.

andrepura avatar andrepura commented on August 16, 2024

i have the same issue here. try to connect to api does not work

Source: config_entries.py:406
First occurred: 09:37:23 (2 occurrences)
Last logged: 09:43:24

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 759, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://api.smart.gardena.dev/v1/locations'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, 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 649, in sleep
    return await future
           ^^^^^^^^^^^^
asyncio.exceptions.CancelledError: Global task timeout

from hass-gardena-smart-system.

Slowmover321 avatar Slowmover321 commented on August 16, 2024

Same here. No luck installing the api, takes forever until it falls.

from hass-gardena-smart-system.

Tintan-S avatar Tintan-S commented on August 16, 2024

I have this Problem too. I installed the api again, deleted the authentication and tied to register ha again.

The connection originally worked, then I had to change the gateway because the mower had a defect and was replaced. I deleted the old gateway and could not connect the new gateway. I get the same error after endless authentication.

from hass-gardena-smart-system.

grm avatar grm commented on August 16, 2024

Could you give it another try woth latest version please ? (1.1.0-rc3)

from hass-gardena-smart-system.

grm avatar grm commented on August 16, 2024

I just released version 1.1.0.

Can you try with this version please ?

from hass-gardena-smart-system.

andrepura avatar andrepura commented on August 16, 2024

i had no luck. you can find the log attached. @grm : thank you for your support!

2024-02-11 19:54:13.609 ERROR (MainThread) [homeassistant.config_entries] 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 759, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://api.smart.gardena.dev/v1/locations'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, 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 649, in sleep
    return await future
           ^^^^^^^^^^^^
asyncio.exceptions.CancelledError
2024-02-11 19:54:28.339 DEBUG (MainThread) [custom_components.gardena_smart_system] Setting up Gardena Smart System component
2024-02-11 19:54:28.339 DEBUG (MainThread) [custom_components.gardena_smart_system] Starting GardenaSmartSystem
2024-02-11 19:54:28.899 ERROR (MainThread) [gardena.smart_system] 404 : {r['errors'][0]['title']} - {r['errors'][0]['detail']}
2024-02-11 19:54:28.899 INFO (MainThread) [gardena.smart_system] Backing off __call_smart_system_get(...) for 0.1s (httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://api.smart.gardena.dev/v1/locations'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404)
2024-02-11 19:54:29.143 ERROR (MainThread) [gardena.smart_system] 404 : {r['errors'][0]['title']} - {r['errors'][0]['detail']}
2024-02-11 19:54:29.143 INFO (MainThread) [gardena.smart_system] Backing off __call_smart_system_get(...) for 1.4s (httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://api.smart.gardena.dev/v1/locations'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404)
2024-02-11 19:54:30.773 ERROR (MainThread) [gardena.smart_system] 404 : {r['errors'][0]['title']} - {r['errors'][0]['detail']}
2024-02-11 19:54:30.773 INFO (MainThread) [gardena.smart_system] Backing off __call_smart_system_get(...) for 3.3s (httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://api.smart.gardena.dev/v1/locations'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404)
2024-02-11 19:54:34.207 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: gardena_smart_system
2024-02-11 19:54:34.294 ERROR (MainThread) [gardena.smart_system] 404 : {r['errors'][0]['title']} - {r['errors'][0]['detail']}
2024-02-11 19:54:34.294 INFO (MainThread) [gardena.smart_system] Backing off __call_smart_system_get(...) for 7.6s (httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://api.smart.gardena.dev/v1/locations'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404)
2024-02-11 19:54:42.026 ERROR (MainThread) [gardena.smart_system] 404 : {r['errors'][0]['title']} - {r['errors'][0]['detail']}
2024-02-11 19:54:42.026 INFO (MainThread) [gardena.smart_system] Backing off __call_smart_system_get(...) for 5.0s (httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://api.smart.gardena.dev/v1/locations'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404)
2024-02-11 19:54:47.275 ERROR (MainThread) [gardena.smart_system] 404 : {r['errors'][0]['title']} - {r['errors'][0]['detail']}
2024-02-11 19:54:47.276 INFO (MainThread) [gardena.smart_system] Backing off __call_smart_system_get(...) for 16.9s (httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://api.smart.gardena.dev/v1/locations'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404)

from hass-gardena-smart-system.

Slowmover321 avatar Slowmover321 commented on August 16, 2024

For me as well, results are the same errors as posted above. My logs looks the same.

from hass-gardena-smart-system.

Slowmover321 avatar Slowmover321 commented on August 16, 2024

Got it working… email adresses for Gardena Gateway and husqvarna API Must be the same, otherwise you get in the endless authentification loop

from hass-gardena-smart-system.

andyblac avatar andyblac commented on August 16, 2024

same issue here, email is the same for app and API

from hass-gardena-smart-system.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.