BMW Connected Drive failing

Since a few days the BMW Connected Drive integration fails. It started with the location of the car not being updated, to entities becoming unavailable. Reloading the integration made the entities available again, except the location of the car.

The integration dashboard shows: Retrying setup: local variable ‘response’ referenced before assignment

Lofgfile:

Traceback (most recent call last):
File “/usr/local/lib/python3.9/site-packages/bimmer_connected/account.py”, line 128, in _login_row_na
r_oauth_settings.raise_for_status()
File “/usr/local/lib/python3.9/site-packages/requests/models.py”, line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://cocoapi.bmwgroup.com/eadrax-ucs/v1/presentation/oauth/config
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/local/lib/python3.9/site-packages/bimmer_connected/account.py”, line 220, in _login_row_na
err = response.json()
UnboundLocalError: local variable ‘response’ referenced before assignment
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py”, line 191, in _async_refresh
self.data = await self._async_update_data()
File “/usr/src/homeassistant/homeassistant/components/bmw_connected_drive/coordinator.py”, line 59, in _async_update_data
self.account = await self.hass.async_add_executor_job(
File “/usr/local/lib/python3.9/concurrent/futures/thread.py”, line 58, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.9/site-packages/bimmer_connected/account.py”, line 88, in init
self._get_vehicles()
File “/usr/local/lib/python3.9/site-packages/bimmer_connected/account.py”, line 383, in _get_vehicles
self._get_oauth_token()
File “/usr/local/lib/python3.9/site-packages/bimmer_connected/account.py”, line 113, in _get_oauth_token
raise ex
File “/usr/local/lib/python3.9/site-packages/bimmer_connected/account.py”, line 99, in _get_oauth_token
token_data = self._login_row_na()
File “/usr/local/lib/python3.9/site-packages/bimmer_connected/account.py”, line 223, in _login_row_na
_LOGGER.error(“Authentication failed: %s”, response.text)
UnboundLocalError: local variable ‘response’ referenced before assignment

Anyone else experiencing the same? Or any solution known?

2 Likes

I have exactly the same problem!

Same here…

BMW must have changed something to their API. I opened an issue on Github

Same errors here - can’t set up the integration either.

Same here :-/

Just noticed I got this error too :frowning:

Seems like BMW has changed the API.

It doesn’t work for me either.

When I open the integration settings, it shows the error message “Retrying setup: local variable 'response' referenced before assignment”.

I found the corresponding issue in github:

Hi all, I also still have this issue. Is there any solution yet?

The Beta, available via HACS, has fixes and is working correctly.

1 Like

Thanks. It is not super critical to me, so I will wait for the next update, but good to know that it will be fixed and it is not BMW that completly turned off the API. Altough that wouldn’t surprise me.

Yesterday’s update solved the issue for me. You have to install 2022.6.0

1 Like

I Have updated 2022.6, and still have issue with it. Cannot see stauts, or if I press flash lights it shows

anyone?

Hi, just saw that my bmw connected drive suddenly stopped, after working pretty fine. Any idea how to solve this issue??

Thanks for any help. JJ

I have the same.

1 Like

Yes, same error here. And after removing the integration and adding it again, login is failing. Restarting HA or waiting doesn’t help.

EDIT: like thereadldb mentioned, it’s working fine again after installing todays update (version 20220716.1

+1, same problem

After updating HA to latest version, it runs at my side.

If anyone is using the beta versione like me, there’s a new update. It fixed my problems and the release notes mention compatibility with 2022.7.5.

1 Like

Les funciona BMW connected? llevo meses que me ha dejado de funcionar