home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.14k stars 29.82k forks source link

BMW Connected Drive component reports 'KeyError: maxFuel' upon startup #31704

Closed m0wlheld closed 4 years ago

m0wlheld commented 4 years ago

The problem

Error is printed during startup of BMW Connected Drive component. The error does not prevent the component to start and other values are properly reported.

Environment

Problem-relevant configuration.yaml

bmw_connected_drive:
  mycar:
    username: !secret bmw_connected_drive_username
    password: !secret bmw_connected_drive_password
    region: "rest_of_world"

Traceback/Error logs

homeassistant | 2020-02-10 18:52:13 ERROR (MainThread) [homeassistant.components.sensor] bmw_connected_drive: Error on device update!
homeassistant | Traceback (most recent call last):
homeassistant |   File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_add_entity
homeassistant |     await entity.async_device_update(warning=False)
homeassistant |   File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 461, in async_device_update
homeassistant |     await self.hass.async_add_executor_job(self.update)
homeassistant |   File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
homeassistant |     result = self.fn(*self.args, **self.kwargs)
homeassistant |   File "/usr/src/homeassistant/homeassistant/components/bmw_connected_drive/sensor.py", line 148, in update
homeassistant |     self._state = getattr(vehicle_state, self._attribute)
homeassistant |   File "/usr/local/lib/python3.7/site-packages/bimmer_connected/state.py", line 307, in __getattr__
homeassistant |     return self._attributes[item]
homeassistant | KeyError: 'maxFuel

Additional information

Car is a 2019 BMW 530e iPerformance (PHEV) with IDrive 7

homeassistant | prefix in stack trace caused by docker-compose logging engine.

probot-home-assistant[bot] commented 4 years ago

Hey there @gerard33, mind taking a look at this issue as its been labeled with a integration (bmw_connected_drive) you are listed as a codeowner for? Thanks!

m0wlheld commented 4 years ago

Looks like upstream issue: https://github.com/bimmerconnected/bimmer_connected/issues/129

Quentame commented 4 years ago

Proposed a fix : bimmerconnected/bimmer_connected#148 😉

gerard33 commented 4 years ago

Thanks @Quentame Your fix is merged in #31894 together with a fix for the API change BMW did.