Mercedes Me Binding

Yes, this resolved it. Thanks!

Hi Bernd, it seems the issue has been sorted with the latest version. Range electric value is showing correctly now. Thanks for your help.

1 Like

Got everything working, but still question related to the channel “batteryCapacity”

I’ve added this to my .things file:

Bridge mercedesme:account:4711   "MercedesMe" [ clientId="XXX", clientSecret="XXX", imageApiKey="XXX", callbackIP="192.168.2.20", callbackPort=8090, odoScope=true, vehicleScope=true, lockScope=true, fuelScope=true, evScope=true] {
         Thing bev eqc           "Mercedes EQC"        [ vin="XXX", refreshInterval=5, background=false, night=false, cropped=false, roofOpen=false, format="webp", batteryCapacity=80.0]
}

As you can see, I have added batteryCapacity=80.0.
My battery is 80 kWh and since it’s decimal type I’ve noted 80.0

I have then added following 2 items:

Number:Energy           EQC_charged                 "Charged Battery Energy"                    (gMBC)  {channel="mercedesme:bev:4711:eqc:range#charged"}
Number:Energy           EQC_uncharged               "Uncharged Battery Energy"                  (gMBC)  {channel="mercedesme:bev:4711:eqc:range#uncharged"}

However, the values don’t populate and the state remains at UNDEF.

Have I made a mistake somewhere in the syntax of my things or items file?

Updated to 3.4.0-SNAPSHOT #3086 and get the following account thing error now:

HANDLER_INITIALIZING_ERROR

cannot assign instance of java.time.LocalDateTime to field org.openhab.core.auth.client.oauth2.AccessTokenResponse.createdOn of type java.time.Instant in instance of org.openhab.core.auth.client.oauth2.AccessTokenResponse

Also can’t longer used the callback URL. Get “error connection refused”.

Any idea what this is?

Don’t see issues at the first glance.
Is Battery State of Charge range#soc updated and deliveres a valid percentage value?

  1. Please double check if you’re on the latest version.
  2. Activate TRACE level to have all API responses in the log.
  3. If SoC value is delivered charged and uncharged values are calculated immediately, if batteryCapacity is configured well.
    Otherwise you shall see debug log No battery capacity given

My current assumption:
The Mercedes Me binding is now an official part of openHAB. Especially the members who installed the Marketplace binding before are facing suspicious errors, after update to new Milestone. Root cause seems to be conflicting bundle versions between Marketplace installation and Milestone release.
As said this is an assumption but it matches with a parallel discussion of conflicting bindings.

Please check via this thread if you
a) have 2 times a mercedes bundle with different version and
b) if you can resolve this conflict with the below description

This is caused by an API breaking change introduced in 3.4M2:

So the binding needs to be compiled after this change, i.e. it must be at least as new. To make matters worse, unfortunately this change introduced a regression which has also been fixed, but only after M2:

So if you are able to update to latest snapshot (both core and the binding), everything should be fine. This fix will be included in 3.4M3.

Please let me know if you are seeing anything similar to this after upgrading to latest version.

1 Like

Great support, thanks for this. Works out again.

1 Like

Got it to work with the code that I posted.
I did a clear cache after having also issues with some other items, and it also fixed this issue.

1 Like

Hi regarding my earlier post… i have tried different things with no luck.

updating binding From “old” jar → newest Jar → binding from openhab control panel.

Things file updated with:
batteryCapacity
fuelCapacity

New things file:

Bridge mercedesme:account:7000   "MercedesMe" [clientId="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", clientSecret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", imageApiKey="xxxxxxxxxxxxxxxxxxxxxxxxxx", callbackIP="192.168.0.101", callbackPort=8090, odoScope=true, vehicleScope=true, lockScope=true, fuelScope=true, evScope=true] {
         Thing hybrid A250e      "Mercedes A250e" [vin="xxxxxxxxxxxxxxxxxxxx", refreshInterval=5, background=false, night=false, cropped=false, roofOpen=false, format="webp", batteryCapacity=12.5, fuelCapacity=35.0] 

Updated openhab from 3.3 to 3.4M2 its the same 21-22min between updates and EVERY time starts with and error, after that callback works

2022-09-27 08:04:48.354 [INFO ] [esme.internal.handler.VehicleHandler] - Mercedes A250e:payasyoudrive Error getting data java.io.EOFException: HttpConnectionOverHTTP@1b31c54::DecryptedEndPoint@1f18980{l=/192.168.0.101:47210,r=api.mercedes-benz.com/159.122.71.196:443,OPEN,fill=-,flush=-,to=1283619/0}
2022-09-27 08:04:48.731 [DEBUG] [esme.internal.handler.VehicleHandler] - Mercedes A250e:payasyoudrive Fallback Response 200 [{"odo":{"value":"32247","timestamp":1664257993000}}]
2022-09-27 08:26:13.475 [INFO ] [esme.internal.handler.VehicleHandler] - Mercedes A250e:payasyoudrive Error getting data java.io.EOFException: HttpConnectionOverHTTP@a4d466::DecryptedEndPoint@8b1693{l=/192.168.0.101:48932,r=api.mercedes-benz.com/159.122.71.196:443,OPEN,fill=-,flush=-,to=1283740/0}
2022-09-27 08:26:13.918 [DEBUG] [esme.internal.handler.VehicleHandler] - Mercedes A250e:payasyoudrive Fallback Response 200 [{"odo":{"value":"32247","timestamp":1664257993000}}]
2022-09-27 08:47:28.357 [INFO ] [esme.internal.handler.VehicleHandler] - Mercedes A250e:payasyoudrive Error getting data java.io.EOFException: HttpConnectionOverHTTP@11fdc3d::DecryptedEndPoint@475b7e{l=/192.168.0.101:50652,r=api.mercedes-benz.com/159.122.71.196:443,OPEN,fill=-,flush=-,to=1273408/0}
2022-09-27 08:47:28.825 [DEBUG] [esme.internal.handler.VehicleHandler] - Mercedes A250e:payasyoudrive Fallback Response 200 [{"odo":{"value":"32247","timestamp":1664257993000}}]
2022-09-27 09:08:43.234 [INFO ] [esme.internal.handler.VehicleHandler] - Mercedes A250e:payasyoudrive Error getting data java.io.EOFException: HttpConnectionOverHTTP@139d1ef::DecryptedEndPoint@18a63e0{l=/192.168.0.101:52354,r=api.mercedes-benz.com/159.122.71.196:443,OPEN,fill=-,flush=-,to=1273352/0}
2022-09-27 09:08:43.914 [DEBUG] [esme.internal.handler.VehicleHandler] - Mercedes A250e:payasyoudrive Fallback Response 200 [{"odo":{"value":"32247","timestamp":1664257993000}}]
2022-09-27 09:30:08.362 [INFO ] [esme.internal.handler.VehicleHandler] - Mercedes A250e:payasyoudrive Error getting data java.io.EOFException: HttpConnectionOverHTTP@15d13ab::DecryptedEndPoint@14130b7{l=/192.168.0.101:54064,r=api.mercedes-benz.com/159.122.71.196:443,OPEN,fill=-,flush=-,to=1283553/0}
2022-09-27 09:30:08.688 [DEBUG] [esme.internal.handler.VehicleHandler] - Mercedes A250e:payasyoudrive Fallback Response 200 [{"odo":{"value":"32247","timestamp":1664257993000}}]
2022-09-27 09:51:23.234 [INFO ] [esme.internal.handler.VehicleHandler] - Mercedes A250e:payasyoudrive Error getting data java.io.EOFException: HttpConnectionOverHTTP@1b34df::DecryptedEndPoint@147875a{l=/192.168.0.101:55802,r=api.mercedes-benz.com/159.122.71.196:443,OPEN,fill=-,flush=-,to=1273628/0}
2022-09-27 09:51:23.685 [DEBUG] [esme.internal.handler.VehicleHandler] - Mercedes A250e:payasyoudrive Fallback Response 200 [{"odo":{"value":"32247","timestamp":1664257993000}}]

After Milestone update it seems some users end up to have the mercedes binding installed with different versions. Can you check this

So first step is to have only one version installed, preferably the 3.4.0.M2 version.
Afterwards perform the steps mentioned in previous post

Hi weymann

sorry i forgot to mention that i already check this, but this i what i got.

image

I followed the instructions (at least that’s what I believe) and I manage to authenticate (at least the gateway thing and the car thing are green).
However, items are empty and setting log level to trace shows an HTTP500:

2022-10-04 22:45:35.357 [TRACE] [esme.internal.handler.VehicleHandler] - B250e Odo scope not activated
2022-10-04 22:45:35.358 [TRACE] [esme.internal.handler.VehicleHandler] - B250e Electric Status scope not activated
2022-10-04 22:45:35.358 [TRACE] [esme.internal.handler.VehicleHandler] - B250e Fuel scope not activated
2022-10-04 22:45:35.510 [TRACE] [esme.internal.handler.VehicleHandler] - B250e:vehiclestatus Response 500
            {"errorMessage": "Internal Server Error", "statusCode": "500"}

2022-10-04 22:45:35.511 [TRACE] [esme.internal.handler.VehicleHandler] - B250e Lock scope not activated

I tried various things inluding clean-cache, at no avail.
I deactivated all APIs except the vehicle status to reduce the scope for config / compatibility errors.
I’m a bit at the end of my wits.
I did notice that the json file in the jsondb folder does not exist. But why?
Does anybody have an idea where to look next? I presume that something is wrong with the API requests due to some misconfiguration. Is there a possibility to log the http requests?
Any help would be highly appreciated.

For me the binding stopped working on Thursday 29.09.2022 for unknown reason. Both, account and car are “Online”. Authorization status using the callback URL is “OK”.

Continuing the discussion from Mercedes Me Binding:

I have the same issue. No update since 30/9. The MercedesMe app shows current data but the binding does not update. Things are ONLINE, and no error messages in the logs. Binding is latest version (3.4.0.202208181041).

Glad to hear that I’m not the only one. I can confirm that my app gets data.
@weymann: shall I file an issue on github?

@dk8pn @pune2001 @ulij
I also thought it’s just a problem in my system, but I see it’s a general problem. If you switch on TRACE level I assume you’ll see Internal Server Error 500 for all API calls.

I raised already an issue ~~ towards Mercedes–Benz /developers – The API platform by Mercedes-Benz but I don’t have feedback yet

Feedback:

1 Like

It takes them weeks to respond, let’s be patient :roll_eyes:

Thanks for the update; and for dealing with Mercedes support. And also thanks to mercedes to come back quickly.
Highly appreciated. Let’s see when they will bring that up again. I’ll turn off trace logging then…

The binding is working again here.