daernsinstantfortress / cupra_we_connect

Cupra integration for Home Assistant
Apache License 2.0
49 stars 5 forks source link

Installation / Login Error (Status Code 400 when fetching data) #59

Open essayen opened 3 months ago

essayen commented 3 months ago

Hello,

I have tried to install the latest version of this integration (0.8.2) on my home assistant:

Core 2024.6.3 Supervisor 2024.06.0 Operating System 12.3 Frontend 20240610.1,

after some time (I guess after a timeout occurs) the installation finishes, but on the integrations page I only see the integration (no entities). The logfiles shows the following entries:

2024-06-16 17:14:36.106 DEBUG (SyncWorker_9) [weconnect_cupra] Retrieved data from url: https://ola.prod.code.seat.cloud.vwgroup.com/vehicles/XXXX/charging/settings 2024-06-16 17:14:36.106 DEBUG (SyncWorker_9) [weconnect_cupra] {"settings": {"maxChargeCurrentAC": "maximum", "carCapturedTimestamp": "2024-06-16T12:37:36Z", "autoUnlockPlugWhenCharged": "off", "targetSoc_pct": 80, "batteryCareModeEnabled": true, "batteryCareTargetSocPercentage": 80}} 2024-06-16 17:14:36.327 DEBUG (SyncWorker_9) [weconnect_cupra] Retrieved data from url: https://ola.prod.code.seat.cloud.vwgroup.com/vehicles/XXXX/charging/status 2024-06-16 17:14:36.327 DEBUG (SyncWorker_9) [weconnect_cupra] {"status": {"battery": {"carCapturedTimestamp": "2024-06-16T12:37:38Z", "currentSOC_pct": 67, "cruisingRangeElectric_km": 366}, "charging": {"carCapturedTimestamp": "2024-06-16T12:37:38Z", "chargingState": "notReadyForCharging", "chargeType": "invalid", "chargeMode": "off", "chargingSettings": "default", "remainingChargingTimeToComplete_min": null, "chargePower_kW": 0.0, "chargeRate_kmph": 0.0}, "plug": {"carCapturedTimestamp": "2024-06-16T12:37:41Z", "plugConnectionState": "connected", "plugLockState": "locked", "externalPower": "unavailable"}}} 2024-06-16 17:14:36.499 DEBUG (SyncWorker_5) [weconnect_cupra] Retrieved data from url: https://ola.prod.code.seat.cloud.vwgroup.com/vehicles/XXXX/charging/settings 2024-06-16 17:14:36.499 DEBUG (SyncWorker_5) [weconnect_cupra] {"settings": {"maxChargeCurrentAC": "maximum", "carCapturedTimestamp": "2024-06-16T12:37:36Z", "autoUnlockPlugWhenCharged": "off", "targetSoc_pct": 80, "batteryCareModeEnabled": true, "batteryCareTargetSocPercentage": 80}} 2024-06-16 17:14:36.565 ERROR (SyncWorker_9) [weconnect_cupra] Failed to retrieve data for VIN XXXX: Could not fetch data. Status Code was: 400 2024-06-16 17:14:36.565 ERROR (SyncWorker_9) [weconnect_cupra] Could not fetch data. Status Code was: 400 2024-06-16 17:14:36.566 DEBUG (MainThread) [custom_components.cupra_we_connect] Finished fetching cupra_we_connect data in 1.048 seconds (success: True) 2024-06-16 17:14:36.671 DEBUG (SyncWorker_5) [weconnect_cupra] Retrieved data from url: https://ola.prod.code.seat.cloud.vwgroup.com/vehicles/XXXX/charging/status 2024-06-16 17:14:36.671 DEBUG (SyncWorker_5) [weconnect_cupra] {"status": {"battery": {"carCapturedTimestamp": "2024-06-16T12:37:38Z", "currentSOC_pct": 67, "cruisingRangeElectric_km": 366}, "charging": {"carCapturedTimestamp": "2024-06-16T12:37:38Z", "chargingState": "notReadyForCharging", "chargeType": "invalid", "chargeMode": "off", "chargingSettings": "default", "remainingChargingTimeToComplete_min": null, "chargePower_kW": 0.0, "chargeRate_kmph": 0.0}, "plug": {"carCapturedTimestamp": "2024-06-16T12:37:41Z", "plugConnectionState": "connected", "plugLockState": "locked", "externalPower": "unavailable"}}} 2024-06-16 17:14:36.748 DEBUG (SyncWorker_1) [weconnect_cupra] Retrieved data from url: https://ola.prod.code.seat.cloud.vwgroup.com/vehicles/XXXX/charging/settings 2024-06-16 17:14:36.748 DEBUG (SyncWorker_1) [weconnect_cupra] {"settings": {"maxChargeCurrentAC": "maximum", "carCapturedTimestamp": "2024-06-16T12:37:36Z", "autoUnlockPlugWhenCharged": "off", "targetSoc_pct": 80, "batteryCareModeEnabled": true, "batteryCareTargetSocPercentage": 80}} 2024-06-16 17:14:36.874 DEBUG (SyncWorker_3) [weconnect_cupra] Retrieved data from url: https://ola.prod.code.seat.cloud.vwgroup.com/vehicles/XXXX/charging/settings 2024-06-16 17:14:36.874 DEBUG (SyncWorker_3) [weconnect_cupra] {"settings": {"maxChargeCurrentAC": "maximum", "carCapturedTimestamp": "2024-06-16T12:37:36Z", "autoUnlockPlugWhenCharged": "off", "targetSoc_pct": 80, "batteryCareModeEnabled": true, "batteryCareTargetSocPercentage": 80}} 2024-06-16 17:14:36.977 DEBUG (SyncWorker_1) [weconnect_cupra] Retrieved data from url: https://ola.prod.code.seat.cloud.vwgroup.com/vehicles/XXXX/charging/status 2024-06-16 17:14:36.977 DEBUG (SyncWorker_1) [weconnect_cupra] {"status": {"battery": {"carCapturedTimestamp": "2024-06-16T12:37:38Z", "currentSOC_pct": 67, "cruisingRangeElectric_km": 366}, "charging": {"carCapturedTimestamp": "2024-06-16T12:37:38Z", "chargingState": "notReadyForCharging", "chargeType": "invalid", "chargeMode": "off", "chargingSettings": "default", "remainingChargingTimeToComplete_min": null, "chargePower_kW": 0.0, "chargeRate_kmph": 0.0}, "plug": {"carCapturedTimestamp": "2024-06-16T12:37:41Z", "plugConnectionState": "connected", "plugLockState": "locked", "externalPower": "unavailable"}}} 2024-06-16 17:14:37.115 DEBUG (SyncWorker_3) [weconnect_cupra] Retrieved data from url: https://ola.prod.code.seat.cloud.vwgroup.com/vehicles/XXXX/charging/status 2024-06-16 17:14:37.115 DEBUG (SyncWorker_3) [weconnect_cupra] {"status": {"battery": {"carCapturedTimestamp": "2024-06-16T12:37:38Z", "currentSOC_pct": 67, "cruisingRangeElectric_km": 366}, "charging": {"carCapturedTimestamp": "2024-06-16T12:37:38Z", "chargingState": "notReadyForCharging", "chargeType": "invalid", "chargeMode": "off", "chargingSettings": "default", "remainingChargingTimeToComplete_min": null, "chargePower_kW": 0.0, "chargeRate_kmph": 0.0}, "plug": {"carCapturedTimestamp": "2024-06-16T12:37:41Z", "plugConnectionState": "connected", "plugLockState": "locked", "externalPower": "unavailable"}}} 2024-06-16 17:14:37.155 ERROR (SyncWorker_1) [weconnect_cupra] Failed to retrieve data for VIN XXXX: Could not fetch data. Status Code was: 400 2024-06-16 17:14:37.155 ERROR (SyncWorker_1) [weconnect_cupra] Could not fetch data. Status Code was: 400 2024-06-16 17:14:37.156 DEBUG (MainThread) [custom_components.cupra_we_connect] Finished fetching cupra_we_connect data in 1.636 seconds (success: True) 2024-06-16 17:14:37.165 ERROR (SyncWorker_5) [weconnect_cupra] Failed to retrieve data for VIN XXXX: Could not fetch data. Status Code was: 400 2024-06-16 17:14:37.165 ERROR (SyncWorker_5) [weconnect_cupra] Could not fetch data. Status Code was: 400 2024-06-16 17:14:37.166 DEBUG (MainThread) [custom_components.cupra_we_connect] Finished fetching cupra_we_connect data in 1.647 seconds (success: True) 2024-06-16 17:14:37.320 ERROR (SyncWorker_3) [weconnect_cupra] Failed to retrieve data for VIN XXXX: Could not fetch data. Status Code was: 400 2024-06-16 17:14:37.320 ERROR (SyncWorker_3) [weconnect_cupra] Could not fetch data. Status Code was: 400 2024-06-16 17:14:37.321 DEBUG (MainThread) [custom_components.cupra_we_connect] Finished fetching cupra_we_connect data in 1.802 seconds (success: True)

Boran commented 1 month ago

Did you find a solution?

My cupra was working fine for months and broke about a week ago. I used HACS to upgrade to the latest version 0.8.4, and reconnected to weconnect. AndroiD app works fine, connection to https://seatid.vwgroup.io/account also.

But in HA I get a 400 too, similar to your logs.

2024-08-11 22:20:16.876 ERROR (SyncWorker_4) [weconnect_cupra] Failed to retrieve data for VIN XXXX: Could not fetch data. Status Code was: 400

Also I enabled debug logging on the config/integrations/integration/cupra_we_connect page but dont get more details than this.

essayen commented 1 month ago

I am afraid not really. There have been some changes in the Cupra API obviously (my evcc addon, which also accesses it, broke two times over the last month and was fortunately repaired in updates), and with the current version this integration started working for the first time for me.

But what I did: I uninstalled the integration, logged out of the cupra app on my phone, uninstalled the app there, reinsalled and logged into the app there and the tried the integration in HA again. I have got no idea if this had anythind to do with it.

On Sun, Aug 11, 2024 at 10:35 PM Sean Boran @.***> wrote:

Did you find a solution?

My cupra was working fine for months and broke about a week ago. I used HACS to upgrade to the lastest version, and reconnected to weconnect, but I get a 400 too:

2024-08-11 22:20:16.876 ERROR (SyncWorker_4) [weconnect_cupra] Failed to retrieve data for VIN XXXX: Could not fetch data. Status Code was: 400

— Reply to this email directly, view it on GitHub https://github.com/daernsinstantfortress/cupra_we_connect/issues/59#issuecomment-2282881455, or unsubscribe https://github.com/notifications/unsubscribe-auth/AELUH7UUQVTOFLTRQ4ABX6LZQ7DHLAVCNFSM6AAAAABJMV2AOWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBSHA4DCNBVGU . You are receiving this because you authored the thread.Message ID: @.***>

Boran commented 1 month ago

"I uninstalled the integration, logged out of the cupra app on my phone, uninstalled the app there, reinsalled and logged into the app there and the tried the integration in HA again."

Hmm, tried all that. All my entities are gone now :-). Also upgraded HA . Logs as before: Logger: weconnect_cupra Source: /usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/api.py:73 Last logged: 10:50:40 PM Failed to retrieve data for VIN XXXX: Could not fetch data. Status Code was: 400

Core 2024.8.1 Supervisor 2024.08.0 Operating System 13.0 Frontend 20240809.0

tinyoverflow commented 1 week ago

I have the exact same issue with my Formentor. As this package depends on the WeConnect-Cupra-python library, isn't this something that has to be reported there?

Yorkie71 commented 1 week ago

I have the exact same issue with my Formentor. As this package depends on the WeConnect-Cupra-python library, isn't this something that has to be reported there?

I was under the impression that this integration only supported the Born or at least had only been tested on the Born as I know the dev pulled this from the ID.3 Connect integration.