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

HACS installation tested and aprooved? #25

Closed
andilge opened this issue Jan 8, 2021 · 15 comments
Closed

HACS installation tested and aprooved? #25

andilge opened this issue Jan 8, 2021 · 15 comments

Comments

@andilge
Copy link

andilge commented Jan 8, 2021

Is it only me or generally HACS installation won't integrate mercedes_me_api successfully?

@townsmcp
Copy link

townsmcp commented Jan 8, 2021

Same here. I thought it might be due to the url setting in Mercedes website when setting up the oauth but when I run the scripts from my laptop to authorise the token generation the web page goes blank

@xraver
Copy link
Owner

xraver commented Jan 8, 2021 via email

@townsmcp
Copy link

townsmcp commented Jan 8, 2021

@xraver when I run the python script, I get the message saying to open a browser window and insert the following link (I've removed my client_id):

https://id.mercedes-benz.com/as/authorization.oauth2?response_type=code&client_id=XXX-XXX-XXX-XXX-XXX&redirect_uri=https://localhost&scope=mb:vehicle:mbdata:fuelstatus%20mb:vehicle:mbdata:vehiclestatus%20mb:vehicle:mbdata:vehiclelock%20mb:vehicle:mbdata:evstatus%20mb:vehicle:mbdata:payasyoudrive%20offline_access

However when I copy paste this to a browse window the page doesn't load and I get the following address:

https://localhost/?error_description=The+requested+scope+is+invalid%2C+unknown%2C+malformed%2C+or+exceeds+that+which+the+client+is+permitted+to+request.&error=invalid_scope#

And the content of the token file shows:

{"error_description":"Authorization code is malformed.","error":"invalid_grant"}

@Evilfraggle
Copy link

Same here, but I get in the browser a "ERR_CONNECTION_REFUSED" Message

@xraver
Copy link
Owner

xraver commented Jan 8, 2021 via email

@Evilfraggle
Copy link

Hi, seems that the requested scope is invalid... try to exit from the mercedes me session, use the link again and provide credentials. the first time systems will require to accept the APIs. then when you will be redirected to the url just copy in the script only the code. i've tried again and it works for me.... Il giorno ven 8 gen 2021 alle ore 17:19 Evilfraggle < notifications@github.com> ha scritto:

Same here, but I get in the browser a "ERR_CONNECTION_REFUSED" Message — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#25 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALJM7A7G6W24GZYUYSVVK4TSY4WA5ANCNFSM4V2PLRCQ .

Thanks for the respond.
My fault was not to register ALL APIs, but just some of them. Now it works 👍

@townsmcp
Copy link

townsmcp commented Jan 8, 2021

@Evilfraggle same here for me too!!! I don't have the insurance so didn't register for that API. Register for it and the registration works for me

@townsmcp
Copy link

townsmcp commented Jan 8, 2021

hmmmm not so sure about this. I have tried 0.9, 0.10 (with 'enable_resources_file: False and 'enable_resources_file: True', 'scan_interval: 120' and leaving scan_interval out of configuration.yaml) in HACS all to no avail. When I use the .sh or .py script I get the following:

James@James-MacBook-Pro mercedes_me_api-master % ./mercedes_me_api.sh -s
mercedes_me_api.sh - 0.6

Retrieving decklidstatus:

Retrieving doorstatusfrontleft:

Retrieving doorstatusfrontright:

Retrieving doorstatusrearleft:

Retrieving doorstatusrearright:

Retrieving interiorLightsFront:

Retrieving interiorLightsRear:

Retrieving lightswitchposition:

Retrieving readingLampFrontLeft:

Retrieving readingLampFrontRight:

Retrieving rooftopstatus:

Retrieving sunroofstatus:

Retrieving windowstatusfrontleft:

Retrieving windowstatusfrontright:

Retrieving windowstatusrearleft:

Retrieving windowstatusrearright:

No data is returned by the script :( same for the entities in HA - status is unknown even after reboots

@xraver
Copy link
Owner

xraver commented Jan 9, 2021 via email

@andilge
Copy link
Author

andilge commented Jan 9, 2021

I've cloned the repo on my Ubuntu computer and have been able to create the .mercedesme_token file with success, content looks fine.

Where exactly should I place the token file now, in
homeassistant/custom_components/mercedesmeapi
?

After this, will I need to add the integration in Home Assistant as well?

@danielrheinbay
Copy link
Contributor

The token file needs to be placed in your homeassistant config folder. It's the same folder where you place your Home Assistant's configuration.yaml.

Speaking of which, yes, you need to enable the integration by adding its configuration to your configuration.yaml as described in the README.

@andilge
Copy link
Author

andilge commented Jan 9, 2021

figured out the config folder and yes, configuration.yaml is filled as well. No i have errors about the resource files.

Logger: custom_components.mercedesmeapi.resources
Source: custom_components/mercedesmeapi/resources.py:159
Integration: mercedesmeapi (documentation, issues)
First occurred: 23:36:04 (1 occurrences)
Last logged: 23:36:04
Error retrieving available resources - Generic Error (504)

@andilge
Copy link
Author

andilge commented Jan 9, 2021

changing enable_resources_file from true to false didn't make things get better.

here my configuration:

mercedesmeapi:
  client_id: !secret mercedesapi_client_id
  client_secret: !secret mercedesapi_client_secret
  vehicle_id: abcd1234
  enable_resources_file: false
  scan_interval: 120

@andilge
Copy link
Author

andilge commented Jan 10, 2021

continuing this in Integration failed to initialize #28

@andilge andilge changed the title HACS installation tested and aprooved HACS installation tested and aprooved? Jan 10, 2021
@andilge andilge closed this as completed Jan 10, 2021
@andilge
Copy link
Author

andilge commented Jan 10, 2021

HACS installation working

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

5 participants