Homey Community Forum

[APP][Pro]Mercedes Me App (Release 0.1.2 and Test 0.1.3)

I have published a test version that has the trigger cards for doors, deck lid, windows and sunroof opened and closed.

1 Like

I have some trouble with the app! Can you look into this?
It worked a few days!

Hmm, I will need to check if can handle that error and reauthenticate.
Could you try restarting the app from the Apps section to see if that will force a new login.
I use the Homey OAUTH2 to create the connection so, as far as I know, there is bit of internal magic that should take care of that.

Hehe already tried that! I’m running the experimental version. What is OAUTH2?

OAUTH2 is an authentication protocol. It basically uses the keys you provided to get authorisation to use the account. Part of that process is to return a refresh token that is a one time token used to renew the authorisation when it expires. That way the original keys are not sent out again and therefore reduces the chance of hackers decoding them.
The error message suggests that the authorisation has expired but the refresh token is not valid (maybe already used). The protocol then requires that a new login made with the keys.
It seems that Homey is not doing that part but I don’t know if it is meant to do it automatically or if I need to add extra checks to do it.
I will check the code when I get home this evening.

Great app! I was using the HA app to control certain aspects. But if I can Lock/unlock the car with only this app, it would solve my case.

However I see the option to (in)lock the car. But when pressed in Homey it shows an alert: “Not allowed to change the lock state”. Does that mean this feature is not implemented?

My app uses the official Mercedes API and they don’t allow the locks to be controlled. I hope that one day this will change but I am not sure it will happen. It has been in their experimental product for a long time but that is not available to users.

I think the HA implantation uses a hacked API from the phone app.

1 Like

Did you find out why the app stopped? Now it’s gone 10 days without update.

I haven’t found anything. As far as I can see the Homey OAUTH2 library should automatically handle that error.
Could you try to regenerate the secret on the Mercedes portal and enter it into Homey again?

Already done that without success… Hmmm strange!

Ok found out! I have to erease the car in the units, then replace the car and then log in Mercedes me account.:blush::+1:

1 Like

OK. Hope is keeps working now.

1 Like

Hi Adrian,

I followed your instructions, but get an “unknown error” when trying to create the app. I get past the point where i have to acknowledge what information is requested. The next screen should be the selections of functions i would like to see in Homey. That is the point where the “unknown error” is thrown.

Any idea’s? Am i bound to the build year of the car? I drive an C350e from 2015. I do use the Mercedes.me app and that works.

Greetings Joost

Could you send me the log from the More > Apps > Mercedes Me > Configure app > Log tab. Click on the Send button.

Hi Adrian,

Log has been sent a minute ago. Thanks for your follow up!

Greetings Joost

Hi Adrian,

Found out what the issue was:

“Interface to third party providers” need to be enabled in the mercedes.me app.

Works now :slight_smile:

Greetings Joost

1 Like

Good find. I think I set that option so long ago I had forgotten all about it.

1 Like

The app did not retrieve any data, sent you the log again.

Maybe things need to be enabled in a specific order? I deleted and recreated the project, now i’m stuck with an empty log and the following error:

Okay, uninstalled the app in Homey and reinstall did the trick. Don’t see any data yet, going to take the car for a spin, maybe the car didn’t sent any data to the servers yet.

Keep you posted :wink:

1 Like

I finally got around to looking at your log, sorry it took me so long.
Basically it is saying that the server is not supplying any data for any of the features.
Hopefully once the car starts to send data now the options are enabled it will start to filter through to Homey.