core: BMW Connected Drive gives "KeyError: 'executionStatus'" when locking

The problem

When toggling the lock.320d_xdrive_lock I get an error saying “Failed to call service lock/unlock: ‘executionStatus’”. The car is getting both locked and unlocked though, so the command is carried out.

Environment

  • Home Assistant Core release with the issue: 108.9
  • Last working Home Assistant Core release (if known): N/A
  • Operating environment (Home Assistant/Supervised/Docker/venv): Docker on Ubuntu 18.0.4.4 LTS
  • Integration causing this issue: BMW Connected Drive
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/bmw_connected_drive/
  • Car: BMW 320d xDrive G21

Problem-relevant configuration.yaml

bmw_connected_drive:
  name:
    username: user@domain.com
    password: P@ssw0rd
    region: rest_of_world

Traceback/Error logs

Logger: homeassistant.components.websocket_api.http.connection.139842909877392
Source: components/bmw_connected_drive/lock.py:88
Integration: websocket_api (documentation, issues)
First occurred: 3:51:43 PM (1 occurrences)
Last logged: 3:51:43 PM

'executionStatus'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 134, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1232, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1255, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
    self._platforms.values(), func, call, required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 412, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 600, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 443, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/lock/__init__.py", line 109, in async_lock
    await self.hass.async_add_job(ft.partial(self.lock, **kwargs))
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/bmw_connected_drive/lock.py", line 88, in lock
    self._vehicle.remote_services.trigger_remote_door_lock()
  File "/usr/local/lib/python3.7/site-packages/bimmer_connected/remote_services.py", line 87, in trigger_remote_door_lock
    result = self._block_until_done(_Services.REMOTE_DOOR_LOCK)
  File "/usr/local/lib/python3.7/site-packages/bimmer_connected/remote_services.py", line 142, in _block_until_done
    status = self._get_remote_service_status(service)
  File "/usr/local/lib/python3.7/site-packages/bimmer_connected/remote_services.py", line 165, in _get_remote_service_status
    return RemoteServiceStatus(json_result)
  File "/usr/local/lib/python3.7/site-packages/bimmer_connected/remote_services.py", line 47, in __init__
    status = response['executionStatus']
KeyError: 'executionStatus'

Additional information

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 25 (11 by maintainers)

Most upvoted comments

I’ve mentioned that at integration github but to make this thread consistant…, unfortunately the issue still persists.

This basically means that we are able to send the request to the BMW API. We try to get the current status afterwards (i.e. pending or success) but there seems to be an issue somewhere.

I’ll try to think of a way of narrowing it down or mitigating this!