core: BMW ConnectedDrive - MyBMW API error: HTTPStatusError: invalid_request

The problem

BMW ConnectedDrive does not seem to be able to connect anymore. In the logs I see the following error: “MyBMW API error: HTTPStatusError: invalid_request” and after that I see an error “Unexpected error fetching bmw_connected_drive-xxxxxxxxxxxxx@gmail.com data: ‘targetPressure’”. The official app (v3.1.1) still works. I already completely uninstalled and re-installed the component, but that didn’t help.

I see there is a newer version of bimmer_connected with some changes for the API. Will this solve the issue? Can the version in HA core be bumped to the newest version of bimmer_connected?

What version of Home Assistant Core has the issue?

2023.5.0

What was the last working version of Home Assistant Core?

2023.4.6

What type of installation are you running?

Home Assistant OS

Integration causing the issue

BMW Connected Drive

Link to integration documentation on our website

https://www.home-assistant.io/integrations/bmw_connected_drive/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

**First error**
Logger: bimmer_connected.api.authentication
Source: components/bmw_connected_drive/coordinator.py:58
First occurred: 22:01:30 (5 occurrences)
Last logged: 22:05:00

MyBMW API error: HTTPStatusError: invalid_request - The request is missing a required parameter, includes an unsupported parameter value (other than grant type), repeats a parameter, includes multiple credentials, utilizes more than one mechanism for authenticating the client, or is otherwise malformed

**Second error**
Logger: homeassistant.components.bmw_connected_drive.coordinator
Source: components/bmw_connected_drive/coordinator.py:58
Integration: BMW Connected Drive (documentation, issues)
First occurred: 22:01:38 (5 occurrences)
Last logged: 22:05:03

Unexpected error fetching bmw_connected_drive-xxxxxxxxxxxx@gmail.com data: 'targetPressure'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/components/bmw_connected_drive/coordinator.py", line 58, in _async_update_data
    await self.account.get_vehicles()
  File "/usr/local/lib/python3.10/site-packages/bimmer_connected/account.py", line 132, in get_vehicles
    self.add_vehicle(vehicle.data, vehicle_state, charging_settings, fetched_at)
  File "/usr/local/lib/python3.10/site-packages/bimmer_connected/account.py", line 147, in add_vehicle
    existing_vehicle.update_state(vehicle_base, vehicle_state, charging_settings, fetched_at)
  File "/usr/local/lib/python3.10/site-packages/bimmer_connected/vehicle/vehicle.py", line 119, in update_state
    setattr(self, vehicle_attribute, cls.from_vehicle_data(vehicle_data))
  File "/usr/local/lib/python3.10/site-packages/bimmer_connected/models.py", line 37, in from_vehicle_data
    parsed = cls._parse_vehicle_data(vehicle_data) or {}
  File "/usr/local/lib/python3.10/site-packages/bimmer_connected/vehicle/tires.py", line 53, in _parse_vehicle_data
    retval["front_left"] = TireState(**vehicle_data[ATTR_STATE]["tireState"]["frontLeft"])
  File "/usr/local/lib/python3.10/site-packages/bimmer_connected/vehicle/tires.py", line 16, in __init__
    self.target_pressure: int = status["targetPressure"]
KeyError: 'targetPressure'

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 44 (11 by maintainers)

Most upvoted comments

This will be fixed in 2023.5.3 as #92648 got merged.

I have the same logging as @peterossege.

I also have the fingerprint, maybe this can help debugging.

DEBUG:asyncio:Using selector: EpollSelector
DEBUG:bimmer_connected.account:Getting vehicle list
DEBUG:bimmer_connected.account:Getting vehicle list
DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False
DEBUG:httpx:load_verify_locations cafile='/etc/ssl/certs/ca-certificates.crt'
DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False
DEBUG:httpx:load_verify_locations cafile='/etc/ssl/certs/ca-certificates.crt'
DEBUG:bimmer_connected.api.authentication:Authenticating with MyBMW flow for North America & Rest of World.
DEBUG:httpcore:connection.connect_tcp.started host='cocoapi.bmwgroup.com' port=443 local_address=None timeout=30.0
DEBUG:httpcore:connection.connect_tcp.complete return_value=<httpcore.backends.asyncio.AsyncIOStream object at 0x7f1f8ab2de70>
DEBUG:httpcore:connection.start_tls.started ssl_context=<ssl.SSLContext object at 0x7f1f8abfff40> server_hostname='cocoapi.bmwgroup.com' timeout=30.0
DEBUG:httpcore:connection.start_tls.complete return_value=<httpcore.backends.asyncio.AsyncIOStream object at 0x7f1f8ac584f0>
DEBUG:httpcore:http11.send_request_headers.started request=<Request [b'GET']>
DEBUG:httpcore:http11.send_request_headers.complete
DEBUG:httpcore:http11.send_request_body.started request=<Request [b'GET']>
DEBUG:httpcore:http11.send_request_body.complete
DEBUG:httpcore:http11.receive_response_headers.started request=<Request [b'GET']>
DEBUG:httpcore:http11.receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Content-Length', b'580'), (b'Content-Type', b'application/json; charset=utf-8'), (b'x-correlation-id', b'c482021e-463d-41c8-aea2-886e90d16103'), (b'x-cluster-mock-used', b'false'), (b'Strict-Transport-Security', b'max-age=31536000; includeSubDomains'), (b'X-Content-Type-Options', b'nosniff'), (b'Content-Security-Policy', b"default-src 'self'"), (b'Request-Context', b'appId=cid-v1:24f34ad2-7e62-4399-93db-3071c599c619'), (b'Date', b'Fri, 05 May 2023 09:11:04 GMT')])
DEBUG:httpx:HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-ucs/v1/presentation/oauth/config "HTTP/1.1 200 OK"
DEBUG:httpcore:http11.receive_response_body.started request=<Request [b'GET']>
DEBUG:httpcore:http11.receive_response_body.complete
DEBUG:httpcore:http11.response_closed.started
DEBUG:httpcore:http11.response_closed.complete
DEBUG:httpcore:connection.connect_tcp.started host='customer.bmwgroup.com' port=443 local_address=None timeout=30.0
DEBUG:httpcore:connection.connect_tcp.complete return_value=<httpcore.backends.asyncio.AsyncIOStream object at 0x7f1f8ab67220>
DEBUG:httpcore:connection.start_tls.started ssl_context=<ssl.SSLContext object at 0x7f1f8abfff40> server_hostname='customer.bmwgroup.com' timeout=30.0
DEBUG:httpcore:connection.start_tls.complete return_value=<httpcore.backends.asyncio.AsyncIOStream object at 0x7f1f8ab671f0>
DEBUG:httpcore:http11.send_request_headers.started request=<Request [b'POST']>
DEBUG:httpcore:http11.send_request_headers.complete
DEBUG:httpcore:http11.send_request_body.started request=<Request [b'POST']>
DEBUG:httpcore:http11.send_request_body.complete
DEBUG:httpcore:http11.receive_response_headers.started request=<Request [b'POST']>
DEBUG:httpcore:http11.receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Fri, 05 May 2023 09:11:05 GMT'), (b'Content-Type', b'application/json'), (b'Content-Length', b'411'), (b'Connection', b'keep-alive'), (b'x-frame-options', b'SAMEORIGIN'), (b'x-content-type-options', b'nosniff'), (b'cache-control', b'private'), (b'cache-control', b'no-cache, no-store, must-revalidate'), (b'set-cookie', b'GCDMSSO=K9WCpexRH2NOydlGCwQCIE622xQ.*AAJTSQACMDIAAlNLABxLNkFxU3lzLzdkSWUwYVMrK2pYc2pkbWRnSkE9AAR0eXBlAANDVFMAAlMxAAIwMQ..*; Path=/; Domain=customer.bmwgroup.com; Secure; HttpOnly; SameSite=lax'), (b'expires', b'0'), (b'pragma', b'no-cache'), (b'x-c2b-pwpolicyconform', b'true'), (b'Strict-Transport-Security', b'max-age=15724800; includeSubDomains'), (b'Access-Control-Allow-Origin', b''), (b'Access-Control-Allow-Headers', b'Authorization, Origin, X-c2b-Authorization, X-c2b-mTAN, X-Requested-With, X-c2b-Sender-Id, X-c2b-External-Id, Content-Type, Accept, Cache-Control, KeyId, x-dtc'), (b'Access-Control-Max-Age', b'3628800'), (b'Access-Control-Allow-Credentials', b'true'), (b'Access-Control-Allow-Methods', b'POST, GET, OPTIONS, PUT, DELETE, HEAD'), (b'Referrer-Policy', b'strict-origin'), (b'x-c2b-request-id', b'rrt-4680027111680345557-b-geu3-15680-29532168-1')])
DEBUG:httpx:HTTP Request: POST https://customer.bmwgroup.com/gcdm/oauth/authenticate "HTTP/1.1 200 OK"
DEBUG:httpcore:http11.receive_response_body.started request=<Request [b'POST']>
DEBUG:httpcore:http11.receive_response_body.complete
DEBUG:httpcore:http11.response_closed.started
DEBUG:httpcore:http11.response_closed.complete
DEBUG:httpcore:http11.send_request_headers.started request=<Request [b'POST']>
DEBUG:httpcore:http11.send_request_headers.complete
DEBUG:httpcore:http11.send_request_body.started request=<Request [b'POST']>
DEBUG:httpcore:http11.send_request_body.complete
DEBUG:httpcore:http11.receive_response_headers.started request=<Request [b'POST']>
DEBUG:httpcore:http11.receive_response_headers.complete return_value=(b'HTTP/1.1', 302, b'Found', [(b'Date', b'Fri, 05 May 2023 09:11:05 GMT'), (b'Content-Length', b'0'), (b'Connection', b'keep-alive'), (b'x-frame-options', b'SAMEORIGIN'), (b'x-content-type-options', b'nosniff'), (b'cache-control', b'no-store'), (b'location', b'com.bmw.connected://oauth?code=nYomIdq6c57D4N0wnAOGEan8-cs&state=zLOhxo0kG68w3nmEvsxXaj&client_id=31c357a0-7a1d-4590-aa99-33b97244d048&nonce=login_nonce'), (b'pragma', b'no-cache'), (b'set-cookie', b'OAUTH_REQUEST_ATTRIBUTES=DELETED; Expires=Thu, 01 Jan 1970 00:00:00 GMT; Path=/; Domain=customer.bmwgroup.com; Secure; HttpOnly; SameSite=lax'), (b'set-cookie', b'OAUTH_REQUEST_ATTRIBUTES=DELETED; Expires=Thu, 01 Jan 1970 00:00:00 GMT; Path=/; Domain=prod-gcdm.eu-central-1.aws.cloud.bmw; Secure; HttpOnly; SameSite=lax'), (b'Strict-Transport-Security', b'max-age=15724800; includeSubDomains'), (b'Access-Control-Allow-Origin', b''), (b'Access-Control-Allow-Headers', b'Authorization, Origin, X-c2b-Authorization, X-c2b-mTAN, X-Requested-With, X-c2b-Sender-Id, X-c2b-External-Id, Content-Type, Accept, Cache-Control, KeyId, x-dtc'), (b'Access-Control-Max-Age', b'3628800'), (b'Access-Control-Allow-Credentials', b'true'), (b'Access-Control-Allow-Methods', b'POST, GET, OPTIONS, PUT, DELETE, HEAD'), (b'Referrer-Policy', b'strict-origin'), (b'x-c2b-request-id', b'rrt-4680027111680345557-b-geu3-15680-29532168-2')])
DEBUG:httpx:HTTP Request: POST https://customer.bmwgroup.com/gcdm/oauth/authenticate?interaction-id=26a68fc7-b507-4f21-aff0-fe4c7a6c77e0&client-version=android%28TQ2A.230405.003.B2%29%3Bbmw%3B3.3.1%2822418%29%3Brow "HTTP/1.1 302 Found"
DEBUG:httpcore:http11.receive_response_body.started request=<Request [b'POST']>
DEBUG:httpcore:http11.receive_response_body.complete
DEBUG:httpcore:http11.response_closed.started
DEBUG:httpcore:http11.response_closed.complete
DEBUG:httpcore:http11.send_request_headers.started request=<Request [b'POST']>
DEBUG:httpcore:http11.send_request_headers.complete
DEBUG:httpcore:http11.send_request_body.started request=<Request [b'POST']>
DEBUG:httpcore:http11.send_request_body.complete
DEBUG:httpcore:http11.receive_response_headers.started request=<Request [b'POST']>
DEBUG:httpcore:http11.receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Fri, 05 May 2023 09:11:05 GMT'), (b'Content-Type', b'application/json'), (b'Content-Length', b'1971'), (b'Connection', b'keep-alive'), (b'Cache-Control', b'no-cache,no-store'), (b'Pragma', b'no-cache'), (b'Access-Control-Allow-Origin', b''), (b'Access-Control-Allow-Headers', b'Authorization, Origin, X-c2b-Authorization, X-c2b-mTAN, X-Requested-With, X-c2b-Sender-Id, X-c2b-External-Id, Content-Type, Accept, Cache-Control, KeyId, x-dtc'), (b'Access-Control-Max-Age', b'3628800'), (b'Access-Control-Allow-Credentials', b'true'), (b'Access-Control-Allow-Methods', b'POST, GET, OPTIONS, PUT, DELETE, HEAD'), (b'Referrer-Policy', b'strict-origin'), (b'x-c2b-request-id', b'rrt-4680027111680345557-b-geu3-15680-29532168-3')])
DEBUG:httpx:HTTP Request: POST https://customer.bmwgroup.com/gcdm/oauth/token "HTTP/1.1 200 OK"
DEBUG:httpcore:http11.receive_response_body.started request=<Request [b'POST']>
DEBUG:httpcore:http11.receive_response_body.complete
DEBUG:httpcore:http11.response_closed.started
DEBUG:httpcore:http11.response_closed.complete
DEBUG:httpcore:connection.close.started
DEBUG:httpcore:connection.close.complete
DEBUG:httpcore:connection.close.started
DEBUG:httpcore:connection.close.complete
DEBUG:httpcore:connection.connect_tcp.started host='cocoapi.bmwgroup.com' port=443 local_address=None timeout=30.0
DEBUG:httpcore:connection.connect_tcp.complete return_value=<httpcore.backends.asyncio.AsyncIOStream object at 0x7f1f8abd6a40>
DEBUG:httpcore:connection.start_tls.started ssl_context=<ssl.SSLContext object at 0x7f1f8abffe40> server_hostname='cocoapi.bmwgroup.com' timeout=30.0
DEBUG:httpcore:connection.start_tls.complete return_value=<httpcore.backends.asyncio.AsyncIOStream object at 0x7f1f8ac59390>
DEBUG:httpcore:http11.send_request_headers.started request=<Request [b'GET']>
DEBUG:httpcore:http11.send_request_headers.complete
DEBUG:httpcore:http11.send_request_body.started request=<Request [b'GET']>
DEBUG:httpcore:http11.send_request_body.complete
DEBUG:httpcore:http11.receive_response_headers.started request=<Request [b'GET']>
DEBUG:httpcore:http11.receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Content-Length', b'896'), (b'Content-Type', b'application/json; charset=utf-8'), (b'x-cluster-mock-used', b'false'), (b'x-correlation-id', b'7c3f082a-bad6-435d-9c11-8677b8270a67'), (b'Strict-Transport-Security', b'max-age=31536000; includeSubDomains'), (b'X-Content-Type-Options', b'nosniff'), (b'Content-Security-Policy', b"default-src 'self'"), (b'Request-Context', b'appId=cid-v1:24f34ad2-7e62-4399-93db-3071c599c619'), (b'Date', b'Fri, 05 May 2023 09:11:06 GMT')])
DEBUG:httpx:HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-vcs/v4/vehicles "HTTP/1.1 200 OK"
DEBUG:httpcore:http11.receive_response_body.started request=<Request [b'GET']>
DEBUG:httpcore:http11.receive_response_body.complete
DEBUG:httpcore:http11.response_closed.started
DEBUG:httpcore:http11.response_closed.complete
DEBUG:httpcore:http11.send_request_headers.started request=<Request [b'GET']>
DEBUG:httpcore:http11.send_request_headers.complete
DEBUG:httpcore:http11.send_request_body.started request=<Request [b'GET']>
DEBUG:httpcore:http11.send_request_body.complete
DEBUG:httpcore:http11.receive_response_headers.started request=<Request [b'GET']>
DEBUG:httpcore:http11.receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Content-Length', b'2'), (b'Content-Type', b'application/json; charset=utf-8'), (b'x-cluster-mock-used', b'false'), (b'x-correlation-id', b'469e018a-e07f-40aa-ac1d-dc1797f69060'), (b'Strict-Transport-Security', b'max-age=31536000; includeSubDomains'), (b'X-Content-Type-Options', b'nosniff'), (b'Content-Security-Policy', b"default-src 'self'"), (b'Request-Context', b'appId=cid-v1:24f34ad2-7e62-4399-93db-3071c599c619'), (b'Date', b'Fri, 05 May 2023 09:11:06 GMT')])
DEBUG:httpx:HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-vcs/v4/vehicles "HTTP/1.1 200 OK"
DEBUG:httpcore:http11.receive_response_body.started request=<Request [b'GET']>
DEBUG:httpcore:http11.receive_response_body.complete
DEBUG:httpcore:http11.response_closed.started
DEBUG:httpcore:http11.response_closed.complete
DEBUG:httpcore:connection.close.started
DEBUG:httpcore:connection.close.complete
DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False
DEBUG:httpx:load_verify_locations cafile='/etc/ssl/certs/ca-certificates.crt'
DEBUG:httpcore:connection.connect_tcp.started host='cocoapi.bmwgroup.com' port=443 local_address=None timeout=30.0
DEBUG:httpcore:connection.connect_tcp.complete return_value=<httpcore.backends.asyncio.AsyncIOStream object at 0x7f1f8abd6110>
DEBUG:httpcore:connection.start_tls.started ssl_context=<ssl.SSLContext object at 0x7f1f8ab33040> server_hostname='cocoapi.bmwgroup.com' timeout=30.0
DEBUG:httpcore:connection.start_tls.complete return_value=<httpcore.backends.asyncio.AsyncIOStream object at 0x7f1f8abd6560>
DEBUG:httpcore:http11.send_request_headers.started request=<Request [b'GET']>
DEBUG:httpcore:http11.send_request_headers.complete
DEBUG:httpcore:http11.send_request_body.started request=<Request [b'GET']>
DEBUG:httpcore:http11.send_request_body.complete
DEBUG:httpcore:http11.receive_response_headers.started request=<Request [b'GET']>
DEBUG:httpcore:http11.receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Content-Length', b'4718'), (b'Content-Type', b'application/json; charset=utf-8'), (b'x-cluster-mock-used', b'false'), (b'x-correlation-id', b'88ebc23c-03e0-424b-aa30-6248f9345131'), (b'Strict-Transport-Security', b'max-age=31536000; includeSubDomains'), (b'X-Content-Type-Options', b'nosniff'), (b'Content-Security-Policy', b"default-src 'self'"), (b'Request-Context', b'appId=cid-v1:24f34ad2-7e62-4399-93db-3071c599c619'), (b'Date', b'Fri, 05 May 2023 09:11:07 GMT')])
DEBUG:httpx:HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-vcs/v4/vehicles/state?apptimezone=120.0&appDateTime=1683277865352 "HTTP/1.1 200 OK"
DEBUG:httpcore:http11.receive_response_body.started request=<Request [b'GET']>
DEBUG:httpcore:http11.receive_response_body.complete
DEBUG:httpcore:http11.response_closed.started
DEBUG:httpcore:http11.response_closed.complete
DEBUG:httpcore:http11.send_request_headers.started request=<Request [b'GET']>
DEBUG:httpcore:http11.send_request_headers.complete
DEBUG:httpcore:http11.send_request_body.started request=<Request [b'GET']>
DEBUG:httpcore:http11.send_request_body.complete
DEBUG:httpcore:http11.receive_response_headers.started request=<Request [b'GET']>
DEBUG:httpcore:http11.receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Transfer-Encoding', b'chunked'), (b'Content-Type', b'application/json; charset=utf-8'), (b'Content-Encoding', b'gzip'), (b'Vary', b'Accept-Encoding'), (b'Request-Context', b'appId=cid-v1:24f34ad2-7e62-4399-93db-3071c599c619'), (b'api-supported-versions', b'1.0,2.0'), (b'Strict-Transport-Security', b'max-age=31536000; includeSubDomains'), (b'X-Content-Type-Options', b'nosniff'), (b'Content-Security-Policy', b"default-src 'self'"), (b'Date', b'Fri, 05 May 2023 09:11:07 GMT')])
DEBUG:httpx:HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-crccs/v2/vehicles?fields=charging-profile&has_charging_settings_capabilities=false "HTTP/1.1 200 OK"
DEBUG:httpcore:http11.receive_response_body.started request=<Request [b'GET']>
DEBUG:httpcore:http11.receive_response_body.complete
DEBUG:httpcore:http11.response_closed.started
DEBUG:httpcore:http11.response_closed.complete
DEBUG:httpcore:connection.close.started
DEBUG:httpcore:connection.close.complete
Traceback (most recent call last):
  File "/home/niels/.local/bin/./bimmerconnected", line 8, in <module>
    sys.exit(main())
  File "/home/niels/.local/lib/python3.10/site-packages/bimmer_connected/cli.py", line 356, in main
    loop.run_until_complete(args.func(args))
  File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/home/niels/.local/lib/python3.10/site-packages/bimmer_connected/cli.py", line 175, in fingerprint
    await account.get_vehicles()
  File "/home/niels/.local/lib/python3.10/site-packages/bimmer_connected/account.py", line 132, in get_vehicles
    self.add_vehicle(vehicle.data, vehicle_state, charging_settings, fetched_at)
  File "/home/niels/.local/lib/python3.10/site-packages/bimmer_connected/account.py", line 147, in add_vehicle
    existing_vehicle.update_state(vehicle_base, vehicle_state, charging_settings, fetched_at)
  File "/home/niels/.local/lib/python3.10/site-packages/bimmer_connected/vehicle/vehicle.py", line 119, in update_state
    setattr(self, vehicle_attribute, cls.from_vehicle_data(vehicle_data))
  File "/home/niels/.local/lib/python3.10/site-packages/bimmer_connected/models.py", line 37, in from_vehicle_data
    parsed = cls._parse_vehicle_data(vehicle_data) or {}
  File "/home/niels/.local/lib/python3.10/site-packages/bimmer_connected/vehicle/tires.py", line 53, in _parse_vehicle_data
    retval["front_left"] = TireState(**vehicle_data[ATTR_STATE]["tireState"]["frontLeft"])
  File "/home/niels/.local/lib/python3.10/site-packages/bimmer_connected/vehicle/tires.py", line 16, in __init__
    self.target_pressure: int = status["targetPressure"]
KeyError: 'targetPressure'

I updated yesterday and all seems to work fine, however I did actually remove it first and then added it again (using same names etc) and then it worked just as before incl scripts and stuff added to the control panel.

I can confirm that the temporary fix from @slashback100 works. It seems that the targetPressure is not available anymore in the JSON responses.

If others want to apply this temp fix:

  • Install add-on Advanced SSH & Web Terminal, add it to the sidebar and open the add-on
  • Insert the command docker exec -it $(docker ps -f name=homeassistant -q) bash to go into the docker of HA
  • Now use vi to edit the file, so use the command vi ./usr/local/lib/python3.10/site-packages/bimmer_connected/vehicle/tires.py
  • Comment the 16th line by putting a # in front of the line
  • Restart HA

I have the same issue. The logfile contains infos about tire presure. It seems to be new. My logs:


2023-05-05 07:35:43.025 DEBUG (MainThread) [bimmer_connected.account] Getting vehicle list 2023-05-05 07:35:43.025 DEBUG (MainThread) [bimmer_connected.account] Getting vehicle list 2023-05-05 07:35:43.241 DEBUG (MainThread) [bimmer_connected.api.authentication] Authenticating with refresh token for North America & Rest of World. 2023-05-05 07:35:43.828 ERROR (MainThread) [bimmer_connected.api.authentication] MyBMW API error: HTTPStatusError: invalid_request - The request is missing a required parameter, includes an unsupported parameter value (other than grant type), repeats a parameter, includes multiple credentials, utilizes more than one mechanism for authenticating the client, or is otherwise malformed 2023-05-05 07:35:43.833 DEBUG (MainThread) [bimmer_connected.api.authentication] Unable to get access token using refresh token, falling back to username/password. 2023-05-05 07:35:43.927 DEBUG (MainThread) [bimmer_connected.api.authentication] Authenticating with MyBMW flow for North America & Rest of World. 2023-05-05 07:35:46.364 ERROR (MainThread) [homeassistant.components.bmw_connected_drive.coordinator] Unexpected error fetching bmw_connected_drive-my.mail@adress.com data: ‘targetPressure’ Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py”, line 258, in _async_refresh self.data = await self._async_update_data() File “/usr/src/homeassistant/homeassistant/components/bmw_connected_drive/coordinator.py”, line 58, in _async_update_data await self.account.get_vehicles() File “/usr/local/lib/python3.10/site-packages/bimmer_connected/account.py”, line 132, in get_vehicles self.add_vehicle(vehicle.data, vehicle_state, charging_settings, fetched_at) File “/usr/local/lib/python3.10/site-packages/bimmer_connected/account.py”, line 147, in add_vehicle existing_vehicle.update_state(vehicle_base, vehicle_state, charging_settings, fetched_at) File “/usr/local/lib/python3.10/site-packages/bimmer_connected/vehicle/vehicle.py”, line 119, in update_state setattr(self, vehicle_attribute, cls.from_vehicle_data(vehicle_data)) File “/usr/local/lib/python3.10/site-packages/bimmer_connected/models.py”, line 37, in from_vehicle_data parsed = cls._parse_vehicle_data(vehicle_data) or {} File “/usr/local/lib/python3.10/site-packages/bimmer_connected/vehicle/tires.py”, line 53, in _parse_vehicle_data retval[“front_left”] = TireState(**vehicle_data[ATTR_STATE][“tireState”][“frontLeft”]) File “/usr/local/lib/python3.10/site-packages/bimmer_connected/vehicle/tires.py”, line 16, in init self.target_pressure: int = status[“targetPressure”] KeyError: ‘targetPressure’ 2023-05-05 07:35:46.368 DEBUG (MainThread) [homeassistant.components.bmw_connected_drive.coordinator] Finished fetching bmw_connected_drive-my.mail@adress.com data in 3.344 seconds (success: False) 2023-05-05 07:36:06.609 DEBUG (MainThread) [bimmer_connected.account] Getting vehicle list 2023-05-05 07:36:06.610 DEBUG (MainThread) [bimmer_connected.account] Getting vehicle list 2023-05-05 07:36:06.802 DEBUG (MainThread) [bimmer_connected.api.authentication] Authenticating with refresh token for North America & Rest of World. 2023-05-05 07:36:07.175 ERROR (MainThread) [bimmer_connected.api.authentication] MyBMW API error: HTTPStatusError: invalid_request - The request is missing a required parameter, includes an unsupported parameter value (other than grant type), repeats a parameter, includes multiple credentials, utilizes more than one mechanism for authenticating the client, or is otherwise malformed 2023-05-05 07:36:07.181 DEBUG (MainThread) [bimmer_connected.api.authentication] Unable to get access token using refresh token, falling back to username/password. 2023-05-05 07:36:07.275 DEBUG (MainThread) [bimmer_connected.api.authentication] Authenticating with MyBMW flow for North America & Rest of World. 2023-05-05 07:36:09.988 ERROR (MainThread) [homeassistant.components.bmw_connected_drive.coordinator] Unexpected error fetching bmw_connected_drive-my.mail@adress.com data: ‘targetPressure’ Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py”, line 258, in _async_refresh self.data = await self._async_update_data() File “/usr/src/homeassistant/homeassistant/components/bmw_connected_drive/coordinator.py”, line 58, in _async_update_data await self.account.get_vehicles() File “/usr/local/lib/python3.10/site-packages/bimmer_connected/account.py”, line 132, in get_vehicles self.add_vehicle(vehicle.data, vehicle_state, charging_settings, fetched_at) File “/usr/local/lib/python3.10/site-packages/bimmer_connected/account.py”, line 147, in add_vehicle existing_vehicle.update_state(vehicle_base, vehicle_state, charging_settings, fetched_at) File “/usr/local/lib/python3.10/site-packages/bimmer_connected/vehicle/vehicle.py”, line 119, in update_state setattr(self, vehicle_attribute, cls.from_vehicle_data(vehicle_data)) File “/usr/local/lib/python3.10/site-packages/bimmer_connected/models.py”, line 37, in from_vehicle_data parsed = cls._parse_vehicle_data(vehicle_data) or {} File “/usr/local/lib/python3.10/site-packages/bimmer_connected/vehicle/tires.py”, line 53, in _parse_vehicle_data retval[“front_left”] = TireState(**vehicle_data[ATTR_STATE][“tireState”][“frontLeft”]) File “/usr/local/lib/python3.10/site-packages/bimmer_connected/vehicle/tires.py”, line 16, in init self.target_pressure: int = status[“targetPressure”] KeyError: ‘targetPressure’ 2023-05-05 07:36:09.992 DEBUG (MainThread) [homeassistant.components.bmw_connected_drive.coordinator] Finished fetching bmw_connected_drive-my.mail@adress.com data in 3.383 seconds (success: False) 2023-05-05 07:36:50.327 DEBUG (MainThread) [bimmer_connected.account] Getting vehicle list 2023-05-05 07:36:50.328 DEBUG (MainThread) [bimmer_connected.account] Getting vehicle list 2023-05-05 07:36:50.518 DEBUG (MainThread) [bimmer_connected.api.authentication] Authenticating with refresh token for North America & Rest of World. 2023-05-05 07:36:51.021 ERROR (MainThread) [bimmer_connected.api.authentication] MyBMW API error: HTTPStatusError: invalid_request - The request is missing a required parameter, includes an unsupported parameter value (other than grant type), repeats a parameter, includes multiple credentials, utilizes more than one mechanism for authenticating the client, or is otherwise malformed 2023-05-05 07:36:51.034 DEBUG (MainThread) [bimmer_connected.api.authentication] Unable to get access token using refresh token, falling back to username/password. 2023-05-05 07:36:51.132 DEBUG (MainThread) [bimmer_connected.api.authentication] Authenticating with MyBMW flow for North America & Rest of World. 2023-05-05 07:36:56.593 ERROR (MainThread) [homeassistant.components.bmw_connected_drive.coordinator] Unexpected error fetching bmw_connected_drive-my.mail@adress.com data: ‘targetPressure’ Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py”, line 258, in _async_refresh self.data = await self._async_update_data() File “/usr/src/homeassistant/homeassistant/components/bmw_connected_drive/coordinator.py”, line 58, in _async_update_data await self.account.get_vehicles() File “/usr/local/lib/python3.10/site-packages/bimmer_connected/account.py”, line 132, in get_vehicles self.add_vehicle(vehicle.data, vehicle_state, charging_settings, fetched_at) File “/usr/local/lib/python3.10/site-packages/bimmer_connected/account.py”, line 147, in add_vehicle existing_vehicle.update_state(vehicle_base, vehicle_state, charging_settings, fetched_at) File “/usr/local/lib/python3.10/site-packages/bimmer_connected/vehicle/vehicle.py”, line 119, in update_state setattr(self, vehicle_attribute, cls.from_vehicle_data(vehicle_data)) File “/usr/local/lib/python3.10/site-packages/bimmer_connected/models.py”, line 37, in from_vehicle_data parsed = cls._parse_vehicle_data(vehicle_data) or {} File “/usr/local/lib/python3.10/site-packages/bimmer_connected/vehicle/tires.py”, line 53, in _parse_vehicle_data retval[“front_left”] = TireState(**vehicle_data[ATTR_STATE][“tireState”][“frontLeft”]) File “/usr/local/lib/python3.10/site-packages/bimmer_connected/vehicle/tires.py”, line 16, in init self.target_pressure: int = status[“targetPressure”] KeyError: ‘targetPressure’ 2023-05-05 07:36:56.598 DEBUG (MainThread) [homeassistant.components.bmw_connected_drive.coordinator] Finished fetching bmw_connected_drive-my.mail@adress.com data in 6.271 seconds (success: False)