MyBMW Binding

Hi @Andy_Co , yes, we could do that. We already checked if there is an issue in the configuration of the addon, but it looks OK. The out of quota issue is caused by BMW, so no possibility to change it anyhow. We can just try to find out what is the maximum frequency how often we could trigger the API without the issue…

@MartinOpenhabFan

Sorry, I mean this case - creating new channel with remaining fuel percent. So could I register issue for that ?

@Andy_Co , sorry, sure, you can open an issue for that. I’m quite busy these days, but maybe I can help you within the next few weeks.

1 Like

Issue registered: [mybmw] Incorrect channel for Fuel Level · Issue #19204 · openhab/openhab-addons · GitHub

I have some issues with the MyBMW binding under OH5. It seems that it stops updating the car Thing. Both the car and account Things are online. The OH log show the following messages:

2025-08-15 17:06:15.516 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
See https://github.com/google/gson/blob/main/Troubleshooting.md#unexpected-json-structure
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:520) ~[?:?]
	at com.google.gson.Gson.fromJson(Gson.java:1361) ~[?:?]
	at com.google.gson.Gson.fromJson(Gson.java:1262) ~[?:?]
	at com.google.gson.Gson.fromJson(Gson.java:1171) ~[?:?]
	at com.google.gson.Gson.fromJson(Gson.java:1107) ~[?:?]
	at org.openhab.binding.mybmw.internal.handler.backend.JsonStringDeserializer.deserializeString(JsonStringDeserializer.java:96) ~[?:?]
	at org.openhab.binding.mybmw.internal.handler.backend.MyBMWHttpProxy.setNextQuotaAttempt(MyBMWHttpProxy.java:452) ~[?:?]
	at org.openhab.binding.mybmw.internal.handler.backend.MyBMWHttpProxy.call(MyBMWHttpProxy.java:419) ~[?:?]
	at org.openhab.binding.mybmw.internal.handler.backend.MyBMWHttpProxy.get(MyBMWHttpProxy.java:347) ~[?:?]
	at org.openhab.binding.mybmw.internal.handler.backend.MyBMWHttpProxy.requestVehicleStateJson(MyBMWHttpProxy.java:229) ~[?:?]
	at org.openhab.binding.mybmw.internal.handler.backend.MyBMWHttpProxy.requestVehicleState(MyBMWHttpProxy.java:216) ~[?:?]
	at org.openhab.binding.mybmw.internal.handler.VehicleHandler.lambda$10(VehicleHandler.java:234) ~[?:?]
	at java.util.Optional.ifPresentOrElse(Optional.java:196) ~[?:?]
	at org.openhab.binding.mybmw.internal.handler.VehicleHandler.lambda$8(VehicleHandler.java:232) ~[?:?]
	at java.util.Optional.ifPresentOrElse(Optional.java:196) ~[?:?]
	at org.openhab.binding.mybmw.internal.handler.VehicleHandler.updateVehicleStatus(VehicleHandler.java:231) ~[?:?]
	at org.openhab.binding.mybmw.internal.handler.VehicleHandler.updateData(VehicleHandler.java:223) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358) ~[?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
	at java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
See https://github.com/google/gson/blob/main/Troubleshooting.md#unexpected-json-structure
	at com.google.gson.stream.JsonReader.unexpectedTokenError(JsonReader.java:1768) ~[?:?]
	at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:469) ~[?:?]
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:509) ~[?:?]

If I restart OH then binding seems to be working. I have had this issue since updating OH from 4.3 to 5.0.

There are “issues” with the BMW API.

https://github.com/home-assistant/core/issues/149750

1 Like

Thanks! As I don’t have an EV it would be great if somebody can report once the limitation is activated. I hope that the general functionality of the API remains working, although this is bad news for the further push of EVs…

I guess it started two days ago :wink:

https://github.com/bimmerconnected/bimmer_connected/issues/740

Hi @weymann,

there is apparently a workaround while modifying the user-agent - see link below. Any chance to get that implemented for us too?

https://github.com/bimmerconnected/bimmer_connected/pull/743/commits/7ba147c0e3caba215561d6023a7f517e447369bd

Thanks!

looks like it’s doable - I’ll try to provide a fix the next days

1 Like

So the fix was quite easy, I just had some issues to run it in my test environment. But in my productive environment it looks like it is working fine. You can download it from GitHub - martingrassl/openhab-mybmw (version 5.0.2, please check for filesize 205114 byte). Please uninstall the binding from the addons and then copy the jar file to the addons folder directly. All things and items should be preserved and at least in my case immediately the binding was up and running again, all things were showing online.

Please create a backup first, I can’t guarantee my changes have some side effects, but I would not expect any. If I get positive feedback from you I’ll create a PR to include it hopefully in 5.1.0.

4 Likes

Martin, as the binding is currently broken without this fix, if we get it reviewed, it may be backported to 5.0 (and maybe even 4.3, not sure how big the impact is) for the next fix release. So the sooner we can get it reviewed, the better.

OK will try to create the PR asap

Success! As recommended I removed the currently installed version and dropped the snapshot download in to /srv/openhab-addons on my OpenHabian installation (file-based config):
/srv/openhab-addons $ ls -l
total 570236
-rw-rw-r-- 1 openhab openhab 583702233 Aug 19 21:48 openhab-addons-5.0.1.kar
-rw-r–r-- 1 openhab openhab 205114 Sep 19 07:44 org.openhab.binding.mybmw-5.0.2-SNAPSHOT.jar
-rw-rw-r-- 1 openhab openhab 70 Aug 19 21:48 README

After putting a new captcha token into the thing config, my “car” thing (representing an ICE) has stayed up for 20 mins now. Will will report back here if I have any special observations. Thanks for your efforts!

It looks like BMW killed the binding now as communicated in July?

Nothing is getting updated except the charging profile somehow. I am using the latest fix, which was working very good for some days. I am also using bmw connected in home assistant. Same issue there…

1 Like

BMW introduced a new CarData API including streaming over MQTT.

Does it work for you? Did some tries to get the data via MQTT for my i4, but I don’t receive any data.

Connection to the server is working with id-token

Not there yet. The whole procedure to get this working seems a bit time-consuming… Did you select the desired attributes for the stream?

I confirm that it stopped, bindings went into “Unknown” status, no updates anymore.
Is there a plan to update the binding or should we try to follow the procedure BMW describes to get our data?

it really looks like the binding is broken now. The cardata API looks promising, but it takes some time until it can be incorporated into the binding. Really bad, but the good thing is that from now on an official API is available, no reverse engineering required anymore

2 Likes