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

Problem with the Integration #21

Open
Johnyyy85 opened this issue May 30, 2020 · 17 comments
Open

Problem with the Integration #21

Johnyyy85 opened this issue May 30, 2020 · 17 comments

Comments

@Johnyyy85
Copy link

Hi,

When i click on the integration "Gardena Smart System" and enter my API key and password, nothing happens.

I get this error message:

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: 18:05:30 (1 occurrences)
Last logged: 18:05:30

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.InvalidGrantError: (invalid_grant) The provided access grant is invalid, expired, or revoked.

@northpower25
Copy link

Du you have connectet your Application Key to the APIs on the Husquarna Side?

F18F59EE-FFF9-41C7-94BD-462094544200

@Johnyyy85
Copy link
Author

Yes, I have both except Automower Connect.

@Johnyyy85
Copy link
Author

Logger: gardena.smart_system
Source: custom_components/gardena_smart_system/config_flow.py:133
First occurred: 19:08:15 (3 occurrences)
Last logged: 19:09:41

403 : {'message': 'Forbidden'}

@Johnyyy85
Copy link
Author

i did the installation manually. Could something have gone wrong there?
Is there anything else i should do? should i enter something in the configuration.yaml?

@northpower25
Copy link

Normaly the installation is only need over the settings -> integration gui in hass normaly you need no manual settings in configuration.yaml if you have settings for gardena please comment it out an make the integration settings direct with the gui

@Johnyyy85
Copy link
Author

Thanks for your help.
Iäm sorry but i dont really understand.. I have nothing in my configuration.yaml file.

please tell me what to do :)
Thanks a lot!

@Johnyyy85
Copy link
Author

I entered the text below. And the only thing that was a little bit strange was the last line. I didn't get answer in the terminal. I don't know if that is normal or not. Anyway.. i can see that i have everthing installed in the folder custom components.

cd ///
git clone https://github.com/osks/hass-gardena-smart-system.git
mkdir custom_components (if not exist)
cd custom_components
ln -s ../hass-gardena-smart-system/custom_components/gardena_smart_system

@northpower25
Copy link

Have you set your external URL?
B533C527-2202-4185-BDCC-69531648177B

@Johnyyy85
Copy link
Author

My external was already there. I have updated with my internal now, but it doesn't help :(

@Johnyyy85
Copy link
Author

Still get this error:

Logginformation (ERROR)
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: 19:08:15 (5 occurrences)
Last logged: 20:53:48

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'

@northpower25
Copy link

northpower25 commented May 30, 2020

I entered the text below. And the only thing that was a little bit strange was the last line. I didn't get answer in the terminal. I don't know if that is normal or not. Anyway.. i can see that i have everthing installed in the folder custom components.

cd ///
git clone https://github.com/osks/hass-gardena-smart-system.git
mkdir custom_components (if not exist)
cd custom_components
ln -s ../hass-gardena-smart-system/custom_components/gardena_smart_system

Why do you have do so much? i‘ve only install it over hacs (You can otherwise copy the Filens manual in the custom_integrations folder) and make the settings over the settings-> integration -> search vor the integration and it works propably. 🤔

@Johnyyy85
Copy link
Author

I have now installed it with HACS. Still doesn't work. Nothing happens after i click OK. I type in mail, pw and token, but nothing happens when i click OK :(

@Johnyyy85
Copy link
Author

i get this:

Logginformation (ERROR)
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: 0:12:38 (3 occurrences)
Last logged: 0:15:13

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'

@Jpsy
Copy link
Contributor

Jpsy commented May 31, 2020

cd ///
git clone https://github.com/osks/hass-gardena-smart-system.git
mkdir custom_components (if not exist)
cd custom_components
ln -s ../hass-gardena-smart-system/custom_components/gardena_smart_system

Did you really enter it like this?
If so, then the first and the third command are completely broken and you created a symlink into the void.
To clean up check your custom_components folder and remove the symlink. Check whether you cloned the repo into the root folder of your system or into the home folder of your terminal user and delete it there.
Then use HACS.

@Johnyyy85
Copy link
Author

I deleted the folder and installed it with HACS.
It looks like this now, but it looked liked that before aswell

image

@osks
Copy link
Owner

osks commented May 31, 2020

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'

This exception comes from bad handling of the response, which may hide the real issue.

@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?

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