hi, I’m trying to integrate my bmw in rules. I can connect with the api but when I ask data it gives me a an authorization fault. I’m trying to find my client_id. does somebody know where to find it?
2025-10-03 09:02:22.088 [INFO ] [org.openhab.core.model.script.BMW ] - Fetching vehicle data
2025-10-03 09:02:22.123 [INFO ] [org.openhab.core.model.script.BMW ] - State Response: {“exveErrorId”: “CU-403”,“exveErrorMsg”: “Bad Request. Forbidden”,“exveErrorRef”: “”,“exveNote”: “This application error is raised when an invalid resource is invoked, or a valid resource is invoked incorrectly.”}
Are you trying with the binding, or a script using the new CarData API? The binding will not work anymore. For the CarData API, did you follow all instructions in the CarData documentation ( CarData Customer Portal )? You need to get it configured in the portal and then go through the device code flow to setup the client.
It is not an easy flow, and from what I read, there are challenges. I haven’t finished the setup myself yet. There is already a working integration for HA ( GitHub - JjyKsi/bmw-cardata-ha ), and it has good info on the authentication setup as well in the README. So it is worth looking at that as well.
Note that the CarData API only allows 50 requests per day, but there is an MQTT stream available. The stream only seems to send info when the car sends something back. Therefore it does not update charging levels continuously when charging. It looks like the BMW app is interpolating there, something that should probably also be done in a future binding update. The HA automation already has that.
The CarData API is read only. So any functionality that was sending commands to the car cannot be supported anymore. It looks like this may be permanently broken now and will not be available in a potential future version of the binding.
You will get this when you enable the CarData API on the BMW website.
Thx for the info! I’m trying with the new cardata flow. My problem for now is that I can’t find the location to enable the api. but I will read the info you gave me! hope it brings me a step closer. If I find a way I wil post it… but for now as you can see not a big succes .
I think we should remove the binding for now from the official repo, just don’t know if I should just remove the whole codebase. From my point of view it would be better to create the binding from scratch and maybe take over some functionality rather than proceed working on the existing code…
@MartinOpenhabFan I agree. I have limited time on the next few weeks, but I am keen to get this going again. re certainly things that could be recovered though.
expand the device code flow and click on the “try it out” button
enter as client_id the client_ID from the BMW CarData web portal you copied
click on execute
as response you will see your user_code. Copy this! also you will get your device_code you will need later on to request your MQTT password.
Go back to the BMW CarData web portal and click on the “authenticate” button
a new web page will open and you have to login with your BMW user account email and password.
you will be asked for a code. This is the 8-digit user_code you just copied and received from the device code flow response. It should show that you are logged in now.
Go back to the BMW CarData web portal and create a CarData Stream. Select all data you want (start with a few, you can change this later on)
Go back to the CarData API Swagger webpage
Expand the “request a token for the device” flow
Enter the client_ID you received at the beginning when you created the CarData client.
Enter the device_code you find in the response of the first device code flow.
click on execute and you will finally receive the password for MQTT. it is called id_token.
Your username is called gcid and should be the same as in the BMW CarData web portal, when you expand the CarData streaming
I did the setup and then tried to connect with openHAB.
The binding is trying to subscribe to topics that aren´t available and this exceeds the quota.
So now i can´t try anymore for today and need to wait for tomorrow.
How can i stop the binding from trying to subscribe to the topics from milight and homie?
info_circle 20:58:32.440 INFO
org.openhab.core.io.transport.mqtt.reconnect.PeriodicReconnectStrategy
Try to restore connection to 'customer.streaming-cardata.bmwgroup.com'. Next attempt in 60000ms
info_circle 20:58:32.441 INFO
openhab.event.ThingStatusInfoChangedEvent
Thing 'mqtt:broker:bmw' changed from OFFLINE (COMMUNICATION_ERROR): Server closed connection without DISCONNECT. to OFFLINE
info_circle 20:58:32.442 INFO
org.openhab.core.io.transport.mqtt.MqttBrokerConnection
Starting MQTT broker connection to 'customer.streaming-cardata.bmwgroup.com' with clientid 1234
flag 20:58:32.534 WARN
org.openhab.core.io.transport.mqtt.MqttBrokerConnection
Failed subscribing to topic awtrix/+/stats
info_circle 20:58:32.543 INFO
openhab.event.ThingStatusInfoChangedEvent
Thing 'mqtt:broker:bmw' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): Server closed connection without DISCONNECT.
flag 20:58:32.544 WARN
org.openhab.core.io.transport.mqtt.MqttBrokerConnection
Failed subscribing to topic ruuvi/#
flag 20:58:32.544 WARN
org.openhab.core.io.transport.mqtt.MqttBrokerConnection
Failed subscribing to topic milight/states/#
flag 20:58:32.544 WARN
org.openhab.core.io.transport.mqtt.MqttBrokerConnection
Failed subscribing to topic +/+/$homie
Your_user_id/+ (← this will subscribe to all your cars)
Or
Your_user_id/Your_Vin (← this will subscribe to a specific Vin)
I am currently running the Home Assistant implementation and transfer all data to mqtt to also have it available in Openhab. The HA Extension is working very well.
I can´t subscribe to a topic when the broker thing doesn´t connect.
I disabled the discovery to stop the binding from trying to subscribe to homie and milight.
But now the log tells me that the username password is wrong, even though the same data works in MQTTX.
Update.
I had to create a new password again, removed the certificate and key hashes to finally get the bridge online.
Now i´m trying to get some data from the stream.
AFAIK the topic will publish all datapoints that i enabled in my BMW account under cardata streaming.
I created one generic MQTT thing and then added a channel with the username and VIN as topic.
In the channel i use the incoming value transformation to receive the data from one of the 258 datapoints.
$.data["vehicle.vehicle.travelledDistance"].value
This should extract the mileage…
Currently i can´t trigger an update as i already triggered one trough the app.
Edit: It works!
I can receive my mileage.
Now i need to create a channel for every datapoint i want to get into openHAB.
Edit 2: It works really well and you get an update almost every kilometre! Seems like a great change for now.
Atleast i wont miss the remote features as i never used them through openHAB.
Jizz they broke it and now I see it is uber complicated to make it working again. Any chance we will get some easy an automated way creating all those tokens?
In past I used their module that was just a simple python CLI to pull the cars stats 15min. Just by running it as CLI script with added local MQTT publisher.