Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ClientResponseError: 429, message='Too Many Requests' #660

Open
3 tasks done
aphotrax opened this issue Sep 11, 2024 · 2 comments
Open
3 tasks done

[BUG] ClientResponseError: 429, message='Too Many Requests' #660

aphotrax opened this issue Sep 11, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@aphotrax
Copy link

aphotrax commented Sep 11, 2024

Before you post a new issue - you must first check the following (and check the boxes with an "X" below)

  • 1.) Can you login using the smartphone app Volkswagen/Volkswagen Connect and interact with your car?
  • 2.) Please make sure that you can login into https://vwid.vwgroup.io/ and make sure that any "Terms and Conditions" are all checked
  • 3.) I do not have MFA enabled.

Environment

  • Volkswagencarnet release with the issue:
    V5.0.3
  • Car model and year
    Passat GTE 2023
  • Country where the car was bought:
    Belgium
  • Valid VW Connect subscription:
    Yes
  • Have you verified that the We Connect service works via VW´s portal?:
    Yes

Describe the bug

The issue has been there pretty much since I've started using the addon. When arriving home everything works as expected but after a while it stops connecting to my car. This happens the quickest when "often" changing MaxCharging setting based on solar production. When checking the logs it's confirmed I'm being rate-limited. Though I can't find any information about the limits applicable to avoid this. Currently it shouldn't send more then one request every +/-15 minutes to increase/decrease. And maybe sometimes one more for full stop or start. So that already feels pretty "slow".

Traceback/Error

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:245
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 12:15:12 (6 occurrences)
Last logged: 14:35:53

[140450388285840] Unexpected exception
[140450388292896] Unexpected exception
[140450402280080] Unexpected exception
[140449620424688] Unexpected exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_connection.py", line 834, in setCharging
    response_raw = await self.post(
                   ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_connection.py", line 521, in post
    return await self.post(
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_connection.py", line 521, in post
    return await self.post(
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_connection.py", line 521, in post
    return await self.post(
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_connection.py", line 510, in post
    return await self._request(
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_connection.py", line 466, in _request
    raise httperror from None
  File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_connection.py", line 408, in _request
    response.raise_for_status()
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1093, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 429, message='Too Many Requests', url='https://emea.bff.cariad.digital/vehicle/v1/vehicles/WVWZZZ3C5RE020753/charging/start'

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 996, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1068, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/volkswagencarnet/switch.py", line 77, in async_turn_on
    await self.instrument.turn_on()
  File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_dashboard.py", line 852, in turn_on
    await self.vehicle.set_charger("start")
  File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_vehicle.py", line 308, in set_charger
    response = await self._connection.setCharging(self.vin, (action == "start"))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_connection.py", line 841, in setCharging
    raise Exception("Unknown error during setCharging") from e  # pylint: disable=broad-exception-raised
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Exception: Unknown error during setCharging
@aphotrax aphotrax added the bug Something isn't working label Sep 11, 2024
Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Oct 12, 2024
@tokroth
Copy link

tokroth commented Oct 17, 2024

I have the same issue.

To try to resolve I have done this:
Throttled down the HASS configuration to 15 min sensor update interval (was 5 min) and also removed VW api connection from Tibber (my power company, using their service for smart charging). This is not optimal, but if need be…

The only things that ABSOLUTELY must work for me is a data refresh at 05.00 am in the morning to be able to force charging robot in case smart charging failed and secondly start heater 10 min before calendar departure in the morning if cold outside.

Do we have any knowledge on what the rate limit in the VW api is? And how to ensure it is not reached….?

@github-actions github-actions bot removed the stale label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants