BMW ConnectedDrive component

Check the bold text in my opening post.

many thanks :slight_smile:

Hey @gerard33,

just saw your comments on my pull request: https://github.com/home-assistant/home-assistant/pull/12277
My library for talking to the car is here: https://github.com/ChristianKuehnel/bimmer_connected

I was not aware of your work. I only checked the git repo, but not the community pages…
And yes joining forces definitely makes sense!
Where do you keep your code, so that we could compare the work?

br Christian

That’s great!
I have just sent you a message with more details.

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.