Mercedes Me Binding

Hi this morning i downloade the new version, stopped openhab, delete the old file, copy new file into folder, restarted openhab.

but is nearly still the same, now it tells me the theres no battery capacity given

I can see data regarding battery i changing

Info: im runing file based config

Regards Mads

Ok, I see.

No battery / fuel capacity isn’t a crucial problem and doesn’t harm the functionality. There are 2 newer config parameters which you can apply, see the actual readme


Based on soc and fuel level the binding is calculating how many kWh / liters

  • are still available
  • needs to be filled up for reaching 100%

These are also additional channels which are sadly not present after a simple reboot. This is a known problem and can only be solved via deleting and creating things again.
If you’ve textual configuration remove things file shortly and place it back again. Then the new channels shall appear and debug messages are gone!

Maybe this will solve also the 20 minutes updates which I cannot explain at the moment.

Hi, i have an issue with the electric range with my hybrid car. It seems that it somehow calculates the total range ( fuel plus electric ) when the item is updated.

2022-09-07 07:48:00.440 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'GLC_Range_Electric' changed from 135 km to 0 km
2022-09-07 07:48:00.760 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'GLC_Range_Electric' changed from 0 km to 135 km
2022-09-07 07:53:01.161 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'GLC_Range_Electric' changed from 135 km to 0 km
2022-09-07 07:53:01.566 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'GLC_Range_Electric' changed from 0 km to 135 km
2022-09-07 07:58:01.834 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'GLC_Range_Electric' changed from 135 km to 0 km
2022-09-07 07:58:02.280 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'GLC_Range_Electric' changed from 0 km to 135 km
2022-09-07 08:03:02.572 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'GLC_Range_Electric' changed from 135 km to 0 km
2022-09-07 08:03:02.909 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'GLC_Range_Electric' changed from 0 km to 135 km
2022-09-07 08:08:03.244 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'GLC_Range_Electric' changed from 135 km to 0 km
2022-09-07 08:08:03.721 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'GLC_Range_Electric' changed from 0 km to 135 km
2022-09-07 08:13:03.966 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'GLC_Range_Electric' changed from 135 km to 0 km
2022-09-07 08:13:04.477 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'GLC_Range_Electric' changed from 0 km to 135 km
2022-09-07 08:18:04.812 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'GLC_Range_Electric' changed from 135 km to 0 km
2022-09-07 08:18:05.169 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'GLC_Range_Electric' changed from 0 km to 135 km
2022-09-07 08:23:05.552 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'GLC_Range_Electric' changed from 135 km to 0 km
2022-09-07 08:23:05.939 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'GLC_Range_Electric' changed from 0 km to 135 km

mercedesme:hybrid:MercedesGLC:range#range-electric

Any thoughts on that one?
Thanks

This looks curious, I’ll check this issue

1 Like

For hybrid vehicle you’ll have

  • range-electric
  • range-fuel
  • range-hybrid → not given by Mercedes API - I sum them up inside the binding

What’s curious in the trace above is the flipping of range_electric during an update from orig value to 0 and then back again => this shall not happen. Also in my tests I cannot see this.

Please perform the following steps:

  • check on your side if you’ve the latest version installed. During development several changes were done. Link to actual jar is available on top post
  • Log into openHAB console and change debug level to TRACE: log:set TRACE org.openhab.binding.mercedesme
  • if problem still occurs send logs via private message or in this thread for further analysis

Thanks Bernd, I will have a look and let you know if the issue persists.

Unable to get it to work.
For some reason I get a very strange callback URL in openhab:

It is nevertheless configured as http://192.168.2.20:8090/mb-callback in the Mercedes API credentials and 192.168.2.20 is mentioned in my .things configuration (callbackIp)

Ahh sh*t, there’s a typo in the code which needs to be corrected.

Just to get it running:
change callbackIp to callbackIP in things config in order to check if it’s working.

1 Like

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