BMW ConnectedDrive component

Update
@ChristianKuehnel has made some updates in his component which is now ready for review after which it can be merged in HA.

In the meanwhile will be working on adding extra features to the component :grinning:

2 Likes

Good news, the BMW Connected Drive component is part of HA release 0.64 :sunglasses:

In the meanwhile we are working on more features :oncoming_automobile:

1 Like

yeah, great to see it ready for release.

Is it possible to use it at custom component right now?

You can download the custom component files from here.

you should add a note to the setup description in which format the country has to be added :wink:

Works fine, except the device tracker is not added as entitiy. Location tracking works in the BMW app… any suggestions?

1 Like

Just tried this and get an error regarding the “name:” option. Checked the source and can’t seem to find any reference to a configuration entry called name as the documentation shows.

If I remove the name: line it works fine.

1 Like

I have upgraded to 0.64 and tried this new feature. I also get the errors with the ‘name:’ option so removed it from my configuration.yaml.

I cannot see anything in hass around BMW sensors. Has anyone got this working yet?

I have 3 sensors for my 225xe. Range left, litres of gas left and total mileage.

Yes it’s working for me, except GPS location:

Did you guys use the inbuilt component in 0.64 or the custom component described above?

In my case it’s 0.64

Typical errors in my log:

2018-02-26 13:18:24 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/bimmer_connected/state.py", line 44, in _func_wrapper
    return func(self, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/bimmer_connected/state.py", line 141, in remaining_range_fuel
    return float(self._attributes['beRemainingRangeFuel'])
KeyError: 'beRemainingRangeFuel'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/bmw_connected_drive.py", line 98, in update
    listener()
  File "/usr/lib/python3.6/site-packages/homeassistant/components/sensor/bmw_connected_drive.py", line 81, in update
    self._state = getattr(vehicle_state, self._attribute)
  File "/usr/lib/python3.6/site-packages/bimmer_connected/state.py", line 46, in _func_wrapper
    raise ValueError('No data available!')
ValueError: No data available!

I have a 2016 F36 440i BMW with NBT.

Mine is a 2015 F36 430d.

With HA 64.0, I get two sensors (mileage, fuel) and errors like the one mentioned by @gr4z

The custom component does not work at all for me, I have no sensor but a log full of errors.

If I provide a “name” attribute, the platform does not load at all both with or without custom component.

Edit: After entering the Connect App (Android) and locating the car once, I now also get the device_tracker. But still the error regarding ‘beRemainingRangeFuel’… Using HA 64.0 without a custom component now.

2018 M2 with idrive 6 touchscreen (located in Norway), if I skip the name: I get milage, remaining_fuel and remaining_range_fuel. With name: not commented out I get nothing. HA 0.64.

Inbuilt component running in a container

I’m using the custom component, name value does not work.

For device_tracker you have to edit the known_devices.yaml and enable tracking for the bmw device tracker, if your new devices are not automaticaly are tracked.

Ah ha, of course! I can now see device_tracker, mileage and remaining fuel.

Would love to see lock status and perhaps send an action to lock the car if it isn’t already when going to bed.

I had to take out the “name” line to get my configuration to validate, but I am still getting an error when the front page loads.

It shows " KeyError: ‘access_token’ "…I’ve checked my user name and password and its correct.

I do have two cars in my BMW Connect account, not sure if that is causing my issue.

The name field probably ended up unintentionally in the config.yaml example. Will check that with @ChristianKuehnel so it can be changed in the instruction.

That should work (although it’s the first time we can test this :slight_smile:) . Did you use the right name of the country in the configuration file exactly as it is shown on BMW ConnectedDrive?

I used “USA” for the Country.

Here is some more info on the BMW ConnectedDrive component.

Home Assistant 0.64
In HA 0.64 release the BMW ConnectedDrive component is available with:

  • Device tracker
  • Mileage (sensor)
  • Remaining fuel (sensor)
  • Remaining range fuel (sensor)

We are working on adding more items to the component, you can check here for more information.
These extra items will be made available in the next releases of HA.

While working on that there is a custom component available over here which contains (parts) of these new items.

Custom component
The custom component currently contains the following extra items (beside the ones mentioned above):

  • Door lock state (binary sensor)
  • Doors (binary sensor)
  • Windows (binary sensor)
  • Lock (lock)
  • Horn (switch)
  • Lights (switch)
  • Climate (switch)
1 Like