Mercedes Me Binding

The binding is working again here.

Here as well, gently filling with data now :slight_smile:
Many thanks to Bernd for his quick action!

Have received an email from Mercedes-Benz today. They are going to introduce API changes which require action of users on 2nd of November latest. Credentials need to be updated. They will advise more details if the date comes closer.

I received this message too. The description looks pretty straight forward Mercedes–Benz /developers – The API platform by Mercedes-Benz

  1. re-create credentials
  2. change server addresses
  3. adjust scopes
  4. handle JWT token

While1-3 looks quite easy I’m struggling with 4). I contacted Mercedes but there’s no test environment and even no JWT test token available to check the new behavior in beforehand.

I fear I’ve to check after migration how this shall work. To be honest I cannot tell how long it takes to bring the binding to work after migration on Nov. 2th

Changed my credentials. Account and car are “Online”. But i get the following errors in openhab.log:

2022-11-02 11:07:50.104 [INFO ] [esme.internal.handler.VehicleHandler] - Mercedes Benz WN-PW 360:fuelstatus Error getting data org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: Authentication challenge without WWW-Authenticate header
2022-11-02 11:07:50.245 [INFO ] [esme.internal.handler.VehicleHandler] - Mercedes Benz WN-PW 360:vehiclestatus Error getting data org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: Authentication challenge without WWW-Authenticate header
2022-11-02 11:07:50.389 [INFO ] [esme.internal.handler.VehicleHandler] - Mercedes Benz WN-PW 360:vehiclelockstatus Error getting data org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: Authentication challenge without WWW-Authenticate header

Old Authentication worked for me the whole day so I was able to test the Migration steps in parallel.
Now it seems to run => Version 1.1 contains all necessary changes

Steps I performed

1 Like

Works out as expected. Many thanks for this quick adaptation.

I installed the MerdedesMe Binding via Marketplace in OH 3.3 (stable). The items are also updated. Except for the range channels (range-fuel, radius-fuel, fuel-remain and fuel-open), these are not updated and remain unchanged at “NULL”. If I read it correctly, these are automatically calculated when specifying the “fuelCapacity” in the configuration.
Is there a reason this isn’t working for me?

I think you need to manually set the capacity in the vehicle thing properties to make that work.

Thing combustion w246 “Mercedes B-Klasse” [ vin=“XXXXXXXXXXXXXXXX”, refreshInterval=1, background=true, night=true, cropped=false, roofOpen=false, format=“webp”, fuelCapacity=55.0]

I did it too. So I’m surprised it doesn’t work???

@weymann just for my understanding can you please explain what part of the car are the following? I think it is a kind of Deutsch-lish so its not clear in English…

  • ‘deck-lid’
  • ‘flap’

Even if you try to directly translate it into German it is unclear.
I believe it is the two thingies covering the charging plug.
I can’t verify at the moment because it’s online but the car is not sending data. As usual. Unfortunately all this remote stuff only works when you don’t need it…

1 Like

I checked it again with the openhab log viewer. The car sent the data for “fuel-level”. The value of the item has also changed. I could see this in the log viewer. But in the log viewer you can also see that the values ​​for the items “range-fuel, radius-fuel, fuel-remain and fuel-open” are not updated or calculated. Neither a changed nor an error message can be seen. As things stand, I’d say the binding doesn’t do the computation. Does anyone have an idea why this might be? I had specified the fuel capacity in the config of the vehicle.

It did work for me until the latest API changes.
Not sure if it helps, it‘s more of trial and error, but sometimes openhab-cli clean-cache does miracles.

That’s the first thing I did after adding the capacity in the config. After that didn’t work, I removed and re-added the things including the bridge and items. That didn’t work either. After that I reported here. Do you have another idea?

I’m afraid I am at the end of my wits.
Unfortunately I cannot check if it wors in my configuration because I cannot authenticate since the recent API changes. Even though I regenerated my credentials, authentication fails.
I guess I need to wait for the next openhab milestone. I’ll try as soon as I got that back up and running.

Using the new credentials model, and the latest JAR file from @weymann 's drop location on GitHub, I see the following log errors. => Any ideas?

2022-11-22 13:19:18.759 [INFO ] [esme.internal.handler.VehicleHandler] - A250:payasyoudrive Error getting data org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: Authentication challenge without WWW-Authenticate header
2022-11-22 13:19:18.969 [INFO ] [esme.internal.handler.VehicleHandler] - A250:fuelstatus Error getting data org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: Authentication challenge without WWW-Authenticate header
2022-11-22 13:19:19.190 [INFO ] [esme.internal.handler.VehicleHandler] - A250:vehiclestatus Error getting data org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: Authentication challenge without WWW-Authenticate header
2022-11-22 13:19:19.402 [INFO ] [esme.internal.handler.VehicleHandler] - A250:vehiclelockstatus Error getting data org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: Authentication challenge without WWW-Authenticate header

I just updated the jar file as well and it didn’t fix the issue (tried the usual stuff as well including clean-cache, rebooting, …)
As the next milestone release is planned for the 27th I’ll wait for that.

Yes, I tried all the same things as you, with the same lack of result. So I will also wait for M5…

Just for info: on M5 it NOW works for me :slight_smile: