Closed gurtjun closed 2 months ago
This should resolve #181
Hello @gurtjun,
Just a simple question.
Did you test your PR? And if so, did it work?
It is not possible to add new scopes to the list of scopes. However, you can remove existing scopes, if you want that.
So, you cannot add: energy:charging_current_limit
and energy:estimated_charging_time
If you add it to the list of scopes the Volvo API will return an error:
error_description: "The requested scope is invalid, unknown, malformed, or exceeds that which the client is permitted to request."
error: "invalid_scope"
It does not match with the "client" authorization.
Sorry for that, but it is the way it currently is.
Regards
Hello @gurtjun,
Just a simple question.
Did you test your PR? And if so, did it work?
It is not possible to add new scopes to the list of scopes. However, you can remove existing scopes, if you want that. So, you cannot add:
energy:charging_current_limit
andenergy:estimated_charging_time
If you add it to the list of scopes the Volvo API will return an error:
error_description: "The requested scope is invalid, unknown, malformed, or exceeds that which the client is permitted to request." error: "invalid_scope"
It does not match with the "client" authorization.
Sorry for that, but it is the way it currently is.
Regards
No, did not test this yet. Therefore the pull request.
Sorry,
It will not work
Regards
Ok, will try manually tomorrow
Sorry,
It will not work
Regards
Indeed, just did several tests and get the same result when adding the new scopes...
Maybe this gets resolved in version v1.9.0b1 (when using OTP authentication). But I'm unable to install the beta version. When logging into Volvo's developer portal I'm able to retrieve the charging current limit and target battery percentage using my Volvo ID and the VCC-API-KEY
@Dielee I was able to install version v1.9.0b1 but I don't get the OTP code in my mailbox 🙁 I can see the following logs but eventually the add-on fails to start
volvo2mqtt [106] - INFO: Waiting for otp code... Please check your mailbox and post your otp code to the following mqtt topic "volvoAAOS2mqtt/otp_code". Retry 3/15
@Dielee seems that there was quite a delay on receiving the email at my side, eventually filled in the OTP code and it started loading all the available sensors 🙌
However, when updating the addon locally and restarting it, after filling in the OTP code again I do get an error response from the get_token(auth_session, data)
method in volvo.py
@Dielee nevermind, reinstalled everything and now version 1.9.0b1 works like a charm. Restarted home assistant, everything keeps working. Only when I restart the add-on, I need to fill in the OTP code again.
Please do not mix the new OTP authentication with your PR. I will check your PR later this week. For the OTP auth discussion, open up a new issue and don't hijack this PR.
Thanks!
Please do not mix the new OTP authentication with your PR. I will check your PR later this week. For the OTP auth discussion, open up a new issue and don't hijack this PR.
Thanks!
Good point! Regarding this PR: from the moment I add the scopes to the request things go wrong (also in OTP branch)
So, the new scopes are not working at this time.
The requested scope is invalid, unknown, malformed, or exceeds that which the client is permitted to request.
Because of this, I will not merge this PR. Sorry!
So, the new scopes are not working at this time.
The requested scope is invalid, unknown, malformed, or exceeds that which the client is permitted to request.
Because of this, I will not merge this PR. Sorry!
Ok, could it be that the new scopes need to be requested first for the client application in Volvo’s developer portal?
If I want to publish my own application to get the client id and secret I need to select the scopes I want to use:
Yes, maybe. I tried to publish an application for more than 3 months without any success. So, it could help.... nobody knows.
Not sure if this is all that's needed to get the 2 new sensors into Home Assistant.