bimmer_connected: Error fetching bmw_connected_drive data: Client error '403 Quota Exceeded'

Describe the issue

I am new to Home Assistant and have been running the BMW connected integration for the last 10 days without issue (other than this likely unrelated issue). Today I started seeing the error below spuriously in my home-assistant.log. I have not inteacted with any of the BMW HA entities directly in the past 24 hrs, or opened the BMW App on my phone.

The frequency of the error seems to be: 10m, 15m, 20m. Based on the common denominator, I assume the BMW integration has a polling interval of 5m. Is there a setting to reduce the polling interval?

In the meantime, I disabled ‘Polling’ in the HA BMW Connectect integration under “system settings”. This should allow my account to cool down and refill quota / karma.

The severity of this issue is medium, as it disables all HA actions within the HA frontend (due to entities being unavailable) and prevents the offical MyBMW app from properly refreshing the vehicle status. Remote commands remain uneffected, as I was still able to start remote conditioning on my vehicle via the MyBMW app, despite the status refresh failing/being stale.

The car is a 2019 G05, running 07/2021.85. I rarely use the BMW connected app, and there are no other intergations setup against this BMW account. HA is on a RPi 4, running the latest version:

Home Assistant 2022.9.5
Supervisor 2022.09.1
Operating System 9.0
Frontend 20220907.2 - latest

Please let me know if there’s additional logging / information I can provide to assist. Thanks in advance! (It’s great work BTW)

2022-09-19 11:41:52.341 ERROR (MainThread) [homeassistant.components.bmw_connected_drive.coordinator] Error fetching bmw_connected_drive-EMAIL_REDACTED data: Error communicating with BMW API: Client error '403 Quota Exceeded' for url 'https://cocoapi.bmwgroup.us/eadrax-vcs/v2/vehicles'
2022-09-19 11:56:59.529 ERROR (MainThread) [homeassistant.components.bmw_connected_drive.coordinator] Error fetching bmw_connected_drive-EMAIL_REDACTED data: Error communicating with BMW API: Client error '403 Quota Exceeded' for url 'https://cocoapi.bmwgroup.us/eadrax-vcs/v2/vehicles/<REDACTED>/state'
2022-09-19 12:12:01.467 ERROR (MainThread) [homeassistant.components.bmw_connected_drive.coordinator] Error fetching bmw_connected_drive-EMAIL_REDACTED data: Error communicating with BMW API: Client error '403 Quota Exceeded' for url 'https://cocoapi.bmwgroup.us/eadrax-vcs/v2/vehicles'
2022-09-19 12:22:03.312 ERROR (MainThread) [homeassistant.components.bmw_connected_drive.coordinator] Error fetching bmw_connected_drive-EMAIL_REDACTED data: Error communicating with BMW API: Client error '403 Quota Exceeded' for url 'https://cocoapi.bmwgroup.us/eadrax-vcs/v2/vehicles'
2022-09-19 12:42:08.319 ERROR (MainThread) [homeassistant.components.bmw_connected_drive.coordinator] Error fetching bmw_connected_drive-EMAIL_REDACTED data: Error communicating with BMW API: Client error '403 Quota Exceeded' for url 'https://cocoapi.bmwgroup.us/eadrax-vcs/v2/vehicles'
2022-09-19 13:02:12.676 ERROR (MainThread) [homeassistant.components.bmw_connected_drive.coordinator] Error fetching bmw_connected_drive-EMAIL_REDACTED data: Error communicating with BMW API: Client error '403 Quota Exceeded' for url 'https://cocoapi.bmwgroup.us/eadrax-vcs/v2/vehicles'
2022-09-19 13:17:14.360 ERROR (MainThread) [homeassistant.components.bmw_connected_drive.coordinator] Error fetching bmw_connected_drive-EMAIL_REDACTED data: Error communicating with BMW API: Client error '403 Quota Exceeded' for url 'https://cocoapi.bmwgroup.us/eadrax-vcs/v2/vehicles'
2022-09-19 14:02:18.469 ERROR (MainThread) [homeassistant.components.bmw_connected_drive.coordinator] Error fetching bmw_connected_drive-EMAIL_REDACTED data: Error communicating with BMW API: Client error '403 Quota Exceeded' for url 'https://cocoapi.bmwgroup.us/eadrax-vcs/v2/vehicles'
2022-09-19 14:17:19.415 ERROR (MainThread) [homeassistant.components.bmw_connected_drive.coordinator] Error fetching bmw_connected_drive-EMAIL_REDACTED data: Error communicating with BMW API: Client error '403 Quota Exceeded' for url 'https://cocoapi.bmwgroup.us/eadrax-vcs/v2/vehicles'
# I disabled 'Polling' in the HA BMW Connectect integration under "system settings". This caused the same error, but from a different call site in the code:
2022-09-19 14:55:04.557 WARNING (MainThread) [homeassistant.config_entries] Config entry 'EMAIL_REDACTED' for bmw_connected_drive integration not ready yet: Error communicating with BMW API: Client error '403 Quota Exceeded' for url 'https://cocoapi.bmwgroup.us/eadrax-vcs/v2/vehicles'

Expected behavior

Near 100% availability of BMW connected entities in HA and official BMW Connected app by staying within allocated API quota.

Which Home Assistant version are you using?

2022.9.5

What was the last working version of Home Assistant Core?

No response

What is your region?

North America

MyBMW website

  • I can still successfully login to the BMW MyBMW website and the car status is available there.
  • I have MyBMW enabled for my vehicle.

Number of cars

  • I have 2 or more cars linked to the MyBMW account.
  • I have a Mini vehicle linked to my account.

Output of bimmer_connected fingerprint

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 27 (5 by maintainers)

Most upvoted comments

@rikroe, might I suggest we close this issue in favor of the HA core issue (to keep the conversation/updates in one place)? Feel free to reopen if you feel otherwise.

Yeah, BMW seems to play around with the quotas right now. I had the issue yesterday in rest_of_world, but it self-recovered, while still showing the error sometimes:

2022-09-20 08:06:52.526 DEBUG (MainThread) [httpx._client] HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-vcs/v2/vehicles "HTTP/1.1 200 OK"
2022-09-20 08:06:52.901 DEBUG (MainThread) [httpx._client] HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-vcs/v2/vehicles "HTTP/1.1 200 OK"
2022-09-20 08:06:53.454 DEBUG (MainThread) [httpx._client] HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-vcs/v2/vehicles/VIN/state "HTTP/1.1 200 OK"
2022-09-20 08:06:53.458 DEBUG (MainThread) [custom_components.bmw_connected_drive.coordinator] Finished fetching bmw_connected_drive-ACCOUNT data in 2.457 seconds (success: True)
2022-09-20 08:11:53.893 DEBUG (MainThread) [httpx._client] HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-vcs/v2/vehicles "HTTP/1.1 200 OK"
2022-09-20 08:11:54.309 DEBUG (MainThread) [httpx._client] HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-vcs/v2/vehicles "HTTP/1.1 200 OK"
2022-09-20 08:11:54.358 DEBUG (MainThread) [httpx._client] HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-vcs/v2/vehicles/VIN/state "HTTP/1.1 403 Quota Exceeded"
2022-09-20 08:11:54.361 ERROR (MainThread) [custom_components.bmw_connected_drive.coordinator] Error fetching bmw_connected_drive-ACCOUNT data: Error communicating with BMW API: Client error '403 Quota Exceeded' for url 'https://cocoapi.bmwgroup.com/eadrax-vcs/v2/vehicles/VIN/state'
2022-09-20 08:11:54.362 DEBUG (MainThread) [custom_components.bmw_connected_drive.coordinator] Finished fetching bmw_connected_drive-ACCOUNT data in 1.361 seconds (success: False)
2022-09-20 08:16:54.231 DEBUG (MainThread) [httpx._client] HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-vcs/v2/vehicles "HTTP/1.1 403 Quota Exceeded"
2022-09-20 08:16:54.233 DEBUG (MainThread) [custom_components.bmw_connected_drive.coordinator] Finished fetching bmw_connected_drive-ACCOUNT data in 0.233 seconds (success: False)
2022-09-20 08:21:54.360 DEBUG (MainThread) [httpx._client] HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-vcs/v2/vehicles "HTTP/1.1 403 Quota Exceeded"
2022-09-20 08:21:54.362 DEBUG (MainThread) [custom_components.bmw_connected_drive.coordinator] Finished fetching bmw_connected_drive-ACCOUNT data in 0.361 seconds (success: False)
2022-09-20 08:26:54.744 DEBUG (MainThread) [httpx._client] HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-vcs/v2/vehicles "HTTP/1.1 200 OK"
2022-09-20 08:26:55.065 DEBUG (MainThread) [httpx._client] HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-vcs/v2/vehicles "HTTP/1.1 200 OK"
2022-09-20 08:26:55.537 DEBUG (MainThread) [httpx._client] HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-vcs/v2/vehicles/VIN/state "HTTP/1.1 200 OK"
2022-09-20 08:26:55.541 INFO (MainThread) [custom_components.bmw_connected_drive.coordinator] Fetching bmw_connected_drive-ACCOUNT data recovered

As we do a minimum of 3 requests (one for BMW vehicle list, one for MINI vehicle list, one for each vehicle), it could be that they are sometimes too close by each other (which would be weird since the BMW app does one for BMW vehicle list and then for each vehicle, too).

Either we are missing something in our HTTP header that the MyBMW app uses to get around the Quota or they just had a config error.

Changing the user agent won’t fix the problem - it has be be very specifically set otherwise you’ll get the bad request.

EDIT: And it is on/off again… 😄