Read the statement by Michael Teeuw here.
MMM-MercedesMe
-
@ashishtank Just one thing that I saw…Step 7 has your Client ID and Secret uncovered. I highly recommend to blur it if it’s still an active account :/
-
@pyrophoenix Hi Looks like you found the issue for me :) the vehicle type right now i am checking is only Electric (default) and Diesel. I will improve the code to check for petrol as well but you can have a work around and can configure your vehicle type as
'diesel'
and it will work as api is same for diesel and petrol !getVehicleDataUrl: function (config) { ...... var vehicleStatus = 'electricvehicle'; switch (config.vehicleType.toLowerCase()) { case 'diesel': <----------------------------------------------------------------------------- vehicleStatus = 'fuelstatus'; ......
About my sample client id and secret in guide they are fine as I do not have a Car :D and also that account and app are throw away account with out any real car linked to it.
Let me know if changing the config to diesel and restarting mirror solves the issue.
-
@ashishtank Thanks for the reply!
I have erased token and reboot it with Diesel…Still the same issue but this time it goes to the correct URL
[08.04.2021 13:38.22.939] [LOG] Handle OAuth request [08.04.2021 13:38.22.946] [LOG] https://id.mercedes-benz.com/as/authorization.oauth2?response_type=code&client_id=c****************4a&&redirect_uri=http://localhost:8080/MMM-MercedesMe/callback&scope=mb:vehicle:mbdata:vehiclestatus offline_access&state=d*************************e [08.04.2021 13:38.25.124] [INFO] Newsfeed-Fetcher: Broadcasting 66 items. [08.04.2021 13:38.26.049] [LOG] Handle OAuth callback [08.04.2021 13:38.26.982] [LOG] OAuth callback Success [08.04.2021 13:38.34.388] [LOG] Vehicle data url https://api.mercedes-benz.com/vehicledata/v2/vehicles/W1****************9/containers/fuelstatus [08.04.2021 13:38.35.647] [LOG] 403 - Forbidden
It is still saying error 403
-
@pyrophoenix did you followed the step 3 correctly ? did you linked fuel status scope with app ? as shown in image below you should see
Fuel Status BYOCAR -
Thanks! Great that YOU point it out! I cheated a bit and directly put the “fuel” on the URL as so
https://developer.mercedes-benz.com/products/fuel_status/get_access?pm=free
I just added it and I’ll try now.
-
Not working…But it seems that the Bearer is not generated properly. If I try the test curl provided by the Mercedes Dev, it does work…
-
@pyrophoenix Can you delete the app in Mercedes dev portal and create new one with correct scope ? also delete tokens.json file and restart the mirror. I think it is some caching issue.
-
@ashishtank Remove and did a brand new app on console. Removed tokens.json and reboot…Same problem
There is one thing that is on your step (Right from step 1) saying:
AUTH CALLBACK URL: http://localhost
Where that needs to be introduced?
-
image url)
-
@pyrophoenix things looks correct, http://localhost:8080/MMM_MercedesMe/callback is important other localhost urls in callback are optional. I have sent you PM what we can do next.