BMW ConnectedDrive component

Hi guys! Im very happy with this component although I would like to get your input on two things

  1. On the map the I would like to have the name of the car rather than “Xx”. How do I change the name? (Se print screen below)
  2. When I restart HA the component often fails at start-up requiring several reboots until it’s working again. Any fix or work-around available for this issue?

Thank you!
Alexander

  1. You can change the name in known_devices.yaml.
  2. Which HA version are you using? Because since 0.102 this issue is solved -> https://github.com/home-assistant/home-assistant/pull/28651.

Hi, I am just starting with HA and BMW CD. I have added the following to my configuration yaml:

bmw_connected_drive:
  name:
    username: bmw
    password: bmw
    region: rest_of_world
    read_only: false

Do I need to do anything else? I only see 1 new device in entities named “520d lock”. I have an active CD subscription (app works well) and my car is a 520D…

What can i do more/see more? how can I add “services” in below topic?

EDIT: No one?? :pensive:

I have error:

2020-01-24 09:29:10 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 284, in async_update_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 328, in _async_write_ha_state
    attr.update(self.device_state_attributes or {})
  File "/usr/src/homeassistant/homeassistant/components/bmw_connected_drive/lock.py", line 64, in device_state_attributes
    "door_lock_state": vehicle_state.door_lock_state.value,
AttributeError: 'NoneType' object has no attribute 'value'

EDIT:
I do get my car to horn when I do:

But How do I get those nice lovelace tiles and button etc… I do only have 1 entitiy:

Any help :-)??

There is an issue filed at the “bimmerconnected” Github since Dec 19. I think that issue has to be solved, merged and included in HA.

Is there a solution for the issue in planning?

Hello,
Newbie here on Home Assistant.
I already setup some devices but I’ve an hard time with this component :confused:
Do I need to download and put the bimmer_connected in the custom_components folder
OR if just adding the config in the configuration.yaml is enough to have it fully working?
What’s included in HA and what’s not ?
I have the latest version and run the official image in a VM.
The services do appear in the list of services (developer tools) but nothing on the dashboard.
What do I do wrong ? :confused:

Thanks a lot :slight_smile:

Help? Please:-)

You should only configure your settings in configuration.yaml. Downloading and placing the files is not required, it is part of HA already.
This is my setup for NL!

# BMW CONNECTED DRIVE
bmw_connected_drive:
  bmw:
    username: !secret bmw_username
    password: !secret bmw_password
    region: "rest_of_world"
1 Like

As far as I know the lock still does not work on ‘older’ models. I have a F-series from 2011 and the lock does not work. Make sure you have a active subscription with ConnectedDrive, if the BMW app works you should have this.

Try to reboot HA, first time it took me a second reboot to get the services up and running. !
I have these services available, and they work. the lock is always greyed-out in my setup and the location or millage does not work.

HA_bmw_services_overview|413x268

Ehm… for me it also “works”, but the question goes a little deeper… I have 4 services available as far as I can see in developer tools:
image

And when I use sound horn in conjuction with my chassis number is sounds the horn.

But how do I get them in to a “tile” in lovelace?

And besides that, I get errors… (despite it works):
2020-02-11 08:52:20 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 424, in _async_add_entity await entity.async_update_ha_state() File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 284, in async_update_ha_state self._async_write_ha_state() File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 328, in _async_write_ha_state attr.update(self.device_state_attributes or {}) File “/usr/src/homeassistant/homeassistant/components/bmw_connected_drive/lock.py”, line 64, in device_state_attributes “door_lock_state”: vehicle_state.door_lock_state.value, AttributeError: ‘NoneType’ object has no attribute ‘value’ 2020-02-11 08:57:19 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 284, in async_update_ha_state self._async_write_ha_state() File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 328, in _async_write_ha_state attr.update(self.device_state_attributes or {}) File “/usr/src/homeassistant/homeassistant/components/bmw_connected_drive/lock.py”, line 64, in device_state_attributes “door_lock_state”: vehicle_state.door_lock_state.value, AttributeError: ‘NoneType’ object has no attribute ‘value’ 2020-02-11 09:02:19 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 284, in async_update_ha_state self._async_write_ha_state() File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 328, in _async_write_ha_state attr.update(self.device_state_attributes or {}) File “/usr/src/homeassistant/homeassistant/components/bmw_connected_drive/lock.py”, line 64, in device_state_attributes “door_lock_state”: vehicle_state.door_lock_state.value, AttributeError: ‘NoneType’ object has no attribute ‘value’ 2020-02-11 09:07:19 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 284, in async_update_ha_state self._async_write_ha_state() File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 328, in _async_write_ha_state attr.update(self.device_state_attributes or {}) File “/usr/src/homeassistant/homeassistant/components/bmw_connected_drive/lock.py”, line 64, in device_state_attributes “door_lock_state”: vehicle_state.door_lock_state.value, AttributeError: ‘NoneType’ object has no attribute ‘value’

EDIT:
I created 1 tile now… an entity button and that horns the car…
Pfew steap learning curve.

entity: lock.520d_lock
hold_action:
  action: none
icon: 'mdi:car-connected'
icon_height: 50px
name: BMW horn
show_icon: true
show_name: true
tap_action:
  action: call-service
  service: bmw_connected_drive.sound_horn
  service_data:
    vin: WBAxxxxx12345
type: entity-button

This is what is in my configuration.yaml

# HA BUTTON/BOOLEAN TO HAVE BUTTON IN HA TO CONTROL NODE-RED BMW CAR SCRIPT
input_boolean:
  bmw535d_ventilation:
    name: BMW-535d Air Ventilation
    initial: off
    icon: mdi:car

And this what is in my ui-lovelace.yaml

#535d
  - icon: mdi:car-connected
    title: BMW's
    cards:
        - type: entities
          title: BMW 535d
          show_header_toggle: false
          entities:
            - entity: input_boolean.bmw535d_ventilation
              icon: mdi:car-connected
              name: BMW 535d Air Ventilation
            - type: call-service
              icon: mdi:car-connected
              name: BMW 535d
              action_name: Update State
              service: bmw_connected_drive.update_state
            - type: call-service
              icon: mdi:air-conditioner
              name: BMW 535d
              action_name: Activate Airco
              service: bmw_connected_drive.activate_air_conditioning
              service_data: 
                vin: !secret bmw_vin
            - type: call-service
              icon: mdi:car-light-high
              name: BMW 535d
              action_name: Flash lights
              service: bmw_connected_drive.light_flash
              service_data:
                vin: !secret bmw_vin
            - type: call-service
              icon: mdi:bugle
              name: BMW 535d
              action_name: Sound horn
              service: bmw_connected_drive.sound_horn
              service_data:
                vin: !secret bmw_vin

Hi, why only the “air ventilation” part in configuration.yaml and not Airco, light, horn etc?

anyone else having issues to get the component working today?
Worked today morning but since my last restart of hass.io today evening I does not connect anymore

Not working for me either:

2020-02-14 18:48:07 ERROR (SyncWorker_6) [bimmer_connected.account] Authentication failed. Maybe your password is invalid?
2020-02-14 18:48:07 ERROR (SyncWorker_6) [bimmer_connected.account] The BMW Connected Drive portal returned an error: UNKNOWN_ERROR (received status code 400 and expected 200).
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/bimmer_connected/account.py", line 95, in _get_oauth_token
    expected_response=200, post=True)
  File "/usr/local/lib/python3.7/site-packages/bimmer_connected/account.py", line 149, in send_request
    raise IOError(msg)
OSError: The BMW Connected Drive portal returned an error: UNKNOWN_ERROR (received status code 400 and expected 200).

The connected-drive portal works just fine and so does my app.

good to know. I’m getting the same error message. So it seems to be a BMW problem

Also broken here…

Invalid config

The following integrations and platforms could not be set up:

Please check your config.

1 Like

Same here as of yesterday/today

1 Like

Hello,

Same on my side. I had created an automation to update the parameters of my car, but it never really worked (error NOT_FOUND 404 in the HA logs, but today it’s UNKNOWN_ERROR code 400).
I don’t know if I’m going wrong with its configuration, which was not complicated, but it doesn’t seem very stable on a daily use.

Config

 bmw_connected_drive:
  bmw:
    username: !secret USERNAME_BMW_CONNECTED_DRIVE
    password: !secret PASSWORD_BMW_CONNECTED_DRIVE
    region: rest_of_world
    read_only: false

Automation

- alias: BMW - Update
  description: BMW Connected Drive update Info
  trigger:
    platform: time_pattern
    hours: '/4'
  action:
    service: bmw_connected_drive.update_state

Lovelace pic:
2020-02-14 22_23_44-Window

I came here to see if I could get a fix for this, good to hear it’s not only me having problems and I’ll just have to be patient.

There’s a suggestion on the site for the bimmer_connected component that BMW have changed the name of the server used for retrieving the OAuth credentials.

I suspect it may be as simple as changing the definition of AUTH_URL in
/usr/local/lib/python3.7/site-packages/bimmer_connected/const.py
to point at
'https://customer.bmwgroup.com/gcdm/oauth/authenticate'
but I don’t have a setup on which I can easily patch this in at present.

If I get some time later this weekend I’ll try and experiment, and submit a PR upstream; it may be a little while before that reaches us, though, if it works.

Anyone got a good way of monkey-patching this value in a running Home Assistant to try out?