Closed jackshaw20 closed 11 months ago
Hey there @gerard33, @rikroe, mind taking a look at this issue as it has been labeled with an integration (bmw_connected_drive
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
bmw_connected_drive documentation bmw_connected_drive source (message by IssueLinks)
Please try logging in to the MyBMW website with your credentials. There were some password policies implemented that required changing the password. Due to us not using this but a refresh_token, some sessions were still ongoing.
Hi, I can login the BMW portal fine, I have also changed the password too but still the same.
Strange thing is, I have two accounts one stopped working and was showing an error. I updated HASSOS and HA Core to the latest version and still wouldn't work.
I then deleted both accounts and removed the integration and reinstalled it. Now I cant add either account even the one that was still working now wont add. I get invaild_auth on both now.
Strange... Maybe there are some weird left-overs. Please open config/.storage/core.config_entries
with a text editor, and search for bmw_connected_drive
.
You should see multiple entries like the following:
{
"entry_id": "724a5505f0da09533519f00cf56a1b2c",
"version": 1,
"domain": "bmw_connected_drive",
"title": "EMAIL_ADDRESS",
"data": {
"username": "EMAIL_ADDRESS",
"password": "SOME_PASSWORD",
"region": "rest_of_world",
"refresh_token": "SOME_TOKEN",
"gcid": null
},
"options": {
"read_only": false
},
"pref_disable_new_entities": false,
"pref_disable_polling": false,
"source": "user",
"unique_id": "rest_of_world-EMAIL_ADDRESS",
"disabled_by": null
}
Please make sure that SOME_PASSWORD
corresponds to the actual password and replace "SOME_TOKEN"
with null
.
Please double-check that this is still a valid JSON file in the end.
Additionally, make sure that in config/custom_components
there are no left-overs from the bmw custom component.
I have checked custom_components and there is no folder in there anymore, also checked config/.storage/core.config_entries and there is nothing showing for BMW. This is probably because I deleted the accounts and removed the integration?
Ok, at least no old data is the culprit. Does your password confirm to whats mentioned in this comment?
Also, there have been reports of too long passwords not working (maybe BMW is silently taking only the first x characters or so...). Also for some people, it just started working again after some time.
Yes password meets the post you mentioned. (password is 13 characters including a @ at the end).
I have just spun up another VM with a fresh install of HASS and tried to add one of the accounts and still the same.
A friend of mine has his still working on an existing installation, so just tried his login details and still get the same error; looks like is an issue with adding accounts as one of mine was still working before I removed the integration ?
Also other thing I tried is rebooting my router to give me a new public IP but still the same.
Please access the new installation via bash and run the two following commands and paste the output (please remove all security related information like username/password/VIN).
pip freeze | grep bimmer
bimmerconnected fingerprint USERNAME PASSWORD REGION
please see below log, I have changed the user/pass and vin with XXXXXX
➜ ~ bimmerconnected fingerprint XXX@XXXXXX.co.uk XXXXXX@ rest_of_world
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='/usr/lib/python3.11/site-packages/certifi/cacert.pem'
DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False
DEBUG:httpx:load_verify_locations cafile='/usr/lib/python3.11/site-packages/certifi/cacert.pem'
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 socket_options=None
DEBUG:httpcore.connection:connect_tcp.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7fc6e8b767d0>
DEBUG:httpcore.connection:start_tls.started ssl_context=<ssl.SSLContext object at 0x7fc6e8b48dd0> server_hostname='cocoapi.bmwgroup.co
m' timeout=30.0
DEBUG:httpcore.connection:start_tls.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7fc6e9e3c290>
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'Conten
t-Type', b'application/json; charset=utf-8'), (b'x-correlation-id', b'f33524c4-ba8c-4079-b6b2-207b981525b3'), (b'bmw-correlation-id',
b'f33524c4-ba8c-4079-b6b2-207b981525b3'), (b'x-cluster-mock-used', b'false'), (b'Strict-Transport-Security', b'max-age=31536000; inclu
deSubDomains'), (b'X-Content-Type-Options', b'nosniff'), (b'Content-Security-Policy', b"default-src 'self'"), (b'Request-Context', b'a
ppId=cid-v1:24f34ad2-7e62-4399-93db-3071c599c619'), (b'Date', b'Sun, 24 Sep 2023 13:14:15 GMT')])
INFO: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 socket_options=Non
e
DEBUG:httpcore.connection:connect_tcp.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7fc6e87e3f10>
DEBUG:httpcore.connection:start_tls.started ssl_context=<ssl.SSLContext object at 0x7fc6e8b48dd0> server_hostname='customer.bmwgroup.c
om' timeout=30.0
DEBUG:httpcore.connection:start_tls.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7fc6e87e3f90>
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'Sun, 24 Sep 2023 13:14:15
GMT'), (b'Content-Type', b'application/json'), (b'Content-Length', b'411'), (b'Connection', b'keep-alive'), (b'x-frame-options', b'SAM
EORIGIN'), (b'x-content-type-options', b'nosniff'), (b'cache-control', b'private'), (b'cache-control', b'no-cache, no-store, must-reva
lidate'), (b'set-cookie', b'GCDMSSO=mOu5ZUdC9ITb4jRaM2iDf2LQ6VU.AAJTSQACMDIAAlNLABxLeVRzN3g2cGpNZjFqWUZRSjVVTUZJQlE0Z2M9AAR0eXBlAANDV
FMAAlMxAAIwMQ..; 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-Se
nder-Id, X-c2b-External-Id, Content-Type, Accept, Cache-Control, KeyId, x-dtc'), (b'Access-Control-Max-Age', b'3628800'), (b'Access-Co
ntrol-Allow-Credentials', b'true'), (b'Access-Control-Allow-Methods', b'POST, GET, OPTIONS, PUT, DELETE, HEAD'), (b'Referrer-Policy',
b'strict-origin'), (b'X-XSS-Protection', b'0'), (b'x-c2b-request-id', b'rrt-6390583174008104741-c-geu1-25824-120972864-1')])
INFO: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'Sun, 24 Sep 2023 13:14:
15 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=Oa5VHMqg4cqqFTcm1mHTM2Plnwo&state=V.MQ4x5
NxES%7Eh9Arqzwig.&client_id=31c357a0-7a1d-4590-aa99-33b97244d048&nonce=login_nonce'), (b'pragma', b'no-cache'), (b'set-cookie', b'OAUT
H_REQUEST_ATTRIBUTES=DELETED; Expires=Thu, 01 Jan 1970 00:00:00 GMT; Path=/; Domain=customer.bmwgroup.com; Secure; HttpOnly; SameSite
=lax'), (b'Strict-Transport-Security', b'max-age=15724800; includeSubDomains'), (b'Access-Control-Allow-Origin', b''), (b'Access-Contr
ol-Allow-Headers', b'Authorization, Origin, X-c2b-Authorization, X-c2b-mTAN, X-Requested-With, X-c2b-Sender-Id, X-c2b-External-Id, Con
tent-Type, Accept, Cache-Control, KeyId, x-dtc'), (b'Access-Control-Max-Age', b'3628800'), (b'Access-Control-Allow-Credentials', b'tru
e'), (b'Access-Control-Allow-Methods', b'POST, GET, OPTIONS, PUT, DELETE, HEAD'), (b'Referrer-Policy', b'strict-origin'), (b'X-XSS-Pro
tection', b'0'), (b'x-c2b-request-id', b'rrt-6390583174008104741-c-geu1-25824-120972864-2')])
INFO:httpx:HTTP Request: POST https://customer.bmwgroup.com/gcdm/oauth/authenticate?interaction-id=497175d2-7e48-401e14:14:16 [85/208]
f&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'Sun, 24 Sep 2023 13:14:15
GMT'), (b'Content-Type', b'application/json'), (b'Content-Length', b'1981'), (b'Connection', b'keep-alive'), (b'Cache-Control', b'no-c
ache,no-store'), (b'Pragma', b'no-cache'), (b'Access-Control-Allow-Origin', b''), (b'Access-Control-Allow-Headers', b'Authorization, O
rigin, X-c2b-Authorization, X-c2b-mTAN, X-Requested-With, X-c2b-Sender-Id, X-c2b-External-Id, Content-Type, Accept, Cache-Control, Key
Id, 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-XSS-Protection', b'0'), (b'X-Content-Type-Op
tions', b'nosniff'), (b'X-Frame-Options', b'SAMEORIGIN'), (b'x-c2b-request-id', b'rrt-6390583174008104741-c-geu1-25824-120972864-3')])
INFO: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 socket_options=None
DEBUG:httpcore.connection:connect_tcp.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7fc6e87e2090>
DEBUG:httpcore.connection:start_tls.started ssl_context=<ssl.SSLContext object at 0x7fc6e8b48cb0> server_hostname='cocoapi.bmwgroup.co
m' timeout=30.0
DEBUG:httpcore.connection:start_tls.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7fc6e8b76c90>
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'901'), (b'Conten
t-Type', b'application/json; charset=utf-8'), (b'x-cluster-mock-used', b'false'), (b'x-correlation-id', b'8ee273e9-7d09-4c0c-8144-87c3
6228c95a'), (b'bmw-correlation-id', b'8ee273e9-7d09-4c0c-8144-87c36228c95a'), (b'Strict-Transport-Security', b'max-age=31536000; inclu
deSubDomains'), (b'X-Content-Type-Options', b'nosniff'), (b'Content-Security-Policy', b"default-src 'self'"), (b'Request-Context', b'a
ppId=cid-v1:24f34ad2-7e62-4399-93db-3071c599c619'), (b'Date', b'Sun, 24 Sep 2023 13:14:16 GMT')])
INFO: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'901'), (b'Conten
t-Type', b'application/json; charset=utf-8'), (b'x-cluster-mock-used', b'false'), (b'x-correlation-id', b'8ee273e9-7d09-4c0c-8144-87c3
6228c95a'), (b'bmw-correlation-id', b'8ee273e9-7d09-4c0c-8144-87c36228c95a'), (b'Strict-Transport-Security', b'max-age=31536000; inclu
deSubDomains'), (b'X-Content-Type-Options', b'nosniff'), (b'Content-Security-Policy', b"default-src 'self'"), (b'Request-Context', b'a
ppId=cid-v1:24f34ad2-7e62-4399-93db-3071c599c619'), (b'Date', b'Sun, 24 Sep 2023 13:14:16 GMT')])
INFO: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'fe04acf7-c416-42e7-8dd2-08fe5f
8a57ee'), (b'bmw-correlation-id', b'fe04acf7-c416-42e7-8dd2-08fe5f8a57ee'), (b'Strict-Transport-Security', b'max-age=31536000; include
SubDomains'), (b'X-Content-Type-Options', b'nosniff'), (b'Content-Security-Policy', b"default-src 'self'"), (b'Request-Context', b'app
Id=cid-v1:24f34ad2-7e62-4399-93db-3071c599c619'), (b'Date', b'Sun, 24 Sep 2023 13:14:16 GMT')])
INFO: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='/usr/lib/python3.11/site-packages/certifi/cacert.pem'
DEBUG:httpcore.connection:connect_tcp.started host='cocoapi.bmwgroup.com' port=443 local_address=None timeout=30.0 socket_options=None
DEBUG:httpcore.connection:connect_tcp.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7fc6e88039d0>
DEBUG:httpcore.connection:start_tls.started ssl_context=<ssl.SSLContext object at 0x7fc6e8b49ac0> server_hostname='cocoapi.bmwgroup.co
m' timeout=30.0
DEBUG:httpcore.connection:start_tls.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7fc6e87ecf90>
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', 404, b'Not Found', [(b'Content-Length', b'55'), (b'
Content-Type', b'text/plain; charset=utf-8'), (b'x-cluster-mock-used', b'false'), (b'x-correlation-id', b'd21d48c2-b4c3-4045-930f-6751
ceb3a985'), (b'bmw-correlation-id', b'd21d48c2-b4c3-4045-930f-6751ceb3a985'), (b'Strict-Transport-Security', b'max-age=31536000; inclu
deSubDomains'), (b'X-Content-Type-Options', b'nosniff'), (b'Content-Security-Policy', b"default-src 'self'"), (b'Request-Context', b'a
ppId=cid-v1:24f34ad2-7e62-4399-93db-3071c599c619'), (b'Date', b'Sun, 24 Sep 2023 13:14:21 GMT')])
INFO:httpx:HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-vcs/v4/vehicles/state?apptimezone=60.0&appDateTime=1695561254920 "HTT
P/1.1 404 Not Found"
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
ERROR:bimmer_connected.api.client:MyBMWAPIError due to HTTPStatusError: Vehicle with specified VIN: WBXXXXXXXXXXXXXXX not found
DEBUG:httpcore.connection:close.started
DEBUG:httpcore.connection:close.complete
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/bimmer_connected/api/client.py", line 72, in raise_for_status_event_handler
response.raise_for_status()
File "/usr/lib/python3.11/site-packages/httpx/_models.py", line 749, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://cocoapi.bmwgroup.com/eadrax-vcs/v4/vehicles/state?apptimezone=60.0&appDateTime=1695561254920'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/bin/bimmerconnected", line 8, in
just tried it again on the existing installation and the log shown error against the VIN but after couple of refreshes its now added the vehicle fine :)
Ah, the culprit is seen in the following:
bimmer_connected.models.MyBMWAPIError: HTTPStatusError: Vehicle with specified VIN: WBA7DXXXXXXXXXXXX not found
We try to get a car that somehow cannot be retrieved, thats why you cannot add the account back to HA (that only works if everything works smoothly).
Did you at some point had an additional vehicle in the account? Or is it your actual car? If it is the latter, BMW might be adjusting their APIs somehow and it might work again in the future. If not, please provide the JSON files that should be created by the fingerprint.
the account did have 2 vehicles but we have since traded one car in for new model and that one was setup on its own account. both vehicles are now on separate accounts. but its just decided its going to let me add them both back to the HA.
thanks for your support :)
Then it was again the BMW APIs that kept us busy. Great to hear it works again!
@home-assistant close
The problem
Unable to login BMW connected Drive, was working previously. I have removed the integration and re-added and still the same. I have reset my password and can login on BMW connected drive portal
What version of Home Assistant Core has the issue?
core-2023.9.2
What was the last working version of Home Assistant Core?
No response
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?
No response
Additional information
No response