flobz / psa_car_controller

Control psa car with connected_car v4 API.
GNU General Public License v3.0
440 stars 236 forks source link

No vehicle in your account is compatible with this API, you vehicle is probably too old... #917

Open DavidFFerreira opened 4 months ago

DavidFFerreira commented 4 months ago

Does not make anysense, I have the eC4 2020 in my citroen account. It was working before the update Problably the endpoint on REST is wrong???? "psa_car_controller.psa.connected_car_api.rest.ApiException: (404)"

image image

`HOST_BRANDID : https://id-dcr.citroen.com/mobile-services sitecode: AC_PT_ESP{"session":"1c0a0de2ebaecc506175e91a8b807467","returnCode":"NEED_AUTHORIZATION","token":"73c82ca04ae36870086b3aa89bd8c6870c66ef874836ac7014b4faa3728577a7"} Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 59, in init self.token = res.json()["accessToken"] KeyError: 'accessToken'

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

Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/config_views.py", line 137, in connectPSA INITIAL_SETUP = InitialSetup(app_name, email, password, countrycode) File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 68, in init raise ConnectionError(msg) from ex ConnectionError: Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 59, in init self.token = res.json()["accessToken"] KeyError: 'accessToken'

HOST_BRANDID : https://id-dcr.citroen.com/mobile-services sitecode: AC_PT_ESP{"session":"1c0a0de2ebaecc506175e91a8b807467","returnCode":"NEED_AUTHORIZATION","token":"73c82ca04ae36870086b3aa89bd8c6870c66ef874836ac7014b4faa3728577a7"} 2024-07-17 09:39:09,054 :: INFO :: 172.30.32.1 - - [17/Jul/2024 09:39:09] "POST /_dash-update-component HTTP/1.1" 200 - 2024-07-17 09:39:22,109 :: INFO :: Initial setup... 2024-07-17 09:39:28,794 :: INFO :: 172.30.32.1 - - [17/Jul/2024 09:39:28] "POST /_dash-update-component HTTP/1.1" 200 - 2024-07-17 09:39:34,663 :: INFO :: 172.30.32.1 - - [17/Jul/2024 09:39:34] "GET /config_connect?url=https://idpcvs.citroen.com/am/oauth2/authorize?client_id%3D49799a4b-f335-4de2-bafb-e198a3f54ef9%26redirect_uri%3Dmymacsdk%253A%252F%252Foauth2redirect%252Fpt%26response_type%3Dcode%26scope%3Dopenid%2520profile%26state%3DtvnACeiCFkBXxEUD8iDWgg%26code_challenge%3DhGMCWorOxIZ2xqtYy0wWOuf1-SG9y7AvFEEs7KVB6Y8%26code_challenge_method%3DS256 HTTP/1.1" 200 - 2024-07-17 09:39:34,785 :: INFO :: 172.30.32.1 - - [17/Jul/2024 09:39:34] "GET /_dash-layout HTTP/1.1" 200 - 2024-07-17 09:39:34,786 :: INFO :: 172.30.32.1 - - [17/Jul/2024 09:39:34] "GET /_dash-dependencies HTTP/1.1" 200 - 2024-07-17 09:39:34,799 :: INFO :: 172.30.32.1 - - [17/Jul/2024 09:39:34] "POST /_dash-update-component HTTP/1.1" 200 - 2024-07-17 09:39:34,811 :: INFO :: 172.30.32.1 - - [17/Jul/2024 09:39:34] "POST /_dash-update-component HTTP/1.1" 204 - 2024-07-17 09:40:04,893 :: INFO :: save config change 2024-07-17 09:40:05,352 :: ERROR :: get_vehicles: Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 140, in get_vehicles res = self.api().get_vehicles_by_device() File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1331, in get_vehicles_by_device (data) = self.get_vehicles_by_device_with_http_info(**kwargs) # noqa: E501 File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1400, in get_vehicles_by_device_with_http_info return self.api_client.call_api( File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/oauth.py", line 125, in call_api raise e File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/oauth.py", line 107, in call_api return self._ApiClient__call_api(resource_path, method, File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 157, in __call_api response_data = self.request( File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 347, in request return self.rest_client.GET(url, File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/rest.py", line 234, in GET return self.request("GET", url, File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/rest.py", line 228, in request raise ApiException(http_resp=r) psa_car_controller.psa.connected_car_api.rest.ApiException: (404) Reason: Not Found HTTP response headers: HTTPHeaderDict({'Connection': 'close', 'Date': 'Wed, 17 Jul 2024 08:40:05 GMT', 'Content-Type': 'application/hal+json', 'Expires': '0', 'Cache-Control': 'no-store, no-cache, must-revalidate, private', 'Set-Cookie': 'rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Tue, 16-Jul-2024 08:40:05 GMT, JSESSIONID=IVnWCJDdIlFhbtwGPevGgqSl_VtZYzWDGTP9G-WY; path=/, PSACountry=PT; Domain=.groupe-psa.com; Path=/', 'Strict-Transport-Security': 'max-age=15724800; includeSubDomains', 'X-Global-Transaction-ID': '9761fa3e66978365d2b81bcf'}) HTTP response body: {"uuid":"a17dfbab-a371-48c1-846b-3654ddbc5ff5","code":40400,"message":"No vehicle found","timestamp":"2024-07-17T08:40:05.309Z"}

2024-07-17 09:40:05,354 :: ERROR :: finish_oauth: Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/config_oauth.py", line 56, in finish_oauth config_views.INITIAL_SETUP.connect(code) File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 117, in connect raise ValueError( ValueError: No vehicle in your account is compatible with this API, you vehicle is probably too old... 2024-07-17 09:40:05,354 :: INFO :: 172.30.32.1 - - [17/Jul/2024 09:40:05] "POST /_dash-update-component HTTP/1.1" 200 -`

DavidFFerreira commented 4 months ago

@flobz can you check this please?

robinalden commented 4 months ago

I am trying to register a new vehicle for the first time, a new 2024 Citroen C3, and I also get a 'No vehicle in your account is compatible with this API, you vehicle is probably too old' message. I too see a 404 in the logs.

2024-07-22 12:14:51,626 :: INFO :: save config change
2024-07-22 12:14:52,049 :: ERROR :: get_vehicles:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 140, in get_vehicles
res = self.api().get_vehicles_by_device()
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1331, in get_vehicles_by_device
(data) = self.get_vehicles_by_device_with_http_info(**kwargs) # noqa: E501
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1400, in get_vehicles_by_device_with_http_info
return self.api_client.call_api(
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/oauth.py", line 125, in call_api
raise e
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/oauth.py", line 107, in call_api
return self._ApiClient__call_api(resource_path, method,
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 157, in __call_api
response_data = self.request(
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 347, in request
return self.rest_client.GET(url,
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/rest.py", line 234, in GET
return self.request("GET", url,
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/rest.py", line 228, in request
raise ApiException(http_resp=r)
psa_car_controller.psa.connected_car_api.rest.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Connection': 'close', 'Date': 'Mon, 22 Jul 2024 11:14:52 GMT', 'Content-Type': 'application/hal+json', 'Expires': '0', 'Cache-Control': 'no-store, no-cache, must-revalidate, private', 'Set-Cookie': 'rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Sun, 21-Jul-2024 11:14:51 GMT, JSESSIONID=YcXC53tWuIfZMYyXX2afmNZAgyL_131n2dMOnEJV; path=/, PSACountry=GB; Domain=.groupe-psa.com; Path=/', 'Strict-Transport-Security': 'max-age=15724800; includeSubDomains', 'X-Global-Transaction-ID': '08f333a5669e3f2b747b2f41'})
HTTP response body: {"uuid":"7130f23e-208a-49c2-8861-528b010a9ff1","code":40400,"message":"No vehicle found","timestamp":"2024-07-22T11:14:52.016Z"}

2024-07-22 12:14:52,052 :: ERROR :: finish_oauth:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/config_oauth.py", line 56, in finish_oauth
config_views.INITIAL_SETUP.connect(code)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 117, in connect
raise ValueError(
ValueError: No vehicle in your account is compatible with this API, you vehicle is probably too old...
matthewturner commented 3 months ago

I'm getting the same error when trying to connect to a new Vauxhall Corsa E 2024. In my case the car doesn't seem to be compatible with the My Vauxhall app as the app isn't showing battery status (or any other options).

I have opened a ticket with Vauxhall to see if the API needs updating.

Update: I've had a response back from Vauxhall. They said in my case it's to do with the global component shortage which forced them to swap out a specific component which is not currently supported by the API. They are working on an OTA update which will be installed automatically. No ETA on this, but I'll update here when I find out more.

Blauenfeldt commented 3 months ago

I have the same issue with my Citroën C3

frostworx commented 3 months ago

Same issue here with a Citroën C3 Aircross. I would appreciate it if this could be fixed - never seen the addon in action yet :)

edit (to avoid mails):

just updated to home assistant addon version v3.5.3 _(with psa_carcontroller v3.5.2), the problem persists, unfortunately.

HiQual commented 2 months ago

I'm getting the same error when trying to connect to a new Vauxhall Corsa E 2024. In my case the car doesn't seem to be compatible with the My Vauxhall app as the app isn't showing battery status (or any other options).

I have opened a ticket with Vauxhall to see if the API needs updating.

Update: I've had a response back from Vauxhall. They said in my case it's to do with the global component shortage which forced them to swap out a specific component which is not currently supported by the API. They are working on an OTA update which will be installed automatically. No ETA on this, but I'll update here when I find out more.

Also for me with a new 2024 UK Corsa-e .. image (Using Docker) I have now opened a ticket with Vauxhall - thanks for the information.

UPDATE 5-Sep-24: My car is over 6 months old. Vauxhall support told me they have not yet fixed their telematics module software (6 months!!) and that I have to wait for the auto update! - that sounds wrong to me.

codeclinic commented 2 months ago

@flobz I'm also getting this error when trying to setup the HASS plugin for my DE (Germany) 2022 Peugeot e-Traveller.

The plugin used to work without issues when I last used Home Assistant / this add-on a few months ago

P.s. The vehicle is present in the MyPeugeot app, so the vehicle is connected etc to the Peugeot backend/service.

codeclinic commented 2 months ago

@flobz It looks like this issue is caused simply because the car_models.yml file doesn't contain an exact match.

For example, I have the Peugeot e-Traveller 75Kwh but the car_models.yml file only has the 50KWh version.

How can we get all the relevant info to add the 75KWh version to the yml?

harvindhillon commented 2 months ago

Hi,

I am getting the same with a 2024 Peugeot e308

2024-09-20 08:49:07,310 :: ERROR :: get_vehicles:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 140, in get_vehicles
    res = self.api().get_vehicles_by_device()
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1331, in get_vehicles_by_device
    (data) = self.get_vehicles_by_device_with_http_info(**kwargs)  # noqa: E501
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1400, in get_vehicles_by_device_with_http_info
    return self.api_client.call_api(
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/oauth.py", line 125, in call_api
    raise e
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/oauth.py", line 107, in call_api
    return self._ApiClient__call_api(resource_path, method,
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 157, in __call_api
    response_data = self.request(
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 347, in request
    return self.rest_client.GET(url,
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/rest.py", line 234, in GET
    return self.request("GET", url,
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/rest.py", line 228, in request
    raise ApiException(http_resp=r)
psa_car_controller.psa.connected_car_api.rest.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Connection': 'close', 'Date': 'Fri, 20 Sep 2024 08:49:07 GMT', 'Content-Type': 'application/hal+json', 'Expires': '0', 'Cache-Control': 'no-store, no-cache, must-revalidate, private', 'Set-Cookie': 'rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Thu, 19-Sep-2024 08:49:07 GMT, JSESSIONID=fS8EQ_N97XJsV4tKFnQDNGo14vLtoN1wsW_8eDSw; path=/, PSACountry=IE; Domain=.groupe-psa.com; Path=/', 'Strict-Transport-Security': 'max-age=15724800; includeSubDomains', 'X-Global-Transaction-ID': '08f333a566ed37031c687eaf'})
HTTP response body: {"uuid":"29743b78-cacb-4140-934b-674f3aaf31f7","code":40400,"message":"No vehicle found","timestamp":"2024-09-20T08:49:07.272Z"}

2024-09-20 08:49:07,317 :: ERROR :: finish_oauth:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/config_oauth.py", line 56, in finish_oauth
    config_views.INITIAL_SETUP.connect(code)
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 117, in connect
    raise ValueError(
ValueError: No vehicle in your account is compatible with this API, you vehicle is probably too old...
HiQual commented 3 weeks ago

Hello @matthewturner @Blauenfeldt @frostworx @robinalden @harvindhillon Did any of you make any progress resolving the wrong telematics module? If yes, please share your experience. Many thanks.

Blauenfeldt commented 3 weeks ago

@HiQual No. It seems like my car isn't on the list of cars. I My car is a Citroën C3 PureTech 110 (facelift). Taken from Wikipedia. It's the third gen facelift, and it has the 1.2 Puretech Petrol engine. When searched for "C3", the only lines that gets found in the psa_car_controller/psacc/resources/car_models.yml are the following: name: C3 Aircross name: "C3 Aircross 2022+" name: C3 Feel Edition (2016) name: Citroen C3 Flair (2019) name: C3 Saint james edition So since my car isn't an Aircross, Feel, Flair or a Saint James edition, then I guess it makes sense why it can't be found. I don't know the API name of my car, so that's why I haven't made a PR.