BMW ConnectedDrive Binding

Hi Bernd,
next to the new Binding - should the actual published binding support two accounts?
Mine is mixing up items between things.

Hi Bernd,

items with different values?

  1. .item File (with value, but old?)
  2. created by GUI (NULL)

Nol matter if binding switched to “My BMW” instead of “old” API

Two accounts means you need 2 different bridges. Each bridge with another username and password.
One bridge can handle multiple vehicles. After Bridge creation auto discovery will place the found vehicles into your inbox, but only if you didn’t defined them by hand in *.things files.

Your screenshot shows really a strange situation. Looks like you gave two different vehicles the exact same identifier which could explain this mixup. Did you define things and items files by hand or do you rely on GUI setup?

For your info my thing identifier & item example


I’m pretty sure it’s the old value. last-trip isn`t working anymore in ConnectedDrive Binding.

Yes, there are no more last-trip statistics in the current BMW API. But I’m again curious how you created this in GUI. There’s simply no way to connect an item to a last-trip channel because it’s completly removed. Can you click on this new item with NULL value and check the connected channel?

Hi Bernd,

Sure: 2 bridges with two different accounts (Login/Password) => running.
Two cars as things are autodiscovered in the UI => running.
Test items attached to these channels show this odd behaviour.

Number:Length i3Mileage “I3_Odometer [%d %unit%]” (i3) {channel=“bmwconnecteddrive:bev:676c7c1ab8:WBY8P610707F83711:range#mileage” }
Number:Length x3Mileage “X3_Odometer [%d %unit%]” (i3) {channel=“bmwconnecteddrive:phev:3a49bb0b71:WBATS110209F13533:range#mileage” }

Anyway thats a minor issue I guess, thus the Item Data are read correct from the designated thing.

For API function degradation I agree - and found proof.
Since 9.11. no more update of “trip consumption”.
But my own calculation based on total mileage / %charging*40kWh works fine (blue area)

I guess I will give your new binding “My BMW” a try next week. Are they compatible, or should I deactivate to old one beforehand?

Screenshots look similiar to my situation except that all of my items are missing the analyze function (no data shown in GUI Diagramms). Something odd with persistency I guess (MapDB, RRD4J, JDBC in parallel).

Maybe the log is helpful: There is a difference whether I choose the “Use My BMW” Button in the binding or not



2022-01-04 19:28:06.395 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 

java.lang.NullPointerException: null

	at org.eclipse.jetty.util.UrlEncoded.decodeTo(UrlEncoded.java:238) ~[?:?]

	at org.openhab.binding.bmwconnecteddrive.internal.handler.ConnectedDriveProxy.codeFromUrl(ConnectedDriveProxy.java:446) ~[?:?]

	at org.openhab.binding.bmwconnecteddrive.internal.handler.ConnectedDriveProxy.updateToken(ConnectedDriveProxy.java:303) ~[?:?]

	at org.openhab.binding.bmwconnecteddrive.internal.handler.ConnectedDriveProxy.getToken(ConnectedDriveProxy.java:252) ~[?:?]

	at org.openhab.binding.bmwconnecteddrive.internal.handler.ConnectedDriveProxy.call(ConnectedDriveProxy.java:144) ~[?:?]

	at org.openhab.binding.bmwconnecteddrive.internal.handler.ConnectedDriveProxy.get(ConnectedDriveProxy.java:177) ~[?:?]

	at org.openhab.binding.bmwconnecteddrive.internal.handler.ConnectedDriveProxy.requestVehcileStatus(ConnectedDriveProxy.java:189) ~[?:?]

	at org.openhab.binding.bmwconnecteddrive.internal.handler.VehicleHandler.lambda$24(VehicleHandler.java:279) ~[?:?]

	at java.util.Optional.ifPresentOrElse(Optional.java:201) ~[?:?]

	at org.openhab.binding.bmwconnecteddrive.internal.handler.VehicleHandler.lambda$22(VehicleHandler.java:275) ~[?:?]

	at java.util.Optional.ifPresentOrElse(Optional.java:201) ~[?:?]

	at org.openhab.binding.bmwconnecteddrive.internal.handler.VehicleHandler.getData(VehicleHandler.java:274) ~[?:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]

	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]

	at java.lang.Thread.run(Thread.java:829) [?:?]

2022-01-04 19:28:18.876 [INFO ] [internal.handler.ConnectedDriveProxy] - Token valid? true

Really curious. Setup looks find at the first glance. Still unknown why the Thing mixes up the items.

For me it looks good, have both bindings running in parallel.

This button was my first try to introduce the new API - that’s why I put it into Advanced Options. I recommend not to use it - it’s a dead end!

Hi,

until now i am using the BMWConnectedDrive Binding, but since some time the connection to bmw is broken.

I already noticed, that there is a “new” binding at the marketplace: “MyBMW binding add-on”

Can i replace the old binding by the new one or do i have to do major changes at things and items? Is there a recommended migration path?

Thanks, Alex

I’ve just tried this, and worked without any issue!

I’m using text files for my items, so I just had to update the channel ID’s

2min work


1 Like

I’ve done the following:
I installed MyBMW binding in parallel and created mybmw vehicle thing. I unlinked the mileage item from ConnectedDrive thing and linked it to MyBMW thing in order to keep the persisted history data. If you want to preserve some more history (soc, ranges, 
) do the same for the desired items.

With this one time manual migration the previous collected data from BMW ConnectedDrive binding isn’t lost.

1 Like

Hi and thanks for that advice - mapped all the items from the old binding to the new one.

The following items i couldnt map or i am not sure about.

  • doors#win-rear i didnt fint at the new binding - is this correct?
  • check#mileage seems to be outdated or is it check#details now?
  • destination#name & gps dont appear at the new binding or is it location#address now and can it be used to send destinations to the car?

Thanks, Alex

Is anyone getting error messages lately with this binding? I keep getting this, fresh install OH3.2
 Everything else works fine but this.

2022-03-28 22:40:09.043 [WARN ] [internal.handler.ConnectedDriveProxy] - Server returned HTTP response code: 401 for URL: https://customer.bmwgroup.com/gcdm/oauth/authenticate
2022-03-28 22:40:09.329 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.NullPointerException: null
        at org.eclipse.jetty.util.UrlEncoded.decodeTo(UrlEncoded.java:238) ~[?:?]
        at org.openhab.binding.bmwconnecteddrive.internal.handler.ConnectedDriveProxy.codeFromUrl(ConnectedDriveProxy.java:446) ~[?:?]
        at org.openhab.binding.bmwconnecteddrive.internal.handler.ConnectedDriveProxy.updateToken(ConnectedDriveProxy.java:303) ~[?:?]
        at org.openhab.binding.bmwconnecteddrive.internal.handler.ConnectedDriveProxy.getToken(ConnectedDriveProxy.java:259) ~[?:?]
        at org.openhab.binding.bmwconnecteddrive.internal.handler.ConnectedDriveProxy.call(ConnectedDriveProxy.java:144) ~[?:?]
        at org.openhab.binding.bmwconnecteddrive.internal.handler.ConnectedDriveProxy.get(ConnectedDriveProxy.java:177) ~[?:?]
        at org.openhab.binding.bmwconnecteddrive.internal.handler.ConnectedDriveProxy.requestVehicles(ConnectedDriveProxy.java:185) ~[?:?]
        at org.openhab.binding.bmwconnecteddrive.internal.handler.ConnectedDriveBridgeHandler.lambda$3(ConnectedDriveBridgeHandler.java:116) ~[?:?]
        at java.util.Optional.ifPresent(Optional.java:183) ~[?:?]
        at org.openhab.binding.bmwconnecteddrive.internal.handler.ConnectedDriveBridgeHandler.requestVehicles(ConnectedDriveBridgeHandler.java:116) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:829) [?:?]

Binding ConnectedDrive isn’t working anymore since Feb. Please check MyBMW binding

1 Like

Thank you, I missed that somehow during the install!
Should the old binding maybe removed from the list if it’s not working anymore? Thanks again!

Hi,

I have a conventional BMW. Is it possible to track my ways? I know that there is a item for electric cars, but is there any process to have a map showing all ways I did.

I am a newbie .

Thanks a lot for your help

Regards

C

Hi @Claude5555 it will depend on the model and age of your car. BMW have changed what information they collect and publish, for example I have a 2012 M5 that used to publish it’s location via the app but no longer does. My wife has a 2021 Mini Cooper and that tracks every location the car stops at, you have to enable the setting in the cars settings for this to work.

Hi Maximo

My car is 2021. Which setting have I to activate?

How do you get a map in OH with the road you took? Is it possible to keep a history?

Thanks a lot for your help

Kind regards

Claude

It should be possible then if you have ConnectedDrive and you have enabled it inside the car.
Use the MyBMW binding from the “Community Marketplace” from the bindings.
image

The setup is quite easy.
As for history: yes and no. The road you took is not there (at least in my case) as the car seems to update its position toward BMW on certain events (door open/close). So while driving it doesn’t necessarily update the position in my experience (G30 2017).

Hi and thanks for your help and answer.

I already set up MyBMW bonding add-on and I get an update of my position, but just the update. I don’t get a map with the history of the way I used. Just the last position.

Maybe there is another way to get it.

Thanks

Kind regards