SOC BMW

Alles rund um SoC (Ladezustand des Fahrzeuges). Probleme, Fragen, Fehlfunktionen gehören hier hin
rleidner
Beiträge: 1289
Registriert: Mo Nov 02, 2020 9:50 am
Has thanked: 26 times
Been thanked: 96 times

Re: SOC BMW

Beitrag von rleidner »

Kurzes Update:
Ich habe jetzt mit 60 min Abfrageintervall nach knapp 2 Tagen den Fehler 408 auch wieder bekommen, d.h. ich kann das Problem reproduzieren und hoffentlich lösen.
Ich muss jetzt herausfinden, wie das Modul auf diese Fehler (408, 500) reagieren muss um das Anmelden per neuem captcha-Token zu vermeiden.
Bei ca. 2 Tagen bis zum Auftreten des Fehlers wird das leider etwas dauern.
openWB-2 Standard+ | openWB EVU Kit v2 MID| 9,9kWp mit Kostal Plenticore 8.5 plus | VW ID.3, Kia EV6, Smart EQ forfour
gdfde
Beiträge: 131
Registriert: So Mär 10, 2019 1:05 pm
Has thanked: 6 times
Been thanked: 3 times

Re: SOC BMW

Beitrag von gdfde »

kein Stress, alles gut, wir sind froh, dass du dich überhaupt so intensiv damit beschäftigst :-)
gdfde
Beiträge: 131
Registriert: So Mär 10, 2019 1:05 pm
Has thanked: 6 times
Been thanked: 3 times

Re: SOC BMW

Beitrag von gdfde »

Interessanterweise ist das Problem seit Mittwoch, 28.5., nicht mehr aufgetreten.
Ich hab aber den i3 seit Mittwoch auch nicht mehr angesteckt gehabt an der openWB.
rleidner
Beiträge: 1289
Registriert: Mo Nov 02, 2020 9:50 am
Has thanked: 26 times
Been thanked: 96 times

Re: SOC BMW

Beitrag von rleidner »

gdfde hat geschrieben: So Jun 01, 2025 5:44 pm Interessanterweise ist das Problem seit Mittwoch, 28.5., nicht mehr aufgetreten.
Ich hab aber den i3 seit Mittwoch auch nicht mehr angesteckt gehabt an der openWB.
Danke für die Info - das ist gut und schlecht zugleich.
Ich habe seit Mittwoch auch keinen Fehler mehr bekommen.

Ich hatte allerdings hier eine erste einfache Änderung eingebaut, um den Fehler möglicherweise zu vermeiden.
Wenn es bei Euch ohne diese Änderung auch nicht zu dem Problem kommt, kann man nicht sagen ob das etwas gebracht hat.

Also erst mal abwarten und weiter beobachten.
openWB-2 Standard+ | openWB EVU Kit v2 MID| 9,9kWp mit Kostal Plenticore 8.5 plus | VW ID.3, Kia EV6, Smart EQ forfour
heidanei
Beiträge: 147
Registriert: So Mai 02, 2021 5:42 pm
Has thanked: 12 times
Been thanked: 7 times

Re: SOC BMW

Beitrag von heidanei »

Hi! Seit letzter Woche wird auch eine neue Version der MyBMW-App ausgerollt (5.5.x), ich nehme an dass der Schluckauf hier mit Anpassungen am Backend dafür zusammenhängt. Zeitlich passt das jedenfalls gut zusammen. Ich musste letzte Woche auch einmal ein neues Token hochladen, aber seitdem läuft's wieder problemlos.

heidanei
Extrahirn
Beiträge: 38
Registriert: Fr Dez 04, 2020 8:13 pm
Been thanked: 2 times

Re: SOC BMW

Beitrag von Extrahirn »

Ich habe jetzt einen anderen Fehler (ich hatte keine Konfigurationsänderungen vorgenommen): VIN am Ende habe ich durch xxxxx ersetzt.

Code: Alles auswählen

2025-05-31 06:33:03,161 - {bimmer_connected.api.client:86} - {ERROR:fetch soc_ev0} - MyBMWAPIError due to HTTPStatusError: Failed to fetch Vehicle Features.
2025-05-31 06:33:03,166 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - close.started
2025-05-31 06:33:03,171 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - close.complete
2025-05-31 06:33:03,175 - {bimmer_connected.account:130} - {ERROR:fetch soc_ev0} - Unable to get details for vehicle WMWXP310302Pxxxxx - (MyBMWAPIError) HTTPStatusError: Failed to fetch Vehicle Features.
2025-05-31 06:33:03,180 - {modules.vehicles.bmwbc.api:336} - {ERROR:fetch soc_ev0} - bmwbc.fetch_soc: requestData Error, vehicle_id: 0 err=MyBMWAPIError('HTTPStatusError: Failed to fetch Vehicle Features.'), type(err)=<class 'bimmer_connected.models.MyBMWAPIError'>
2025-05-31 06:33:03,185 - {modules.common.fault_state:49} - {ERROR:fetch soc_ev0} - BMW (Bimmer): FaultState FaultStateLevel.ERROR, FaultStr <class 'modules.vehicles.bmwbc.api.RequestFailed'> ('SoC Request failed:\nHTTPStatusError: Failed to fetch Vehicle Features.',), Traceback: 
Traceback (most recent call last):
  File "/home/openwb/.local/lib/python3.9/site-packages/bimmer_connected/api/client.py", line 77, in raise_for_status_event_handler
    response.raise_for_status()
  File "/home/openwb/.local/lib/python3.9/site-packages/httpx/_models.py", line 761, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Server error '500 Internal Server Error' for url 'https://cocoapi.bmwgroup.com/eadrax-vcs/v4/vehicles/state?apptimezone=0&appDateTime=1748665976000'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/var/www/html/openWB/packages/modules/vehicles/bmwbc/api.py", line 291, in _fetch_soc
    await self._account[user_id].get_vehicles()
  File "/home/openwb/.local/lib/python3.9/site-packages/bimmer_connected/account.py", line 134, in get_vehicles
    raise ex
  File "/home/openwb/.local/lib/python3.9/site-packages/bimmer_connected/account.py", line 120, in get_vehicles
    await vehicle.get_vehicle_state()
  File "/home/openwb/.local/lib/python3.9/site-packages/bimmer_connected/vehicle/vehicle.py", line 108, in get_vehicle_state
    state_response = await client.get(
  File "/home/openwb/.local/lib/python3.9/site-packages/httpx/_client.py", line 1801, in get
    return await self.request(
  File "/home/openwb/.local/lib/python3.9/site-packages/httpx/_client.py", line 1574, 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 1661, in send
    response = await self._send_handling_auth(
  File "/home/openwb/.local/lib/python3.9/site-packages/httpx/_client.py", line 1689, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "/home/openwb/.local/lib/python3.9/site-packages/httpx/_client.py", line 1747, in _send_handling_redirects
    raise exc
  File "/home/openwb/.local/lib/python3.9/site-packages/httpx/_client.py", line 1729, in _send_handling_redirects
    await hook(response)
  File "/home/openwb/.local/lib/python3.9/site-packages/bimmer_connected/api/client.py", line 79, in raise_for_status_event_handler
    await handle_httpstatuserror(ex, 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.MyBMWAPIError: HTTPStatusError: Failed to fetch Vehicle Features.

During handling of the above exception, another exception occurred:

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 358, in fetch_soc
    soc, range, soc_tsX = loop.run_until_complete(api._fetch_soc(user_id, password, vin, captcha_token, vehicle_id))
  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 344, in _fetch_soc
    raise RequestFailed("SoC Request failed:\n" + str(err))
modules.vehicles.bmwbc.api.RequestFailed: SoC Request failed:
HTTPStatusError: Failed to fetch Vehicle Features.

2025-05-31 06:37:55,113 - {modules.common.configurable_vehicle:56} - {DEBUG:fetch soc_ev0} - Vehicle Instance <class 'modules.vehicles.bmwbc.config.BMWbc'>
2025-05-31 06:37:55,116 - {modules.common.configurable_vehicle:57} - {DEBUG:fetch soc_ev0} - Calculated SoC-State CalculatedSocState(imported_start=None, manual_soc=None, soc_start=75)
2025-05-31 06:37:55,121 - {modules.common.configurable_vehicle:58} - {DEBUG:fetch soc_ev0} - Vehicle Update Data VehicleUpdateData(plug_state=False, charge_state=False, imported=None, battery_capacity=30000, efficiency=90, soc_from_cp=None, timestamp_soc_from_cp=None, soc_timestamp=1748350488.0)
2025-05-31 06:37:55,124 - {modules.common.configurable_vehicle:59} - {DEBUG:fetch soc_ev0} - General Config GeneralVehicleConfig(use_soc_from_cp=False, request_interval_charging=300, request_interval_not_charging=3600, request_only_plugged=False)
2025-05-31 06:37:55,132 - {modules.common.component_context:31} - {DEBUG:fetch soc_ev0} - Update Komponente ['BMW (Bimmer)']
2025-05-31 06:37:55,139 - {asyncio:59} - {DEBUG:fetch soc_ev0} - Using selector: EpollSelector
2025-05-31 06:37:55,142 - {modules.vehicles.bmwbc.api:153} - {DEBUG:fetch soc_ev0} - #  Reuse api _instance
2025-05-31 06:37:55,145 - {modules.vehicles.bmwbc.api:166} - {DEBUG:fetch soc_ev0} - dataPath=/var/www/html/openWB/data/modules/bmwbc
2025-05-31 06:37:55,148 - {modules.vehicles.bmwbc.api:214} - {DEBUG:fetch soc_ev0} - captcha token unchanged
2025-05-31 06:37:55,151 - {modules.vehicles.bmwbc.api:222} - {INFO:fetch soc_ev0} - authenticate via current token set
2025-05-31 06:37:55,154 - {modules.vehicles.bmwbc.api:250} - {DEBUG:fetch soc_ev0} - # Create _clconf instance
2025-05-31 06:37:55,156 - {modules.vehicles.bmwbc.api:257} - {DEBUG:fetch soc_ev0} - # Create _account instance
2025-05-31 06:37:55,159 - {modules.vehicles.bmwbc.api:282} - {DEBUG:fetch soc_ev0} - # Proactive login to force refresh token before get_vehicles
2025-05-31 06:37:55,161 - {modules.vehicles.bmwbc.api:283} - {DEBUG:fetch soc_ev0} - # before proactive login:2025-05-31 04:31:58.650976+00:00/6v1PPNzQlyM4xzpT-dYDWpqG5fA
2025-05-31 06:37:55,208 - {bimmer_connected.api.authentication:257} - {DEBUG:fetch soc_ev0} - Authenticating with refresh token for North America & Rest of World.
2025-05-31 06:37:55,214 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - connect_tcp.started host='cocoapi.bmwgroup.com' port=443 local_address=None timeout=30.0 socket_options=None
2025-05-31 06:37:55,253 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - connect_tcp.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x6a4eca78>
2025-05-31 06:37:55,256 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - start_tls.started ssl_context=<ssl.SSLContext object at 0x6ead7b68> server_hostname='cocoapi.bmwgroup.com' timeout=30.0
2025-05-31 06:37:55,313 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - start_tls.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x6a4ad688>
2025-05-31 06:37:55,317 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - send_request_headers.started request=<Request [b'GET']>
2025-05-31 06:37:55,321 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - send_request_headers.complete
2025-05-31 06:37:55,323 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - send_request_body.started request=<Request [b'GET']>
2025-05-31 06:37:55,326 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - send_request_body.complete
2025-05-31 06:37:55,328 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - receive_response_headers.started request=<Request [b'GET']>
2025-05-31 06:37:55,410 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Sat, 31 May 2025 04:37:55 GMT'), (b'Content-Type', b'application/json; charset=utf-8'), (b'Content-Length', b'580'), (b'Connection', b'keep-alive'), (b'x-correlation-id', b'0ec8e0be-4f80-49d0-a6ce-d97198785987'), (b'bmw-correlation-id', b'0ec8e0be-4f80-49d0-a6ce-d97198785987'), (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'x-azure-ref', b'20250531T043755Z-15bd97cbc59hj8b7hC1DUS5p30000000112000000000h7td'), (b'X-Cache', b'CONFIG_NOCACHE'), (b'Accept-Ranges', b'bytes')])
2025-05-31 06:37:55,421 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - receive_response_body.started request=<Request [b'GET']>
2025-05-31 06:37:55,426 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - receive_response_body.complete
2025-05-31 06:37:55,430 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - response_closed.started
2025-05-31 06:37:55,434 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - response_closed.complete
2025-05-31 06:37:55,442 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - connect_tcp.started host='customer.bmwgroup.com' port=443 local_address=None timeout=30.0 socket_options=None
2025-05-31 06:37:55,480 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - connect_tcp.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x6a4ed3e8>
2025-05-31 06:37:55,484 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - start_tls.started ssl_context=<ssl.SSLContext object at 0x6ead7b68> server_hostname='customer.bmwgroup.com' timeout=30.0
2025-05-31 06:37:55,517 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - start_tls.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x6a491598>
2025-05-31 06:37:55,523 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - send_request_headers.started request=<Request [b'POST']>
2025-05-31 06:37:55,529 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - send_request_headers.complete
2025-05-31 06:37:55,532 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - send_request_body.started request=<Request [b'POST']>
2025-05-31 06:37:55,546 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - send_request_body.complete
2025-05-31 06:37:55,553 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - receive_response_headers.started request=<Request [b'POST']>
2025-05-31 06:37:55,581 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - receive_response_headers.complete return_value=(b'HTTP/1.1', 400, b'Bad Request', [(b'date', b'Sat, 31 May 2025 04:37:55 GMT'), (b'content-type', b'application/json'), (b'Content-Length', b'304'), (b'x-frame-options', b'SAMEORIGIN'), (b'x-content-type-options', b'nosniff'), (b'cache-control', b'no-store'), (b'pragma', b'no-cache'), (b'strict-transport-security', b'max-age=31536000; includeSubDomains'), (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, deviceName, loginId, clientId, X-C2b-Api-Key, hcaptchatoken'), (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'same-origin'), (b'x-xss-protection', b'0'), (b'x-c2b-request-id', b'9adbc5d9-1177-4097-acc2-ad9bc306cbf829695876'), (b'x-request-id', b'ae4cafb7-7c6f-46a0-ad23-e9a5b3c78056'), (b'via', b'1.1 google'), (b'Alt-Svc', b'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000')])
2025-05-31 06:37:55,598 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - receive_response_body.started request=<Request [b'POST']>
2025-05-31 06:37:55,603 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - receive_response_body.complete
2025-05-31 06:37:55,606 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - response_closed.started
2025-05-31 06:37:55,610 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - response_closed.complete
2025-05-31 06:37:55,615 - {bimmer_connected.api.authentication:86} - {ERROR:fetch soc_ev0} - MyBMWAuthError due to 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
2025-05-31 06:37:55,621 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - close.started
2025-05-31 06:37:55,628 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - close.complete
2025-05-31 06:37:55,632 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - close.started
2025-05-31 06:37:55,636 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - close.complete
2025-05-31 06:37:55,640 - {bimmer_connected.api.authentication:288} - {DEBUG:fetch soc_ev0} - Unable to get access token using refresh token, falling back to username/password.
2025-05-31 06:37:55,689 - {bimmer_connected.api.authentication:156} - {DEBUG:fetch soc_ev0} - Authenticating with MyBMW flow for North America & Rest of World.
2025-05-31 06:37:55,692 - {modules.vehicles.bmwbc.api:336} - {ERROR:fetch soc_ev0} - bmwbc.fetch_soc: requestData Error, vehicle_id: 0 err=MyBMWCaptchaMissingError('Missing hCaptcha token for login. See https://bimmer-connected.readthedocs.io/en/stable/captcha.html'), type(err)=<class 'bimmer_connected.models.MyBMWCaptchaMissingError'>
2025-05-31 06:37:55,697 - {modules.common.fault_state:49} - {ERROR:fetch soc_ev0} - BMW (Bimmer): FaultState FaultStateLevel.ERROR, FaultStr <class 'modules.vehicles.bmwbc.api.RequestFailed'> ('SoC Request failed:\nMissing hCaptcha token for login. See https://bimmer-connected.readthedocs.io/en/stable/captcha.html',), Traceback: 
Traceback (most recent call last):
  File "/var/www/html/openWB/packages/modules/vehicles/bmwbc/api.py", line 285, in _fetch_soc
    await self._auth[user_id].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 159, in _login_row_na
    raise MyBMWCaptchaMissingError(
bimmer_connected.models.MyBMWCaptchaMissingError: Missing hCaptcha token for login. See https://bimmer-connected.readthedocs.io/en/stable/captcha.html

During handling of the above exception, another exception occurred:

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 358, in fetch_soc
    soc, range, soc_tsX = loop.run_until_complete(api._fetch_soc(user_id, password, vin, captcha_token, vehicle_id))
  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 344, in _fetch_soc
    raise RequestFailed("SoC Request failed:\n" + str(err))
modules.vehicles.bmwbc.api.RequestFailed: SoC Request failed:
Missing hCaptcha token for login. See https://bimmer-connected.readthedocs.io/en/stable/captcha.html

2025-05-31 06:42:57,784 - {modules.common.configurable_vehicle:56} - {DEBUG:fetch soc_ev0} - Vehicle Instance <class 'modules.vehicles.bmwbc.config.BMWbc'>
2025-05-31 06:42:57,799 - {modules.common.configurable_vehicle:57} - {DEBUG:fetch soc_ev0} - Calculated SoC-State CalculatedSocState(imported_start=None, manual_soc=None, soc_start=75)
2025-05-31 06:42:57,825 - {modules.common.configurable_vehicle:58} - {DEBUG:fetch soc_ev0} - Vehicle Update Data VehicleUpdateData(plug_state=False, charge_state=False, imported=None, battery_capacity=30000, efficiency=90, soc_from_cp=None, timestamp_soc_from_cp=None, soc_timestamp=1748350488.0)
2025-05-31 06:42:57,837 - {modules.common.configurable_vehicle:59} - {DEBUG:fetch soc_ev0} - General Config GeneralVehicleConfig(use_soc_from_cp=False, request_interval_charging=300, request_interval_not_charging=3600, request_only_plugged=False)
2025-05-31 06:42:57,857 - {modules.common.component_context:31} - {DEBUG:fetch soc_ev0} - Update Komponente ['BMW (Bimmer)']
2025-05-31 06:42:57,868 - {asyncio:59} - {DEBUG:fetch soc_ev0} - Using selector: EpollSelector
2025-05-31 06:42:57,875 - {modules.vehicles.bmwbc.api:153} - {DEBUG:fetch soc_ev0} - #  Reuse api _instance
2025-05-31 06:42:57,880 - {modules.vehicles.bmwbc.api:166} - {DEBUG:fetch soc_ev0} - dataPath=/var/www/html/openWB/data/modules/bmwbc
2025-05-31 06:42:57,905 - {modules.vehicles.bmwbc.api:214} - {DEBUG:fetch soc_ev0} - captcha token unchanged
2025-05-31 06:42:57,909 - {modules.vehicles.bmwbc.api:222} - {INFO:fetch soc_ev0} - authenticate via current token set
2025-05-31 06:42:57,913 - {modules.vehicles.bmwbc.api:250} - {DEBUG:fetch soc_ev0} - # Create _clconf instance
2025-05-31 06:42:57,924 - {modules.vehicles.bmwbc.api:257} - {DEBUG:fetch soc_ev0} - # Create _account instance
2025-05-31 06:42:57,932 - {modules.vehicles.bmwbc.api:282} - {DEBUG:fetch soc_ev0} - # Proactive login to force refresh token before get_vehicles
2025-05-31 06:42:57,939 - {modules.vehicles.bmwbc.api:283} - {DEBUG:fetch soc_ev0} - # before proactive login:2025-05-31 04:31:58.650976+00:00/6v1PPNzQlyM4xzpT-dYDWpqG5fA
2025-05-31 06:42:58,016 - {bimmer_connected.api.authentication:257} - {DEBUG:fetch soc_ev0} - Authenticating with refresh token for North America & Rest of World.
2025-05-31 06:42:58,023 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - connect_tcp.started host='cocoapi.bmwgroup.com' port=443 local_address=None timeout=30.0 socket_options=None
2025-05-31 06:42:58,085 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - connect_tcp.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x6a4d2d30>
2025-05-31 06:42:58,088 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - start_tls.started ssl_context=<ssl.SSLContext object at 0x6cca37c0> server_hostname='cocoapi.bmwgroup.com' timeout=30.0
2025-05-31 06:42:58,151 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - start_tls.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x6a4661a8>
2025-05-31 06:42:58,157 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - send_request_headers.started request=<Request [b'GET']>
2025-05-31 06:42:58,166 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - send_request_headers.complete
2025-05-31 06:42:58,170 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - send_request_body.started request=<Request [b'GET']>
2025-05-31 06:42:58,173 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - send_request_body.complete
2025-05-31 06:42:58,176 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - receive_response_headers.started request=<Request [b'GET']>
2025-05-31 06:42:58,212 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Sat, 31 May 2025 04:42:58 GMT'), (b'Content-Type', b'application/json; charset=utf-8'), (b'Content-Length', b'580'), (b'Connection', b'keep-alive'), (b'x-correlation-id', b'4128a4aa-d57e-465b-9784-f46a40f2ea21'), (b'bmw-correlation-id', b'4128a4aa-d57e-465b-9784-f46a40f2ea21'), (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'x-azure-ref', b'20250531T044258Z-15bd97cbc59rd2bzhC1DUSanu00000000ws000000000ucr1'), (b'X-Cache', b'CONFIG_NOCACHE'), (b'Accept-Ranges', b'bytes')])
2025-05-31 06:42:58,221 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - receive_response_body.started request=<Request [b'GET']>
2025-05-31 06:42:58,223 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - receive_response_body.complete
2025-05-31 06:42:58,226 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - response_closed.started
2025-05-31 06:42:58,230 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - response_closed.complete
2025-05-31 06:42:58,236 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - connect_tcp.started host='customer.bmwgroup.com' port=443 local_address=None timeout=30.0 socket_options=None
2025-05-31 06:42:58,277 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - connect_tcp.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x6a4d4ad8>
2025-05-31 06:42:58,280 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - start_tls.started ssl_context=<ssl.SSLContext object at 0x6cca37c0> server_hostname='customer.bmwgroup.com' timeout=30.0
2025-05-31 06:42:58,308 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - start_tls.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x6ad0ce08>
2025-05-31 06:42:58,311 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - send_request_headers.started request=<Request [b'POST']>
2025-05-31 06:42:58,315 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - send_request_headers.complete
2025-05-31 06:42:58,318 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - send_request_body.started request=<Request [b'POST']>
2025-05-31 06:42:58,321 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - send_request_body.complete
2025-05-31 06:42:58,323 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - receive_response_headers.started request=<Request [b'POST']>
2025-05-31 06:42:58,359 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - receive_response_headers.complete return_value=(b'HTTP/1.1', 400, b'Bad Request', [(b'date', b'Sat, 31 May 2025 04:42:58 GMT'), (b'content-type', b'application/json'), (b'Content-Length', b'304'), (b'x-frame-options', b'SAMEORIGIN'), (b'x-content-type-options', b'nosniff'), (b'cache-control', b'no-store'), (b'pragma', b'no-cache'), (b'strict-transport-security', b'max-age=31536000; includeSubDomains'), (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, deviceName, loginId, clientId, X-C2b-Api-Key, hcaptchatoken'), (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'same-origin'), (b'x-xss-protection', b'0'), (b'x-c2b-request-id', b'fe4e7c02-d511-4c04-a364-647721d9536829982920'), (b'x-request-id', b'd714d8bc-f3d1-4792-b1d9-4eac65c8d3b1'), (b'via', b'1.1 google'), (b'Alt-Svc', b'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000')])
2025-05-31 06:42:58,370 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - receive_response_body.started request=<Request [b'POST']>
2025-05-31 06:42:58,373 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - receive_response_body.complete
2025-05-31 06:42:58,376 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - response_closed.started
2025-05-31 06:42:58,378 - {httpcore.http11:85} - {DEBUG:fetch soc_ev0} - response_closed.complete
2025-05-31 06:42:58,382 - {bimmer_connected.api.authentication:86} - {ERROR:fetch soc_ev0} - MyBMWAuthError due to 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
2025-05-31 06:42:58,385 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - close.started
2025-05-31 06:42:58,388 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - close.complete
2025-05-31 06:42:58,390 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - close.started
2025-05-31 06:42:58,393 - {httpcore.connection:85} - {DEBUG:fetch soc_ev0} - close.complete
2025-05-31 06:42:58,395 - {bimmer_connected.api.authentication:288} - {DEBUG:fetch soc_ev0} - Unable to get access token using refresh token, falling back to username/password.
2025-05-31 06:42:58,440 - {bimmer_connected.api.authentication:156} - {DEBUG:fetch soc_ev0} - Authenticating with MyBMW flow for North America & Rest of World.
2025-05-31 06:42:58,443 - {modules.vehicles.bmwbc.api:336} - {ERROR:fetch soc_ev0} - bmwbc.fetch_soc: requestData Error, vehicle_id: 0 err=MyBMWCaptchaMissingError('Missing hCaptcha token for login. See https://bimmer-connected.readthedocs.io/en/stable/captcha.html'), type(err)=<class 'bimmer_connected.models.MyBMWCaptchaMissingError'>
2025-05-31 06:42:58,448 - {modules.common.fault_state:49} - {ERROR:fetch soc_ev0} - BMW (Bimmer): FaultState FaultStateLevel.ERROR, FaultStr <class 'modules.vehicles.bmwbc.api.RequestFailed'> ('SoC Request failed:\nMissing hCaptcha token for login. See https://bimmer-connected.readthedocs.io/en/stable/captcha.html',), Traceback: 
Traceback (most recent call last):
  File "/var/www/html/openWB/packages/modules/vehicles/bmwbc/api.py", line 285, in _fetch_soc
    await self._auth[user_id].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 159, in _login_row_na
    raise MyBMWCaptchaMissingError(
bimmer_connected.models.MyBMWCaptchaMissingError: Missing hCaptcha token for login. See https://bimmer-connected.readthedocs.io/en/stable/captcha.html

During handling of the above exception, another exception occurred:

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 358, in fetch_soc
    soc, range, soc_tsX = loop.run_until_complete(api._fetch_soc(user_id, password, vin, captcha_token, vehicle_id))
  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 344, in _fetch_soc
    raise RequestFailed("SoC Request failed:\n" + str(err))
modules.vehicles.bmwbc.api.RequestFailed: SoC Request failed:
Missing hCaptcha token for login. See https://bimmer-connected.readthedocs.io/en/stable/captcha.html

Nachdem ich das Token aktualisiert habe, funktioniert die Abfrage wieder.
OpenWB standard Series 2+ | MINI SE
rleidner
Beiträge: 1289
Registriert: Mo Nov 02, 2020 9:50 am
Has thanked: 26 times
Been thanked: 96 times

Re: SOC BMW

Beitrag von rleidner »

Extrahirn hat geschrieben: Mo Jun 02, 2025 5:14 pm Ich habe jetzt einen anderen Fehler (ich hatte keine Konfigurationsänderungen vorgenommen): VIN am Ende habe ich durch xxxxx ersetzt.

Code: Alles auswählen

httpx.HTTPStatusError: Server error '500 Internal Server Error' for url 'https://cocoapi.bmwgroup.com/eadrax-vcs/v4/vehicles/state?apptimezone=0&appDateTime=1748665976000'
Nachdem ich das Token aktualisiert habe, funktioniert die Abfrage wieder.
Danke, für die Meldung, hier ist der Fehler 500, kommt neben Fehler 408.

Das SoC-Modul lässt aktuell nach jedem Fehler nur ein Neuanmelden mit neuem Captcha-Token zu.

Ich bin dabei, dieses Verhalten zu ändern:
Mein Plan ist zukünftig nach solchen Fehlern nach kurzer Wartezeit den Abruf noch 3-5 mal zu versuchen und erst danach die Neuanmeldung zu erzwingen.

Da ich den Fehler nur sehr selten bekomme, kann das aber noch einige Zeit dauern.
openWB-2 Standard+ | openWB EVU Kit v2 MID| 9,9kWp mit Kostal Plenticore 8.5 plus | VW ID.3, Kia EV6, Smart EQ forfour
Antworten