BMW ConnectedDrive Binding

Hi there,
Thanks for the binding, couldn’t wait to test it.

I’m running into a problem retrieving car information:
I start by defining a ConnectDrive Account bridge. This works, it comes online and creating a BMWConnectedDrive thing immediately retrieves my car info.
Adding it as a thing, it shows up with a label next to it: OFFLINE - COMMUNICATION_ERROR.
Debug log show only:

2020-09-24 20:05:31.815 [DEBUG] [onnecteddrive.internal.handler.ConnectedDriveProxy] - HTTP Error https://b2vapi.bmwgroup.com/webapi/v1/user/vehicles/WBA5G51040D179730/status - 404 - Not Found{}
2020-09-24 20:05:31.815 [DEBUG] [.bmwconnecteddrive.internal.handler.VehicleHandler] - https://b2vapi.bmwgroup.com/webapi/v1/user/vehicles/WBA5G51040D179730/status - 404 - Not Found{}

Am I doing something wrong?

Setup sounds good. For debugging there’s the possibility to generate log entries for the retrived data. See Readme.md Troubleshoot section.

So for first analysis a Vehicle Fingerprint is needed which is generated with a Switch from the Vehicle Thing. If you send me a message I can have a look.

Hello @weymann,

Thank you for the update!

Service
‘Next Service Mileage’ item (in the status group) value is still ‘- -’ (car display says ‘Jan 2020 - 28.000 km’)
I checked my items and sitemap configurations, they are connected to channel ‘Mileage till Next Service’ as I think is right.

Scrolling through the scheduled services seems to work fine.
When I am in service index nr. 2 the Service Mileage item is -1 km (Service Name: Brake Fluid).
I think you intended that to indicate this service is planned by a fixed date and not a mileage.

Doors & Windows
Great! I checked all the door and window state items and they work as expected.

Hereby again my actual Vehicle Troubleshoot Fingerprint Data in case you need it:

2020-09-28 15:18:01.697 [WARN ] [rive.internal.handler.VehicleHandler] - ### Discovery Result ###
2020-09-28 15:18:01.699 [WARN ] [rive.internal.handler.VehicleHandler] - {"vehicles":[{"vin":"ANONYMOUS","model":"318i","driveTrain":"CONV","brand":"BMW","yearOfConstruction":2019,"bodytype":"F31","color":"MINERALGRAU METALLIC","statisticsCommunityEnabled":false,"statisticsAvailable":false,"hasAlarmSystem":true,"dealer":{"name":"ANONYMOUS","street":"ANONYMOUS","postalCode":"ANONYMOUS","city":"ANONYMOUS","country":"ANONYMOUS","phone":"ANONYMOUS"},"breakdownNumber":"ANONYMOUS","chargingControl":"NOT_SUPPORTED","vehicleFinder":"ACTIVATED","hornBlow":"ACTIVATED","lightFlash":"ACTIVATED","doorLock":"ACTIVATED","doorUnlock":"ACTIVATED","climateNow":"ACTIVATED","sendPoi":"ACTIVATED","remote360":"NOT_SUPPORTED","climateControl":"START_TIMER","chargeNow":"NOT_SUPPORTED","lastDestinations":"NOT_SUPPORTED","carCloud":"ACTIVATED","remoteSoftwareUpgrade":"NOT_SUPPORTED","climateNowRES":"NOT_SUPPORTED","climateControlRES":"NOT_SUPPORTED","smartSolution":"NOT_SUPPORTED","ipa":"NOT_SUPPORTED"}]}
2020-09-28 15:18:01.700 [WARN ] [rive.internal.handler.VehicleHandler] - ### Vehicle Status ###
2020-09-28 15:18:01.703 [WARN ] [rive.internal.handler.VehicleHandler] - {"vehicleStatus":{"mileage":26112,"remainingFuel":55.0,"remainingRangeElectric":0.0,"remainingRangeElectricMls":0.0,"remainingRangeFuel":879.0,"remainingRangeFuelMls":546.0,"maxRangeElectric":0.0,"maxRangeElectricMls":0.0,"maxFuel":0.0,"chargingLevelHv":0.0,"vin":"ANONYMOUS","updateReason":"DOOR_STATE_CHANGED","updateTime":"2020-09-28T13:17:20+0000","doorDriverFront":"CLOSED","doorDriverRear":"CLOSED","doorPassengerFront":"CLOSED","doorPassengerRear":"CLOSED","windowDriverFront":"CLOSED","windowDriverRear":"CLOSED","windowPassengerFront":"CLOSED","windowPassengerRear":"CLOSED","sunroof":"UNKOWN","trunk":"CLOSED","rearWindow":"CLOSED","hood":"CLOSED","doorLockState":"SECURED","parkingLight":"OFF","positionLight":"OFF","position":{"lat":-1.0,"lon":-1.0,"heading":-1,"status":"OK"},"internalDataTimeUTC":"2020-09-28T13:16:36","singleImmediateCharging":false,"vehicleCountry":"NL","DCS_CCH_Activation":"NA","DCS_CCH_Ongoing":false,"checkControlMessages":[],"cbsData":[{"cbsType":"OIL","cbsState":"OK","cbsDueDate":"2022-07","cbsDescription":"Next service due when the stated distance has been covered or by the specified date.","cbsRemainingMileage":28000},{"cbsType":"VEHICLE_CHECK","cbsState":"OK","cbsDueDate":"2022-07","cbsDescription":"Next visual inspection due when the stated distance has been covered or by the stated date.","cbsRemainingMileage":28000},{"cbsType":"BRAKE_FLUID","cbsState":"OK","cbsDueDate":"2022-01","cbsDescription":"Next change due at the latest by the stated date.","cbsRemainingMileage":-1}]}}
2020-09-28 15:18:01.704 [WARN ] [rive.internal.handler.VehicleHandler] - ### Last Trip ###
2020-09-28 15:18:01.705 [WARN ] [rive.internal.handler.VehicleHandler] - {"lastTrip":{}}
2020-09-28 15:18:01.707 [WARN ] [rive.internal.handler.VehicleHandler] - ### All Trips ###
2020-09-28 15:18:01.716 [WARN ] [rive.internal.handler.VehicleHandler] - {"allTrips":{"avgElectricConsumption":{},"avgRecuperation":{},"chargecycleRange":{},"totalElectricDistance":{},"avgCombinedConsumption":{}}}
2020-09-28 15:18:01.718 [WARN ] [rive.internal.handler.VehicleHandler] - ### Charge Profile ###
2020-09-28 15:18:01.719 [WARN ] [rive.internal.handler.VehicleHandler] - {"destinations":[]}
2020-09-28 15:18:01.721 [WARN ] [rive.internal.handler.VehicleHandler] - ### Range Map Empty ###
2020-09-28 15:18:01.722 [WARN ] [rive.internal.handler.VehicleHandler] - ###### BMW ConnectedDrive Binding - Vehicle Troubleshoot Fingerprint Data - END ######```

Thanks for the effort in creating this binding. I’ve got a mixed experience, so far.

My Wife’s 2020 Mini works perfectly, happy days. However my 2012 BMW doesn’t want to play ball. Hopefully the log data below helps. I suspect though that it’s down to the way BMW implemented the ConnectedDrive back then. The BMW app works perfectly well and I can see all the relevant information, so the data is available but clearly not in the same way as the latest implementation.

For refence I’m in the UK.

Thanks,

Garry

05-Oct-2020 10:15:49.189 [WARN ] [.bmwconnecteddrive.internal.handler.VehicleHandler] - ### Vehicle Status ###
05-Oct-2020 10:19:57.708 [DEBUG] [onnecteddrive.internal.handler.ConnectedDriveProxy] - HTTP Error https://b2vapi.bmwgroup.us/webapi/v1/user/vehicles/ - 401 - Unauthorized{}
05-Oct-2020 10:20:14.187 [DEBUG] [onnecteddrive.internal.handler.ConnectedDriveProxy] - HTTP Error https://b2vapi.bmwgroup.com/webapi/v1/user/vehicles/ - 0 - HttpConnectionOverHTTP@7e357476::DecryptedEndPoint@490b0205{b2vapi.bmwgroup.com/160.46.245.252:443<->/192.168.10.4:49906,OPEN,fill=-,flush=-,to=314894/0}{}
05-Oct-2020 10:20:44.556 [DEBUG] [onnecteddrive.internal.handler.ConnectedDriveProxy] - HTTP Error https://b2vapi.bmwgroup.com/webapi/v1/user/vehicles/ - 0 - HttpConnectionOverHTTP@5ba2e414::DecryptedEndPoint@26b51d78{b2vapi.bmwgroup.com/160.46.245.252:443<->/192.168.10.4:49900,OPEN,fill=-,flush=-,to=349002/0}{}
05-Oct-2020 10:21:55.304 [DEBUG] [onnecteddrive.internal.handler.ConnectedDriveProxy] - HTTP Error https://b2vapi.bmwgroup.com/webapi/v1/user/vehicles/My-VIN/status - 400 - Bad Request{}
05-Oct-2020 10:21:55.304 [DEBUG] [.bmwconnecteddrive.internal.handler.VehicleHandler] - https://b2vapi.bmwgroup.com/webapi/v1/user/vehicles/MY-VIN/status - 400 - Bad Request{}

Ok,

let’s check this together. I applied already some changes for a BMW from 2015 in the last days which doesn’t worked out of the box. Did you recently downloaded the latest bundle from test directory?

A bit suspicious is the URL from United States in the trace
HTTP Error https://b2vapi.bmwgroup.us/webapi/v1/user/vehicles/ - 401 - Unauthorized{}
Please check if your Bridge is configured for Region ROW = Rest of World for the UK in order to connect with the right server!

Hi @Ronald,

good that you keep reporting this issue - it’s a bit awkward. First fingerprint reported by you shows Brake Fluid Mileage 0 and now fingerprint shows Brake Fluid Mileage -1 . I ignore now -1 values and show the lowest available Service Mileage.

Even if you’re not interested in this info please give the newest bundle a try in order to resolve this issue for other users.

Hi @weymann,

Thank you.
“NextServiceMilage” is now working correctly.

But “Service Mileage” under Services still isn’t.
In the Services group, at Service index 2, Service Name ‘Brake Fluid’ - Service Milage -1 km (as it was before).

Service index 0, Service Name ‘Oil’ - Service Mileage 28000 km
Service index 1, Service Name ‘Vehicle Check’ - Service Mileage 28000 km
Service index 2, Service Name ‘Brake Fluid’ - Service Mileage -1 km

2020-10-06 10:51:18.151 [WARN ] [rive.internal.handler.VehicleHandler] - ### Discovery Result ###
2020-10-06 10:51:18.165 [WARN ] [rive.internal.handler.VehicleHandler] - {"vehicles":[{"vin":"ANONYMOUS","model":"318i","driveTrain":"CONV","brand":"BMW","yearOfConstruction":2019,"bodytype":"F31","color":"MINERALGRAU METALLIC","statisticsCommunityEnabled":false,"statisticsAvailable":false,"hasAlarmSystem":true,"dealer":{"name":"ANONYMOUS","street":"ANONYMOUS","postalCode":"ANONYMOUS","city":"ANONYMOUS","country":"ANONYMOUS","phone":"ANONYMOUS"},"breakdownNumber":"ANONYMOUS","chargingControl":"NOT_SUPPORTED","vehicleFinder":"ACTIVATED","hornBlow":"ACTIVATED","lightFlash":"ACTIVATED","doorLock":"ACTIVATED","doorUnlock":"ACTIVATED","climateNow":"ACTIVATED","sendPoi":"ACTIVATED","remote360":"NOT_SUPPORTED","climateControl":"START_TIMER","chargeNow":"NOT_SUPPORTED","lastDestinations":"NOT_SUPPORTED","carCloud":"ACTIVATED","remoteSoftwareUpgrade":"NOT_SUPPORTED","climateNowRES":"NOT_SUPPORTED","climateControlRES":"NOT_SUPPORTED","smartSolution":"NOT_SUPPORTED","ipa":"NOT_SUPPORTED"}]}
2020-10-06 10:51:18.167 [WARN ] [rive.internal.handler.VehicleHandler] - ### Vehicle Status ###
2020-10-06 10:51:18.171 [WARN ] [rive.internal.handler.VehicleHandler] - {"vehicleStatus":{"mileage":26146,"remainingFuel":54.0,"remainingRangeElectric":0.0,"remainingRangeElectricMls":0.0,"remainingRangeFuel":801.0,"remainingRangeFuelMls":497.0,"maxRangeElectric":0.0,"maxRangeElectricMls":0.0,"maxFuel":0.0,"chargingLevelHv":0.0,"vin":"ANONYMOUS","updateReason":"DOOR_STATE_CHANGED","updateTime":"2020-10-06T08:22:55+0000","doorDriverFront":"CLOSED","doorDriverRear":"CLOSED","doorPassengerFront":"CLOSED","doorPassengerRear":"CLOSED","windowDriverFront":"CLOSED","windowDriverRear":"CLOSED","windowPassengerFront":"CLOSED","windowPassengerRear":"CLOSED","sunroof":"UNKOWN","trunk":"CLOSED","rearWindow":"CLOSED","hood":"CLOSED","doorLockState":"LOCKED","parkingLight":"OFF","positionLight":"OFF","position":{"lat":-1.0,"lon":-1.0,"heading":-1,"status":"OK"},"internalDataTimeUTC":"2020-10-06T08:22:55","singleImmediateCharging":false,"vehicleCountry":"NL","DCS_CCH_Activation":"NA","DCS_CCH_Ongoing":false,"checkControlMessages":[],"cbsData":[{"cbsType":"OIL","cbsState":"OK","cbsDueDate":"2022-07","cbsDescription":"Next service due when the stated distance has been covered or by the specified date.","cbsRemainingMileage":28000},{"cbsType":"VEHICLE_CHECK","cbsState":"OK","cbsDueDate":"2022-07","cbsDescription":"Next visual inspection due when the stated distance has been covered or by the stated date.","cbsRemainingMileage":28000},{"cbsType":"BRAKE_FLUID","cbsState":"OK","cbsDueDate":"2022-01","cbsDescription":"Next change due at the latest by the stated date.","cbsRemainingMileage":-1}]}}
2020-10-06 10:51:18.173 [WARN ] [rive.internal.handler.VehicleHandler] - ### Last Trip ###
2020-10-06 10:51:18.176 [WARN ] [rive.internal.handler.VehicleHandler] - {"lastTrip":{}}
2020-10-06 10:51:18.178 [WARN ] [rive.internal.handler.VehicleHandler] - ### All Trips ###
2020-10-06 10:51:18.180 [WARN ] [rive.internal.handler.VehicleHandler] - {"allTrips":{"avgElectricConsumption":{},"avgRecuperation":{},"chargecycleRange":{},"totalElectricDistance":{},"avgCombinedConsumption":{}}}
2020-10-06 10:51:18.182 [WARN ] [rive.internal.handler.VehicleHandler] - ### Charge Profile ###
2020-10-06 10:51:18.185 [WARN ] [rive.internal.handler.VehicleHandler] - {"destinations":[]}
2020-10-06 10:51:18.187 [WARN ] [rive.internal.handler.VehicleHandler] - ### Range Map Empty ###
2020-10-06 10:51:18.189 [WARN ] [rive.internal.handler.VehicleHandler] - ###### BMW ConnectedDrive Binding - Vehicle Troubleshoot Fingerprint Data - END ######```
1 Like

Thanks,

Status Group
Shows now earliest Date and lowest Mileage regardless which Service. This is matching now with your Car Dashboard

Service Group gives now detail for each individual Service:
Brake Fluid Service shall be executed in Jan 2022 regardless driven kilometers.
Oil & Service Check shall be executed in Jul 2022 or after 28tkm driven - depends what comes first.

In Summary either Brake Fluid is next Service in Jan 2022 or if you drive 28tkm before Oil & Service Check are next.

Finally the raw data fits to your HMI!

Hi @weymann,

Thanks for the reply. Yes I have latest version of the binding, this was my first time setting this up.

My account log’s in just fine and appears in the online state. I’ve also checked that the Region is set to ROW. I’ve also deleted the things for my account and recreated it, just to make sure.

Regards,

Garry

06-Oct-2020 18:22:42.365 [WARN ] [.bmwconnecteddrive.internal.handler.VehicleHandler] - ###### BMW ConnectedDrive Binding - Vehicle Troubleshoot Fingerprint Data - BEGIN ######
06-Oct-2020 18:22:42.365 [WARN ] [.bmwconnecteddrive.internal.handler.VehicleHandler] - ### Discovery Result ###
06-Oct-2020 18:22:42.367 [WARN ] [.bmwconnecteddrive.internal.handler.VehicleHandler] - {"vehicles":[{"vin":"ANONYMOUS","model":"M5","driveTrain":"CONV","brand":"BMW","yearOfConstruction":2011,"bodytype":"F10","color":"MONTE CARLO BLAU METALLIC","statisticsCommunityEnabled":false,"statisticsAvailable":false,"hasAlarmSystem":true,"dealer":{"name":"ANONYMOUS","street":"ANONYMOUS","postalCode":"ANONYMOUS","city":"ANONYMOUS","country":"ANONYMOUS","phone":"ANONYMOUS"},"breakdownNumber":"ANONYMOUS","chargingControl":"NOT_SUPPORTED","vehicleFinder":"ACTIVATED","hornBlow":"NOT_SUPPORTED","lightFlash":"ACTIVATED","doorLock":"ACTIVATED","doorUnlock":"ACTIVATED","climateNow":"ACTIVATED","sendPoi":"ACTIVATED","remote360":"NOT_SUPPORTED","climateControl":"START_TIMER","chargeNow":"NOT_SUPPORTED","lastDestinations":"NOT_SUPPORTED","carCloud":"NOT_SUPPORTED","remoteSoftwareUpgrade":"NOT_SUPPORTED","climateNowRES":"NOT_SUPPORTED","climateControlRES":"NOT_SUPPORTED","smartSolution":"NOT_SUPPORTED","ipa":"NOT_SUPPORTED"}]}
06-Oct-2020 18:22:42.367 [WARN ] [.bmwconnecteddrive.internal.handler.VehicleHandler] - ### Vehicle Status ###
06-Oct-2020 18:25:30.034 [WARN ] [drive.internal.handler.ConnectedDriveBridgeHandler] - ###### BMW ConnectedDrive Binding - Discovery Troubleshoot Fingerprint Data - BEGIN ######
06-Oct-2020 18:25:30.034 [WARN ] [drive.internal.handler.ConnectedDriveBridgeHandler] - ### Discovery Result ###
06-Oct-2020 18:25:30.034 [WARN ] [drive.internal.handler.ConnectedDriveBridgeHandler] - {"vehicles":[{"vin":"ANONYMOUS","model":"M5","driveTrain":"CONV","brand":"BMW","yearOfConstruction":2011,"bodytype":"F10","color":"MONTE CARLO BLAU METALLIC","statisticsCommunityEnabled":false,"statisticsAvailable":false,"hasAlarmSystem":true,"dealer":{"name":"ANONYMOUS","street":"ANONYMOUS","postalCode":"ANONYMOUS","city":"ANONYMOUS","country":"ANONYMOUS","phone":"ANONYMOUS"},"breakdownNumber":"ANONYMOUS","chargingControl":"NOT_SUPPORTED","vehicleFinder":"ACTIVATED","hornBlow":"NOT_SUPPORTED","lightFlash":"ACTIVATED","doorLock":"ACTIVATED","doorUnlock":"ACTIVATED","climateNow":"ACTIVATED","sendPoi":"ACTIVATED","remote360":"NOT_SUPPORTED","climateControl":"START_TIMER","chargeNow":"NOT_SUPPORTED","lastDestinations":"NOT_SUPPORTED","carCloud":"NOT_SUPPORTED","remoteSoftwareUpgrade":"NOT_SUPPORTED","climateNowRES":"NOT_SUPPORTED","climateControlRES":"NOT_SUPPORTED","smartSolution":"NOT_SUPPORTED","ipa":"NOT_SUPPORTED"}]}
06-Oct-2020 18:25:30.034 [WARN ] [drive.internal.handler.ConnectedDriveBridgeHandler] - ###### BMW ConnectedDrive Binding - Discovery Troubleshoot Fingerprint Data - END ######

Discovery looks fine so your Vehicle is found, right?

But the Vehilce Toubleshoot Fingerprint Data doesn’t look good. I expect a BEGIN and END section which I cannot find in the above trace. Did you really copy the whole trace?

Before retry please do me the favor to copy the newest test bundle. I’m fixing currently several bugs from other users and review comments from the openHAB maintainers so let’s use the latest version for testing!

I’ve been testing this for a few days but have not had success with vehicle discovery:

2020-10-17 10:50:53.506 [WARN ] [.handler.ConnectedDriveBridgeHandler] - ###### BMW ConnectedDrive Binding - Discovery Troubleshoot Fingerprint Data - BEGIN ######
2020-10-17 10:50:53.506 [WARN ] [.handler.ConnectedDriveBridgeHandler] - ### Discovery Result ###
2020-10-17 10:50:53.507 [WARN ] [.handler.ConnectedDriveBridgeHandler] - {"url":"https://b2vapi.bmwgroup.us/webapi/v1/user/vehicles/","status":400,"reason":"Bad Request","params":"{                          }"}
2020-10-17 10:50:53.507 [WARN ] [.handler.ConnectedDriveBridgeHandler] - ###### BMW ConnectedDrive Binding - Discovery Troubleshoot Fingerprint Data - END ######

I’ve just tested with your latest version with the same result unfortunately. I’ve tested my credentials with ‘bimmerconnected’ and it works, retrieving my vehicle details. Any ideas?

Thank you for your efforts!

I have the same issue. It appeared to work for me fine around October 15th, but the next day I started getting this “Bad Request” response. I too can login with bimmerconnected, which I installed just now. I notice they have a merged pull request 5 days ago that fixes some issue with rest of world logins. They say it must have been a change at BMWs end. I don’t have the skills to progress this further sorry!

1 Like

Thanks for the info @Matt_Cholawo. This is weird stuff. I also observed this error and I tried many things. Finally it worked using pure java.net classes - openhab internal jetty doesn’t work - whyever.

I updated the bundle in test folder with this preliminary version to check if this is working for all.

Thanks that’s fixed it for me!

Same here. Latest bundle works fine. (my connected drive contract ended last week, I thought that was the issue)

Unfortunately it is still not working for me.

At this point I am building my own around ‘bimmerconnected’, so it is not a priority for me. Thank you.

I’m trying it out with a X1 model.
And most things (windows, doors, trunk, image, service, fuel…) are rolling IN, and acting (lights, horn)…
Nice work!!!

What isn’t working for me right now:

  • The location part.
    And in the fingerprint, I see: vehicleFinder":"DRIVER_DISABLED. Not sure how I can enable it. :blush:
    But in the app of BMW, I’m also seeing something weird. When I click on ‘find my car’, I’m getting a warning that I must activate my gps in order to have this working? When I click trough on location icon on the map, I can locate it nicely…

  • Control messages

  • Destinations

Let me know if I can test something or so…

After going through ‘all’ options in the car, I finally found under idrive - Privacy settings the option to enable location finder. So the location part is working great!

For the moment, the last trip, destinations, checkcontrol… aren’t working. But maybe this linked to the kind of contract with BMW?

Hi @brononius Ben,

I’m using this binding too (and i’m very happy with it). The functions last trip, destinations, checkcontrol aren’t working for me either because it is not supported by my car or the service is not active in my BMW connected drive account.
Maybe checkcontrol should work, but I haven’t had an active check control message since I use this binding so I’m not sure about that.

In Paper UI you can find some more information of the functions that should (and won’t) work.
Go to Paper UI -> Configuration -> Things -> [your car] (for me it is BMW 318i) -> show properties
And look at ‘Services Activated’ and ‘Services Not Supported’.

2 Likes

Excellent.
So easy to see what should be working. :wink:

1 Like