BMW ConnectedDrive component

What is ‘remote service’? Some additional service that has to be ordered from BMW? Some monthly fee? Or something that needs to be enabled on BMW Website?
Thanks

More info on Remote Service is here. It is however strange that you are already able to lock.unlock the doors isn’t it?

ok. i was a bit confused about what service you were talking about, as i thought i knew that i had ALL available connected services booked. just check it online:

Hi, I just added the component and interested in the GPS coordinates to create zones. However it seems tht the gps coordinates are not correct. I have a 2015 420d. I can activate horn, lock/open door, ventilation, and lights via the bmw app.
Range etc all empty in HA.
Time for a new car? :slight_smile:

I already have the remote service and I am able to lock and unlock the doors but don’t see the stats on Fuel etc unless I connect via usb. However, I’m sure that I used to get these stats on the android BMW app but they were very slow to update, so either the app has changed this feature or something is wrong with the car. I did recently have the car coded for EBT (enhanced bluetooth for audio), so I might revert that and see if it makes a difference.

I love this component with my i3! I keep getting errors in my system though, sometimes when I reboot the component won’t load at all. (running Hass.io 0.73.2)

Here’s the error:

{
  "error" : {
    "code" : 500,
    "description" : "(SmartPhoneUtil-A-302) External service failed. Could not retrieve vehicle status! Error: "(SmartPhoneUtil-I-300) Unexpected error - server panic. Caught web service exception on call to CCG WS VehicleInformation.WS_VehicleInformation""
  }
}

Good to see you like it.
When is the error showing? Only every now and then? Because I think I have seen that error some times as well.

And can you run the fingerprint to see if the data is received in a correct way?

Error in various forms seem to show up ever few hours when I look at the log. The other error is just a straight up “error updating the vehicle state” These two errors appear to show up randomly approx. 56 times over the last 48 hours (since my last reboot). Can I run the fingerprint if I’m on Hassio?

You can use the fingerprint on hassio by using the SSH addon.

Your issue seems to be related to https://github.com/home-assistant/home-assistant/pull/14464#issuecomment-392036351

If you can run the fingerprint we can hopefully find the cause of the error you see in the logs.

Trying to follow instructions to run fingerprint but getting error in SSH.

image

Just to be sure it wasn’t something with my current setup I went and setup my extra Pi that I have using Hassio and just did a basic setup and it’s doing the same exact thing.

Can anyone help?
I have the following in my config:

#BMW Connected drive component  
bmw_connected_drive:
  name:
  username: '[email protected]'
  password: 'xxxxxxxx'
  region: 'UK'  

and getting the following error:

2018-07-28 19:33:48 ERROR (MainThread) [homeassistant.config] Invalid config for [bmw_connected_drive]: expected a dictionary for dictionary value @ data[‘bmw_connected_drive’][‘name’]. Got ‘xxxxx’
expected a dictionary for dictionary value @ data[‘bmw_connected_drive’][‘password’]. Got ‘xxxxxxxxx’
expected a dictionary for dictionary value @ data[‘bmw_connected_drive’][‘region’]. Got ‘rest_of_world’
expected a dictionary for dictionary value @ data[‘bmw_connected_drive’][‘username’]. Got ‘[email protected]’. (See /config/configuration.yaml, line 135). Please check the docs at https://home-assistant.io/components/bmw_connected_drive/
2018-07-28 19:33:48 ERROR (MainThread) [homeassistant.setup] Setup failed for bmw_connected_drive: Invalid config.

details have been removed and replaced with xxxxxx.

Thanks for any help.

Your indentation seems incorrect. username, password and region are children of name. Try putting two spaces in front of those three.

Thanks I did initially have it formatted that way and homeassistant would not start, I can’t remember what the error was but will try again.

As @danielperna84 mentioned the indentation is not correct, but you should also use rest_of_world for region instead of UK. Check this example from the documentation page:

bmw_connected_drive:
  name:
    username: USERNAME_BMW_CONNECTED_DRIVE
    password: PASSWORD_BMW_CONNECTED_DRIVE
    region: one of "north_america", "china" , "rest_of_world"

Thanks, I did initially have it set to rest of world too but looking through this thread I saw that someone was using UK so tried that.
Will try both suggestions later this evening and report back.

What do you guys think about a feature for disabling the services?

I dont use the services and i would like to have them disabled for security reasons.

Would it be possible to make a simple config in the yaml like
disable_services: true?
or something else

Thanks for the help @gerard33 and @danielperna84 the component is now loading and I can see sensors although there are no values. I have also got the following errors:

2018-07-29 16:23:08 WARNING (MainThread) [homeassistant.setup] Setup of config is taking over 10 seconds.
2018-07-29 16:23:24 ERROR (SyncWorker_1) [bimmer_connected.state] No data available!
2018-07-29 16:23:24 ERROR (MainThread) [bimmer_connected.state] No data available!
2018-07-29 16:23:24 ERROR (SyncWorker_16) [bimmer_connected.state] No data available!
2018-07-29 16:23:24 ERROR (SyncWorker_7) [bimmer_connected.state] No data available!
2018-07-29 16:23:24 ERROR (MainThread) [bimmer_connected.state] No data available!
2018-07-29 16:23:24 ERROR (SyncWorker_17) [bimmer_connected.state] No data available!
2018-07-29 16:23:24 ERROR (MainThread) [bimmer_connected.state] No data available!
2018-07-29 16:23:24 ERROR (MainThread) [homeassistant.components.binary_sensor] bmw_connected_drive: Error on device update!
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 248, in _async_add_entity
await entity.async_device_update(warning=False)
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 319, in async_device_update
yield from self.hass.async_add_job(self.update)
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/binary_sensor/bmw_connected_drive.py”, line 159, in update
self._state = not vehicle_state.are_all_cbs_ok
File “/usr/local/lib/python3.6/site-packages/bimmer_connected/state.py”, line 224, in are_all_cbs_ok
for cbs in self.condition_based_services:
TypeError: ‘NoneType’ object is not iterable
2018-07-29 16:23:24 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 326, in _async_add_entity
await entity.async_update_ha_state()
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 215, in async_update_ha_state
device_attr = self.device_state_attributes
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/lock/bmw_connected_drive.py”, line 69, in device_state_attributes
‘door_lock_state’: vehicle_state.door_lock_state.value
AttributeError: ‘NoneType’ object has no attribute ‘value’
2018-07-29 16:23:25 ERROR (MainThread) [homeassistant.components.binary_sensor] bmw_connected_drive: Error on device update!
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 248, in _async_add_entity
await entity.async_device_update(warning=False)
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 319, in async_device_update
yield from self.hass.async_add_job(self.update)
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/binary_sensor/bmw_connected_drive.py”, line 161, in update
self._state = vehicle_state.has_check_control_messages
File “/usr/local/lib/python3.6/site-packages/bimmer_connected/state.py”, line 71, in _func_wrapper
return func(self, *args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/bimmer_connected/state.py”, line 323, in has_check_control_messages
return len(self.check_control_messages) > 0
TypeError: object of type ‘NoneType’ has no len()
2018-07-29 16:23:25 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 326, in _async_add_entity
await entity.async_update_ha_state()
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 215, in async_update_ha_state
device_attr = self.device_state_attributes
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/binary_sensor/bmw_connected_drive.py”, line 112, in device_state_attributes
result[‘door_lock_state’] = vehicle_state.door_lock_state.value
AttributeError: ‘NoneType’ object has no attribute ‘value’
2018-07-29 16:23:25 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 326, in _async_add_entity
await entity.async_update_ha_state()
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 215, in async_update_ha_state
device_attr = self.device_state_attributes
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/binary_sensor/bmw_connected_drive.py”, line 115, in device_state_attributes
result[‘lights_parking’] = vehicle_state.parking_lights.value
AttributeError: ‘NoneType’ object has no attribute ‘value’
2018-07-29 16:25:43

Any ideas of what this is telling me other than it appears no data can be retrieved?

I just wanted to throw this out there. I have been playing with lovelace and I came up with this. It is the same card once as a picture glance and the other is just glance. I wish picture glance allowed you to have the labels but it doesn’t yet. I got the picture off of connecteddrive.com. The charging complete is a template sensor from charging time and the current time.

1 Like

Nice. That inspired me to make a card for my car as well.
This is the result using this great site https://sharethelove.io.

In the top the remaining fuel and range are shown. On the bottom status of the lock, maintenance, doors, windows and mileage.

Screenshot_1
Screenshot_2

Make sure to use this SSH addon Home Assistant Community Add-on: SSH & Web Terminal in which pip3 is available.

Probably your car is not supported. What is the construction year?
And can you also run the fingerprint to see what info that gives?

There is some work in progress to check if the car is supported and only show the relevant sensors and avoid the error messages.