seit ca. 3 Monaten habe ich einen neuen BMW i5. Ich würde gerne den SoC aus dem Fahrzeug auslesen und habe folgendes versucht:
Benutzername und Kennwort habe ich aus der MyBMW App genommen. VIN ist eh klar und Captcha habe ich laut Doku erstellt. Gibt es etwas, was ich vergessen habe.
Leider bekomme ich aber immer folgendes:
Code: Alles auswählen
es.bmwbc.api:175} - {ERROR:fetch soc_ev3} - bmwbc.fetch_soc: requestData Error, vnum: 3 err=MyBMWAuthError('HTTPStatusError: invalid_client - Client authentication failed (e.g., login failure, unknown client, no client authentication included or unsupported authentication method)'), type(err)=<class 'bimmer_connected.models.MyBMWAuthError'>
2025-09-30 10:04:25,891 - {modules.common.fault_state:49} - {ERROR:fetch soc_ev3} - BMW & Mini : FaultState FaultStateLevel.ERROR, FaultStr <class 'bimmer_connected.models.MyBMWAuthError'> ('HTTPStatusError: invalid_client - Client authentication failed (e.g., login failure, unknown client, no client authentication included or unsupported authentication method)',), Traceback:
Traceback (most recent call last):
File "/home/openwb/.local/lib/python3.9/site-packages/bimmer_connected/api/authentication.py", line 411, in raise_for_status_event_handler
response.raise_for_status()
File "/home/openwb/.local/lib/python3.9/site-packages/httpx/_models.py", line 763, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '401 Unauthorized' for url 'https://customer.bmwgroup.com/gcdm/oauth/authenticate'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/var/www/html/openWB/packages/modules/common/configurable_vehicle.py", line 66, in update
car_state = self._get_carstate_by_source(vehicle_update_data, source)
File "/var/www/html/openWB/packages/modules/common/configurable_vehicle.py", line 117, in _get_carstate_by_source
return self.__component_updater(vehicle_update_data)
File "/var/www/html/openWB/packages/modules/vehicles/bmwbc/soc.py", line 20, in updater
return api.fetch_soc(
File "/var/www/html/openWB/packages/modules/vehicles/bmwbc/api.py", line 188, in fetch_soc
soc, range = loop.run_until_complete(_fetch_soc(user_id, password, vin, captcha_token, vnum))
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/var/www/html/openWB/packages/modules/vehicles/bmwbc/api.py", line 141, in _fetch_soc
await account.get_vehicles()
File "/home/openwb/.local/lib/python3.9/site-packages/bimmer_connected/account.py", line 114, in get_vehicles
await self._init_vehicles()
File "/home/openwb/.local/lib/python3.9/site-packages/bimmer_connected/account.py", line 86, in _init_vehicles
vehicle_list_response = await client.post(
File "/home/openwb/.local/lib/python3.9/site-packages/httpx/_client.py", line 1905, in post
return await self.request(
File "/home/openwb/.local/lib/python3.9/site-packages/httpx/_client.py", line 1585, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
File "/home/openwb/.local/lib/python3.9/site-packages/httpx/_client.py", line 1674, in send
response = await self._send_handling_auth(
File "/home/openwb/.local/lib/python3.9/site-packages/httpx/_client.py", line 1699, in _send_handling_auth
request = await auth_flow.__anext__()
File "/home/openwb/.local/lib/python3.9/site-packages/bimmer_connected/api/authentication.py", line 88, in async_auth_flow
await self.login()
File "/home/openwb/.local/lib/python3.9/site-packages/bimmer_connected/api/authentication.py", line 137, in login
token_data = await self._login_row_na()
File "/home/openwb/.local/lib/python3.9/site-packages/bimmer_connected/api/authentication.py", line 199, in _login_row_na
response = await client.post(
File "/home/openwb/.local/lib/python3.9/site-packages/httpx/_client.py", line 1905, in post
return await self.request(
File "/home/openwb/.local/lib/python3.9/site-packages/httpx/_client.py", line 1585, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
File "/home/openwb/.local/lib/python3.9/site-packages/httpx/_client.py", line 1674, in send
response = await self._send_handling_auth(
File "/home/openwb/.local/lib/python3.9/site-packages/httpx/_client.py", line 1702, in _send_handling_auth
response = await self._send_handling_redirects(
File "/home/openwb/.local/lib/python3.9/site-packages/httpx/_client.py", line 1760, in _send_handling_redirects
raise exc
File "/home/openwb/.local/lib/python3.9/site-packages/httpx/_client.py", line 1742, in _send_handling_redirects
await hook(response)
File "/home/openwb/.local/lib/python3.9/site-packages/bimmer_connected/api/authentication.py", line 413, in raise_for_status_event_handler
await handle_httpstatuserror(ex, module="AUTH", log_handler=_LOGGER)
File "/home/openwb/.local/lib/python3.9/site-packages/bimmer_connected/api/utils.py", line 89, in handle_httpstatuserror
raise _ex_to_raise(_err_message) from ex
bimmer_connected.models.MyBMWAuthError: HTTPStatusError: invalid_client - Client authentication failed (e.g., login failure, unknown client, no client authentication included or unsupported authentication method)
2025-09-30 10:09:28,235 - {modules.common.configurable_vehicle:56} - {DEBUG:fetch soc_ev3} - Vehicle Instance <class 'modules.vehicles.bmwbc.config.BMWbc'>
2025-09-30 10:09:28,240 - {modules.common.configurable_vehicle:57} - {DEBUG:fetch soc_ev3} - Calculated SoC-State CalculatedSocState(imported_start=0, manual_soc=None, soc_start=0)
2025-09-30 10:09:28,252 - {modules.common.configurable_vehicle:58} - {DEBUG:fetch soc_ev3} - Vehicle Update Data VehicleUpdateData(plug_state=True, charge_state=True, imported=1460661.99, battery_capacity=19000, efficiency=90, soc_from_cp=None, timestamp_soc_from_cp=None, soc_timestamp=None)
2025-09-30 10:09:28,256 - {modules.common.configurable_vehicle:59} - {DEBUG:fetch soc_ev3} - General Config GeneralVehicleConfig(use_soc_from_cp=False, request_interval_charging=300, request_interval_not_charging=43200, request_only_plugged=False)
2025-09-30 10:09:28,260 - {modules.common.component_context:26} - {DEBUG:fetch soc_ev3} - Update Komponente ['BMW & Mini ']
2025-09-30 10:09:28,264 - {asyncio:59} - {DEBUG:fetch soc_ev3} - Using selector: EpollSelectorHabt Ihr eine Idee