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

Can't setup integration #15

Closed
TheFitzZZ opened this issue May 29, 2020 · 10 comments
Closed

Can't setup integration #15

TheFitzZZ opened this issue May 29, 2020 · 10 comments

Comments

@TheFitzZZ
Copy link

Hey,

first of all thanks for building this integration! Much appreciated!

I just installed the integration and cannot configure it, the credential prompt just repeats itself and the following error is logged:

Protokolldetails ( ERROR )
Logger: custom_components.gardena_smart_system.config_flow
Source: custom_components/gardena_smart_system/config_flow.py:132
Integration: gardena_smart_system (documentation)
First occurred: 11:24:58 (2 occurrences)
Last logged: 11:25:56

Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/gardena_smart_system/config_flow.py", line 70, in async_step_user
    user_input[CONF_CLIENT_ID])
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/gardena_smart_system/config_flow.py", line 132, in try_connection
    smart_system.authenticate()
  File "/usr/local/lib/python3.7/site-packages/gardena/smart_system.py", line 102, in authenticate
    client_id=self.client_id,
  File "/usr/local/lib/python3.7/site-packages/requests_oauthlib/oauth2_session.py", line 360, in fetch_token
    self._client.parse_request_body_response(r.text, scope=self.scope)
  File "/usr/local/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 421, in parse_request_body_response
    self.token = parse_token_response(body, scope=scope)
  File "/usr/local/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 431, in parse_token_response
    validate_token_parameters(params)
  File "/usr/local/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 438, in validate_token_parameters
    raise_from_error(params.get('error'), params)
  File "/usr/local/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/errors.py", line 405, in raise_from_error
    raise cls(**kwargs)
oauthlib.oauth2.rfc6749.errors.InvalidClientError: (invalid_client) Client not found 
  • HA 0.110.3
  • Version c230467
  • Gardena Smart System and Auth API connected
  • Verified e-mail/pw/app id via the curl command on the dev page.

Any help is highly appreciated.

Got 3 Sensors and a Smart Irrigation Control for testing.

Cheers

@thecem
Copy link

thecem commented May 29, 2020

HA restarted?

@TheFitzZZ
Copy link
Author

Yes, multiple times.

@thecem
Copy link

thecem commented May 29, 2020

Which HA installation?
Older Gardena installation in parallel?
Really „Connect new API“ pressed ?

@TheFitzZZ
Copy link
Author

HA Install: Supervised HA on Ubuntu
Older: no
Really: yes, if I'm not misunderstanding anything:
image

Checked logs again:

Logger: gardena.smart_system
Source: custom_components/gardena_smart_system/config_flow.py:133
First occurred: 14:54:37 (2 occurrences)
Last logged: 14:56:16

403 : {'message': 'Forbidden'}

also this:

Logger: custom_components.gardena_smart_system.config_flow
Source: custom_components/gardena_smart_system/config_flow.py:133
Integration: Gardena Smart System (documentation)
First occurred: 14:54:37 (3 occurrences)
Last logged: 15:01:24

Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/gardena_smart_system/config_flow.py", line 70, in async_step_user
    user_input[CONF_CLIENT_ID])
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/gardena_smart_system/config_flow.py", line 133, in try_connection
    smart_system.update_locations()
  File "/usr/local/lib/python3.7/site-packages/gardena/smart_system.py", line 157, in update_locations
    if len(response_data["data"]) < 1:
KeyError: 'data'

I copy/paste all details, and even retried via curl (still works that way) - I don't get it :-/

@thecem
Copy link

thecem commented May 29, 2020

Could you try to reconnect the api? Delete the actual one and create a new?

@osks
Copy link
Owner

osks commented May 29, 2020

For application key/client ID, did you copy and use the application key or the application secret? The correct one is application key, the one you can also see here: https://developer.husqvarnagroup.cloud/apps

@newlund
Copy link

newlund commented May 30, 2020

I'm getting the same error:

Traceback (most recent call last):
File "/config/custom_components/gardena_smart_system/config_flow.py", line 70, in async_step_user
user_input[CONF_CLIENT_ID])
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/gardena_smart_system/config_flow.py", line 133, in try_connection
smart_system.update_locations()
File "/usr/local/lib/python3.7/site-packages/gardena/smart_system.py", line 157, in update_locations
if len(response_data["data"]) < 1:
KeyError: 'data'

@TheFitzZZ
Copy link
Author

TheFitzZZ commented May 30, 2020

@osks yes, using key not secret
@thecem did you mean disconnecting the api's from the app? Did that now, also updated to current version of the integration, HA reboot, again an issue, but a new one:

Logger: custom_components.gardena_smart_system.config_flow
Source: custom_components/gardena_smart_system/config_flow.py:132
Integration: Gardena Smart System (documentation)
First occurred: 12:40:42 (1 occurrences)
Last logged: 12:40:42

Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/gardena_smart_system/config_flow.py", line 70, in async_step_user
    user_input[CONF_CLIENT_ID])
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/gardena_smart_system/config_flow.py", line 132, in try_connection
    smart_system.authenticate()
  File "/usr/local/lib/python3.7/site-packages/gardena/smart_system.py", line 102, in authenticate
    client_id=self.client_id,
  File "/usr/local/lib/python3.7/site-packages/requests_oauthlib/oauth2_session.py", line 360, in fetch_token
    self._client.parse_request_body_response(r.text, scope=self.scope)
  File "/usr/local/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 421, in parse_request_body_response
    self.token = parse_token_response(body, scope=scope)
  File "/usr/local/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 431, in parse_token_response
    validate_token_parameters(params)
  File "/usr/local/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 441, in validate_token_parameters
    raise MissingTokenError(description="Missing access token parameter.")
oauthlib.oauth2.rfc6749.errors.MissingTokenError: (missing_token) Missing access token parameter.

@osks
Copy link
Owner

osks commented May 31, 2020

Could you open an issue in the new repository (py-smart-gardena/hass-gardena-smart-system) and continue there please?

@TheFitzZZ
Copy link
Author

Will do - and also reinstall/resetup everything before that. Thank you.

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

4 participants