After BMW disabled access for bimmerconnected, which i had been using for years, i was looking for a solution to just read the SOC and range of our BMW BEV (that’s all i need) from the new CarData service. Most things i found were quite time-consuming to set up for this modest goal (due to the continued need to refresh tokens), so i gave up on it for a while. I am not a developer so i have to rely on the goodness of other people for this kind of stuff
. Anyhow, recently i stumbled into bmw-mqtt-bridge, which is very easy to set up and seems to work really well: GitHub - dj0abr/bmw-mqtt-bridge: BMW CarData MQTT client and bridge – Connects the BMW ConnectedDrive data stream to a local Mosquitto MQTT broker. · GitHub
I thought it would be a good idea to mention that here.
Thanks… I also switched to the bridge last week (also wrote a Blog post about it / german: BMW CarData Integration in openHAB - 360°Friends ). A little bit tricky and even as developer it tokes me 2-3h (it was my first MQTT integration). Works well so far…
Hi,
thanks for the pointer. I got the docker up and running but struggle with the JSONPATH to extract the values. Can you show an example? I’m trying this but the linked Item stays NULL.
JSONPATH:$.data.[vehicle.drivetrain.fuelSystem.remainingFuel].value
Thanks!
Here my thing configuration (note: I am using ´SPLIT_TOPICS=1` in the bridge.
Thing mqtt:topic:MQTT_Broker:mqtt_bmw "MQTT BMW" (mqtt:broker:MQTT_Broker) [availabilityTopic="bmw/status", payloadAvailable="true", payloadNotAvailable="false", transformationPattern="JSONPATH:$.connected"] {
Channels:
Type number : bmw_longitude "BMW Longitude" [stateTopic="bmw/vehicles/XXX/vehicle.cabin.infotainment.navigation.currentLocation.longitude", transformationPattern="JSONPATH($..value)"]
Type number : bmw_latitude "BMW Latitude" [stateTopic="bmw/vehicles/XXX/vehicle.cabin.infotainment.navigation.currentLocation.latitude", transformationPattern="JSONPATH($..value)"]
Type number : bmw_travelledDistance "BMW Travelled Distance" [stateTopic="bmw/vehicles/XXX/vehicle.vehicle.travelledDistance", transformationPattern="JSONPATH($..value)"]
Type number : bmw_stateOfCharge "BMW State Of Charge" [stateTopic="bmw/vehicles/XXX/vehicle.drivetrain.batteryManagement.header", transformationPattern="JSONPATH($..value)"]
Type number : bmw_kombiRemainingElectricRange "BMW Kombi Remaining Electric Range" [stateTopic="bmw/vehicles/XXX/vehicle.drivetrain.electricEngine.kombiRemainingElectricRange", transformationPattern="JSONPATH($..value)"]
}
One more note:
I also set MQTT_RETAIN=1 in the .env file to have the latest reported status available in case of a disconnect or restart, and i keep track of topic bmw/status to see if the connection is still alive.