flobz / psa_car_controller

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

Error 400 - Server Error: Vauxhall Corsa E #686

Open AndrewWalls opened 7 months ago

AndrewWalls commented 7 months ago

My original issue was closed, but this is still occurring on the Vauxhall Corsa E despite the odometer fix.


Car: Vauxhall Corsa E

When I attempt to authenticate under 'My Car Details' I get the error message: 400 - server_error : Internal Server Error

Attempted on: Windows 10 PC and HomeAssistant running on a Raspberry Pi 4

I have used this tool for years, but this error has just emerged. I have attempted on older versions and newer versions but the issue is recurring.

MarkTimStafford commented 7 months ago

I have the same issue ... it suddenly stopped working

MarkTimStafford commented 7 months ago

Email address and password connect fine in my MyVauxhall App ... so I think that they are correct!

Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/config_views.py", line 133, in connectPSA res = firstLaunchConfig(app_name, email, password, countrycode) File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 95, in firstLaunchConfig psacc.connect(client_email, client_password) File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 35, in connect self.manager.init_with_user_credentials_realm(user, password, self.realm) File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/oauth.py", line 26, in init_with_user_credentials_realm self._token_request(self._grant_password_request_realm(login, password, realm), True) File "/usr/local/lib/python3.9/dist-packages/oauth2_client/credentials_manager.py", line 205, in _token_request CredentialManager._handle_bad_response(response) File "/usr/local/lib/python3.9/dist-packages/oauth2_client/credentials_manager.py", line 87, in _handle_bad_response raise OAuthError(HTTPStatus(response.status_code), error.get('error'), error.get('error_description')) oauth2_client.credentials_manager.OAuthError: 400 - server_error : Internal Server Error 2023-11-25 15:44:28,547 :: INFO :: 172.30.32.1 - - [25/Nov/2023 15:44:28] "POST /_dash-update-component HTTP/1.1" 200 -

variance95 commented 7 months ago

Same issue here. Stopped working a few days ago for me.

thewhale21 commented 7 months ago

Same here. Take it we're all older corsa e owners? Wouldnt be supprised if vauxhall messed up the api login for older models :(

PhilippCo commented 7 months ago

My Opel Corsa is working again after the modification in the Python file

thewhale21 commented 7 months ago

Think Opel uses a differnt API to vauxhall, even tho they're the "same"

kenzot11 commented 7 months ago

Same issue here.

fehondo commented 7 months ago

Exactly same issue with my Corsa (2020). Have never used this tool before but tried both with Windows and HA on Pi 4. The MyVauxhall app works but not this - even with the latest release.

AndrewWalls commented 7 months ago

My log data on 3.2.0. Definitely an issue with Vauxhall or Corsa E (2000) model.

2023-11-26 13:23:42,182 :: INFO :: App version 3.2.0 2023-11-26 13:23:42,183 :: ERROR :: No config file 2023-11-26 13:23:42,188 :: WARNING :: Can't get language 2023-11-26 13:23:42,188 :: WARNING :: Can't get language 2023-11-26 13:23:44,031 :: INFO :: update_data 2023-11-26 13:23:44,205 :: INFO :: * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit) 2023-11-26 13:24:25,051 :: INFO :: 172.30.32.1 - - [26/Nov/2023 13:24:25] "GET / HTTP/1.1" 200 - 2023-11-26 13:24:25,144 :: INFO :: 172.30.32.1 - - [26/Nov/2023 13:24:25] "GET /assets/99_custom_overides.css HTTP/1.1" 200 - 2023-11-26 13:24:25,150 :: INFO :: 172.30.32.1 - - [26/Nov/2023 13:24:25] "GET /assets/clientside.js HTTP/1.1" 200 - 2023-11-26 13:24:25,352 :: INFO :: 172.30.32.1 - - [26/Nov/2023 13:24:25] "GET /_dash-dependencies HTTP/1.1" 200 - 2023-11-26 13:24:25,357 :: INFO :: 172.30.32.1 - - [26/Nov/2023 13:24:25] "GET /_dash-layout HTTP/1.1" 200 - 2023-11-26 13:24:25,463 :: INFO :: 172.30.32.1 - - [26/Nov/2023 13:24:25] "POST /_dash-update-component HTTP/1.1" 200 - 2023-11-26 13:24:25,551 :: INFO :: 172.30.32.1 - - [26/Nov/2023 13:24:25] "GET /assets/images/settings.svg HTTP/1.1" 200 - 2023-11-26 13:24:25,573 :: INFO :: 172.30.32.1 - - [26/Nov/2023 13:24:25] "GET /config_login HTTP/1.1" 200 - 2023-11-26 13:24:25,735 :: INFO :: 172.30.32.1 - - [26/Nov/2023 13:24:25] "GET /_dash-layout HTTP/1.1" 200 - 2023-11-26 13:24:25,739 :: INFO :: 172.30.32.1 - - [26/Nov/2023 13:24:25] "GET /_dash-dependencies HTTP/1.1" 200 - 2023-11-26 13:24:25,875 :: INFO :: 172.30.32.1 - - [26/Nov/2023 13:24:25] "POST /_dash-update-component HTTP/1.1" 200 - 2023-11-26 13:24:25,992 :: INFO :: 172.30.32.1 - - [26/Nov/2023 13:24:25] "POST /_dash-update-component HTTP/1.1" 200 - 2023-11-26 13:24:25,997 :: INFO :: 172.30.32.1 - - [26/Nov/2023 13:24:25] "POST /_dash-update-component HTTP/1.1" 204 - 2023-11-26 13:24:26,003 :: INFO :: 172.30.32.1 - - [26/Nov/2023 13:24:26] "POST /_dash-update-component HTTP/1.1" 204 - 2023-11-26 13:24:41,260 :: INFO :: Starting analysis on AndroidManifest.xml 2023-11-26 13:24:41,286 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2023-11-26 13:24:41,287 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2023-11-26 13:24:41,290 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2023-11-26 13:24:41,292 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2023-11-26 13:24:41,295 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2023-11-26 13:24:41,305 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2023-11-26 13:24:41,306 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2023-11-26 13:24:41,307 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2023-11-26 13:24:41,308 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2023-11-26 13:24:41,315 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2023-11-26 13:24:41,400 :: INFO :: APK file was successfully validated! 2023-11-26 13:24:41,402 :: WARNING :: Requested API level 33 is larger than maximum we have, returning API level 28 instead. 2023-11-26 13:24:44,513 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-26 13:24:44,515 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-26 13:24:44,520 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-26 13:24:44,529 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-26 13:24:44,536 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-26 13:24:44,546 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-26 13:24:44,549 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-26 13:24:44,553 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-26 13:24:44,554 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-26 13:24:44,557 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-26 13:24:44,563 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-26 13:24:48,460 :: ERROR :: 400 - server_error : Internal Server Error Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/config_views.py", line 133, in connectPSA res = firstLaunchConfig(app_name, email, password, countrycode) File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 95, in firstLaunchConfig psacc.connect(client_email, client_password) File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 35, in connect self.manager.init_with_user_credentials_realm(user, password, self.realm) File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/oauth.py", line 26, in init_with_user_credentials_realm self._token_request(self._grant_password_request_realm(login, password, realm), True) File "/usr/local/lib/python3.9/dist-packages/oauth2_client/credentials_manager.py", line 205, in _token_request CredentialManager._handle_bad_response(response) File "/usr/local/lib/python3.9/dist-packages/oauth2_client/credentials_manager.py", line 87, in _handle_bad_response raise OAuthError(HTTPStatus(response.status_code), error.get('error'), error.get('error_description')) oauth2_client.credentials_manager.OAuthError: 400 - server_error : Internal Server Error

MarkTimStafford commented 7 months ago

Still a problem with v3.2.0

PhilippCo commented 7 months ago

Is there a difference between newer and older Corsa? My Opel Corsa (11/2020) seems to work fine with v3.2.0 I'm using the docker setup, not a plugin in Home Assistant

thewhale21 commented 7 months ago

Not sure i assume the new one has some extra features(saw some people talking about horns ect), But vauxhall is only in the UK (as far as i know) and uses a seperate API than Opel. We get directed to https://idpcvs.vauxhall.co.uk/am/UI/Login?realm=%2FclientsB2CVauxhall&locale=en-GB&goto=https%3A%2F%2Fidpcvs.vauxhall.co.uk%2Fam%2Foauth2%2Fauthorize%3Fclient_id...

thewhale21 commented 7 months ago

Starting to think this may just be an issue with myvauxhall. image Even if you loginto the myvauxhall site its pulling oAuth errors.

Just created an account with Opel and not getting any of the same errors on login.

thewhale21 commented 7 months ago

So apperently the latest version is working for one Corsa E owner (Speek to the geek, youtube), So we're going to have to figure out what us lot have in common.

bigcalm commented 7 months ago

I am unable to connect to my Vauxhall Mokka-e with the same error.

I think that this issue might best be renamed to just Error 400 - Server Error: Vauxhall.

The My Vauxhall app is flaky when it comes to connecting with the car. The My Vauxhall website is even worse just trying to log in.

As much as I love my car, the app is possibly the biggest let down.

Anyway, I'm not here to complain about the app and service. Just to state that I think it's an issue with Vauxhall itself.

I wonder if Opel have the same issues.

Or other UK based brands in the PSA/Stellantis group.

videojedi commented 7 months ago

Same here, vauxhall corsa e, was working fine, but not any more. 400 internal server error. Home assistant running on x86

MarkTimStafford commented 7 months ago

So guys, ... and patience please, as I am a novice I think that we all agree that this is a UK Vauxhall problem. This occurs when people have to re-login to the PSA software following a reboot or re-initialisation which is why a lot of people don't have the problem This is where I am at ... I have installed the program on a regular PC so that I can mess. I started the program with the debugger on so that I could track through and got the attached file (although password is blanked out) trash.txt It seems as thought the username & password verification is fine, but it cannot generate a file cars.json I got a copy of my cars.json of a backup of HA and have attached it here (VID blanked out) cars.json I need to find out where it gets this file and if I can overwrite the code somehow???? Any help, as I am only a novice programmer, would be greatly appreciated

MarkTimStafford commented 7 months ago

Just struggled to login to the MyVauxhall Login page ... but got in eventually

thewhale21 commented 7 months ago

Not sure its even validating the credentials, Email is validated, but password is not, any password will also return 400 error

MarkTimStafford commented 7 months ago

OK ... this is all I know and I am unable to go much further. The program is failing to get an authorisation code at about line 205 of oauth2_client/credentials_manager.py, and this is generating the 400 status code that we all know and love. My parameters to this call are 2023-11-30 09:37:53,701 :: DEBUG :: https://idpcvs.vauxhall.co.uk/am/oauth2/access_token 2023-11-30 09:37:53,702 :: DEBUG :: data={'grant_type': 'password', 'username': 'mark.timXXXXXX@virginmedia.com', 'scope': 'openid profile', 'password': 'XXXXXXX', 'realm': 'clientsB2CVauxhall'} 2023-11-30 09:37:53,702 :: DEBUG :: headers={'Authorization': 'Basic MTIyZjM1MTEtNGY3NC00YTBjLWJjZGEtYWYyZjNiMmUzYTY1Ok4xaVkzak80akkxc0YyeVM2eUozckc3eFE0a0w0a???????????????????????'} 2023-11-30 09:37:53,703 :: DEBUG :: proxies={'http': '', 'https': ''} 2023-11-30 09:37:53,704 :: DEBUG :: verify=True The status code 400 would seem to indicate that the server has received the request but the parameters are wrong????

This is now outside of our control. Either the parameters going into the request are incorrect or the server has been re-jigged by Vauxhall. I suspect that the realm might be wrong but have not been able to prove it.

This is most definitely a UK only and a Vauxhall only problem. I think that the reason it is not more widespread is that most people already have an authorisation code and have not had to restart the service psa-car-controller yet. Therefore the problem will continue to increase as people have to restart and power cuts and all that sort of stuff.

This is a real shame as this program and all the coding is very, very good, and so much better than the MyVauxhall web page, which can also be temperamental to login to. I find it really useful in HA and am now considering how to work around this failure.

I hope that someone with more knowledge about oauth2 can pick this up and run with it.

MarkTimStafford commented 7 months ago

Hi I am more than willing to pass my Username & Password details to @flobz if that would help diagnose the problem It is a Vauxhall in the UK problem.

dreimer1986 commented 7 months ago

I thought I re register the app and now I have this: image We already saw this in the closed report.

2023-12-03 14:23:10,911 :: INFO :: 192.168.181.42 - - [03/Dec/2023 14:23:10] "GET /charge_control?vin=VR3UHZKXZMT008152&?always_check=true HTTP/1.1" 500 -
2023-12-03 14:24:10,902 :: ERROR :: Exception on /get_vehicleinfo/VR3UHZKXZMT008152 [GET]
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python3/dist-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python3/dist-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/lib/python3/dist-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/views.py", line 191, in get_vehicle_info
response=json.dumps(APP.myp.get_vehicle_info(vin, from_cache).to_dict(), default=str),
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 105, in get_vehicle_info
res = self.api().get_vehicle_status(car.vehicle_id)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1229, in get_vehicle_status
(data) = self.get_vehicle_status_with_http_info(id, **kwargs) # noqa: E501
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1293, in get_vehicle_status_with_http_info
return self.api_client.call_api(
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/oauth.py", line 76, 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 147, in __call_api
self.update_params_for_auth(header_params, query_params, auth_settings)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 504, in update_params_for_auth
auth_setting = self.configuration.auth_settings().get(auth)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/configuration.py", line 241, in auth_settings
'value': 'Bearer ' + self.access_token
TypeError: can only concatenate str (not "NoneType") to str
2023-12-03 14:24:10,902 :: ERROR :: Exception on /get_vehicleinfo/VR3UHZKXZMT008152 [GET]
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python3/dist-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python3/dist-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/lib/python3/dist-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/views.py", line 191, in get_vehicle_info
response=json.dumps(APP.myp.get_vehicle_info(vin, from_cache).to_dict(), default=str),
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 105, in get_vehicle_info
res = self.api().get_vehicle_status(car.vehicle_id)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1229, in get_vehicle_status
(data) = self.get_vehicle_status_with_http_info(id, **kwargs) # noqa: E501
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1293, in get_vehicle_status_with_http_info
return self.api_client.call_api(
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/oauth.py", line 76, 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 147, in __call_api
self.update_params_for_auth(header_params, query_params, auth_settings)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 504, in update_params_for_auth
auth_setting = self.configuration.auth_settings().get(auth)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/configuration.py", line 241, in auth_settings
'value': 'Bearer ' + self.access_token
TypeError: can only concatenate str (not "NoneType") to str
2023-12-03 14:24:10,904 :: INFO :: 192.168.181.42 - - [03/Dec/2023 14:24:10] "GET /get_vehicleinfo/VR3UHZKXZMT008152?from_cache=1 HTTP/1.1" 500 -
2023-12-03 14:24:10,907 :: INFO :: <Request 'http://192.168.181.42:5000/charge_control?vin=VR3UHZKXZMT008152&%3Falways_check=true' [GET]>
2023-12-03 14:24:10,909 :: ERROR :: Exception on /charge_control [GET]
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python3/dist-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python3/dist-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/lib/python3/dist-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/views.py", line 260, in get_charge_control
charge_control = APP.chc.get(vin)
AttributeError: 'PSACarController' object has no attribute 'chc'
2023-12-03 14:24:10,909 :: ERROR :: Exception on /charge_control [GET]
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python3/dist-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python3/dist-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/lib/python3/dist-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/views.py", line 260, in get_charge_control
charge_control = APP.chc.get(vin)
AttributeError: 'PSACarController' object has no attribute 'chc'
2023-12-03 14:24:10,912 :: INFO :: 192.168.181.42 - - [03/Dec/2023 14:24:10] "GET /charge_control?vin=VR3UHZKXZMT008152&?always_check=true HTTP/1.1" 500 -
2023-12-03 14:25:10,901 :: ERROR :: Exception on /get_vehicleinfo/VR3UHZKXZMT008152 [GET]
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python3/dist-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python3/dist-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/lib/python3/dist-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/views.py", line 191, in get_vehicle_info
response=json.dumps(APP.myp.get_vehicle_info(vin, from_cache).to_dict(), default=str),
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 105, in get_vehicle_info
res = self.api().get_vehicle_status(car.vehicle_id)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1229, in get_vehicle_status
(data) = self.get_vehicle_status_with_http_info(id, **kwargs) # noqa: E501
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1293, in get_vehicle_status_with_http_info
return self.api_client.call_api(
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/oauth.py", line 76, 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 147, in __call_api
self.update_params_for_auth(header_params, query_params, auth_settings)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 504, in update_params_for_auth
auth_setting = self.configuration.auth_settings().get(auth)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/configuration.py", line 241, in auth_settings
'value': 'Bearer ' + self.access_token
TypeError: can only concatenate str (not "NoneType") to str
2023-12-03 14:25:10,901 :: ERROR :: Exception on /get_vehicleinfo/VR3UHZKXZMT008152 [GET]
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python3/dist-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python3/dist-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/lib/python3/dist-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/views.py", line 191, in get_vehicle_info
response=json.dumps(APP.myp.get_vehicle_info(vin, from_cache).to_dict(), default=str),
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 105, in get_vehicle_info
res = self.api().get_vehicle_status(car.vehicle_id)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1229, in get_vehicle_status
(data) = self.get_vehicle_status_with_http_info(id, **kwargs) # noqa: E501
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1293, in get_vehicle_status_with_http_info
return self.api_client.call_api(
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/oauth.py", line 76, 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 147, in __call_api
self.update_params_for_auth(header_params, query_params, auth_settings)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 504, in update_params_for_auth
auth_setting = self.configuration.auth_settings().get(auth)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/configuration.py", line 241, in auth_settings
'value': 'Bearer ' + self.access_token
TypeError: can only concatenate str (not "NoneType") to str
2023-12-03 14:25:10,904 :: INFO :: 192.168.181.42 - - [03/Dec/2023 14:25:10] "GET /get_vehicleinfo/VR3UHZKXZMT008152?from_cache=1 HTTP/1.1" 500 -
2023-12-03 14:25:10,908 :: INFO :: <Request 'http://192.168.181.42:5000/charge_control?vin=VR3UHZKXZMT008152&%3Falways_check=true' [GET]>
2023-12-03 14:25:10,910 :: ERROR :: Exception on /charge_control [GET]
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python3/dist-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python3/dist-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/lib/python3/dist-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/views.py", line 260, in get_charge_control
charge_control = APP.chc.get(vin)
AttributeError: 'PSACarController' object has no attribute 'chc'
2023-12-03 14:25:10,910 :: ERROR :: Exception on /charge_control [GET]
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python3/dist-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python3/dist-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/lib/python3/dist-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/views.py", line 260, in get_charge_control
charge_control = APP.chc.get(vin)
AttributeError: 'PSACarController' object has no attribute 'chc'
2023-12-03 14:25:10,913 :: INFO :: 192.168.181.42 - - [03/Dec/2023 14:25:10] "GET /charge_control?vin=VR3UHZKXZMT008152&?always_check=true HTTP/1.1" 500 -
2023-12-03 14:25:19,699 :: INFO :: 172.30.32.1 - - [03/Dec/2023 14:25:19] "GET / HTTP/1.1" 200 -
2023-12-03 14:25:19,744 :: INFO :: 172.30.32.1 - - [03/Dec/2023 14:25:19] "GET /assets/99_custom_overides.css?m=1700915592.0 HTTP/1.1" 304 -
2023-12-03 14:25:19,749 :: INFO :: 172.30.32.1 - - [03/Dec/2023 14:25:19] "GET /assets/clientside.js?m=1700915592.0 HTTP/1.1" 304 -
2023-12-03 14:25:19,813 :: INFO :: 172.30.32.1 - - [03/Dec/2023 14:25:19] "GET /_dash-layout HTTP/1.1" 200 -
2023-12-03 14:25:19,817 :: INFO :: 172.30.32.1 - - [03/Dec/2023 14:25:19] "GET /_dash-dependencies HTTP/1.1" 200 -
2023-12-03 14:25:19,841 :: INFO :: 172.30.32.1 - - [03/Dec/2023 14:25:19] "POST /_dash-update-component HTTP/1.1" 200 -
2023-12-03 14:25:19,868 :: INFO :: 172.30.32.1 - - [03/Dec/2023 14:25:19] "GET /assets/images/settings.svg HTTP/1.1" 304 -
2023-12-03 14:25:19,875 :: INFO :: 172.30.32.1 - - [03/Dec/2023 14:25:19] "GET /config_login HTTP/1.1" 200 -
2023-12-03 14:25:19,955 :: INFO :: 172.30.32.1 - - [03/Dec/2023 14:25:19] "GET /_dash-dependencies HTTP/1.1" 200 -
2023-12-03 14:25:19,960 :: INFO :: 172.30.32.1 - - [03/Dec/2023 14:25:19] "GET /_dash-layout HTTP/1.1" 200 -
MarkTimStafford commented 7 months ago

Just created an account with Opel and not getting any of the same errors on login.

@thewhale21 ... how did you do this. I am based in GB and going to My Opel insists on knocking me back to Vauxhall

MarkTimStafford commented 7 months ago

BTW ... sent a message to Vauxhall on their messenger page. I don't think it will do anything at all but I have to try.

thewhale21 commented 7 months ago

Just created an account with Opel and not getting any of the same errors on login.

@thewhale21 ... how did you do this. I am based in GB and going to My Opel insists on knocking me back to Vauxhall

You'll need to do it with a new email address, but if you go to myopel.de for example it lets you register there. Admittedly you cant get it working correctly as the MyOpel app wonjt let you enter the VIN of a corsa. But you see the errors associated with not having a car registered to the account.

macray76 commented 7 months ago

Same problem here on my Vauxhall Corsa-e.

I had to restore from a backup earlier today and that is when the 400 error started appearing.

dreimer1986 commented 6 months ago

OK, my error 400 was my fault. I used the old password I used a while ago. Correct password and everything back to normal here.

macray76 commented 6 months ago

Still not working for me. I've even uninstalled, reinstalled and rebooted my HA server but it is still showing the 400 error.

My password hasn't been changed so I know it is correct (I relogged in using the MyVauxhall app with the same details).

robotfishe commented 6 months ago

Seeing the same with my 2022 Mokka-e. I had to try about 6 times to sign in with the Vauxhall app, and even when it worked it was very slow, so maybe the Oauth is just timing out somewhere?

MarkTimStafford commented 6 months ago

OK, my error 400 was my fault. I used the old password I used a while ago. Correct password and everything back to normal here.

@dreimer1986 Hiya ... I notice that you are driving a Peugeot in Germany (?), and I think that this problem may relate to the Vauxhall server for folk located in the UK (maybe ???) ... but well done in sorting your issues out.

thewhale21 commented 6 months ago

Looks like something is definatley broken on the vauxhall side. Was trying to link in with another app and got an error back. Wouldnt be supprised if they had restricted API access.

image

agbb commented 6 months ago

Has anyone had any luck getting this working? If not I’d suggest we all email Vauxhall at customercare@vauxhall.co.uk and apply some pressure to get it fixed. I know it’s a long shot but it seems to be affecting the ability to connect to and 3rd party service which is a huge shame.

videojedi commented 6 months ago

Logging into my vauxhall on vauxhall.co.uk website does this......

image
MarkTimStafford commented 6 months ago

Has anyone had any luck getting this working? If not I’d suggest we all email Vauxhall at customercare@vauxhall.co.uk and apply some pressure to get it fixed. I know it’s a long shot but it seems to be affecting the ability to connect to and 3rd party service which is a huge shame.

I have always found the Customer Care Team to be unresponsive and I suspect that this is outside of their scope. I found the contact details of the IT Manager at Groupe PSA at Vauxhall Motors Ltd on LinkedIn and wrote him a friendly email requesting his help ... who knows what might happen?

ujjbd16 commented 5 months ago

I have never been able to make this integration work. Always getting the 400 error. I have the 2022 Corsa E. I’m UK based as well.

bbr111 commented 5 months ago

Same here

btxluke commented 5 months ago

+1

HA + Vauxhall Corsa E, unable to authenticate.

Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/config_views.py", line 133, in connectPSA res = firstLaunchConfig(app_name, email, password, countrycode) File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 95, in firstLaunchConfig psacc.connect(client_email, client_password) File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 35, in connect self.manager.init_with_user_credentials_realm(user, password, self.realm) File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/oauth.py", line 26, in init_with_user_credentials_realm self._token_request(self._grant_password_request_realm(login, password, realm), True) File "/usr/local/lib/python3.9/dist-packages/oauth2_client/credentials_manager.py", line 205, in _token_request CredentialManager._handle_bad_response(response) File "/usr/local/lib/python3.9/dist-packages/oauth2_client/credentials_manager.py", line 87, in _handle_bad_response raise OAuthError(HTTPStatus(response.status_code), error.get('error'), error.get('error_description')) oauth2_client.credentials_manager.OAuthError: 400 - server_error : Internal Server Error

Hobbit44 commented 5 months ago

Just trying to set this up on my 2021 Corsa E. It may be fixed. Just that the response structure has changed:

2024-01-19 21:46:50,589 :: ERROR :: Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 50, in firstLaunchConfig
    token = res.json()["accessToken"]
KeyError: 'accessToken'
HOST_BRANDID : https://id-dcr.vauxhall.co.uk/mobile-services sitecode: VX_GB_ESP{"returnCode":"OK","token":"TOKEN"}
2024-01-19 21:46:50,589 :: ERROR :: Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 50, in firstLaunchConfig
    token = res.json()["accessToken"]
KeyError: 'accessToken'
HOST_BRANDID : https://id-dcr.vauxhall.co.uk/mobile-services sitecode: VX_GB_ESP{"returnCode":"OK","token":"TOKEN"}
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 50, in firstLaunchConfig
    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 133, in connectPSA
    res = firstLaunchConfig(app_name, email, password, countrycode)
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 59, in firstLaunchConfig
    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 50, in firstLaunchConfig
    token = res.json()["accessToken"]
KeyError: 'accessToken'
HOST_BRANDID : https://id-dcr.vauxhall.co.uk/mobile-services sitecode: VX_GB_ESP{"returnCode":"OK","token":"TOKEN"}
AndrewWalls commented 3 months ago

The latest update gets me further, but then it asks for an element of a URL and I can't see where to get it in Vauxhall. Anyone had any luck?

macray76 commented 3 months ago

Yes I have it back up and running. It was a little confusing at first but I used this guide to help: https://github.com/flobz/psa_car_controller/discussions/779

And specifically for HomeAssistant: https://github.com/flobz/psa_car_controller/discussions/779#discussioncomment-8601459

bigcalm commented 3 months ago

At last, through a combination of the latest release (v3.4.2) and updates to Vauxhall's services, I have been able to connect my 2022 Vauxhall Mokka E!

The web UI shows details about recent trips along with consumption data.

Good work everybody involved :)