daernsinstantfortress / cupra_we_connect

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

Error 429 #81

Open lakatusch opened 2 weeks ago

lakatusch commented 2 weeks ago

hi there,

have several errors in the log regarding error 429

024-08-27 19:11:21.080 ERROR (SyncWorker_37) [weconnect_cupra] Could not fetch data. Status Code was: 429

2024-08-27 20:18:07.167 ERROR (MainThread) [custom_components.cupra_we_connect] Unknown error while updating weconnect_cupra
Traceback (most recent call last):
  File "/config/custom_components/cupra_we_connect/__init__.py", line 52, in async_update_data
    await asyncio.wait_for(
  File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for
    return await fut
           ^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/weconnect_cupra.py", line 176, in update
    self.__api.update(updateCapabilities=updateCapabilities, updatePictures=updatePictures, force=force, selective=selective)
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/api.py", line 39, in update
    self.updateVehicles(updateCapabilities=updateCapabilities, updatePictures=updatePictures, force=force, selective=selective)
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/api.py", line 67, in updateVehicles
    self.__vehicles[vin].update(
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/elements/vehicle.py", line 207, in update
    self.updateStatus(updateCapabilities=updateCapabilities, force=force, selective=selective)
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/elements/vehicle.py", line 237, in updateStatus
    'windowHeatingStatus': (WindowHeatingStatus, climatization_status_dict['windowHeatingStatus']),
                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'windowHeatingStatus'

2024-08-27 20:54:35.817 ERROR (SyncWorker_42) [weconnect_cupra] Failed to retrieve data for VIN VSS: Could not fetch data. Status Code was: 429
2024-08-27 20:54:35.817 ERROR (SyncWorker_42) [weconnect_cupra] Could not fetch data. Status Code was: 429

what is wrong / what do i wring?

thanks a lot and regards Daniel

delormejonathan commented 2 weeks ago

Hello,

I experienced the same issue yesterday, with the official app also being blocked. To resolve it, I had to disable my integration and wait a couple of hours for the API to reauthorize.

This issue might be linked to the interval setting, which could be too aggressive: https://github.com/daernsinstantfortress/cupra_we_connect/blob/036cb68380fff288a1c240084bde0569456f221d/custom_components/cupra_we_connect/__init__.py#L80

I modified my integration today to use a longer interval (1 hour). I'll let you know if this adjustment resolves the issue.

aperezva commented 1 week ago

I have the same problem every 30 minutes and info is not updating so often. I have to force it changing per example charge limit.

It’s not confidence integration and app too