tillsteinbach / WeConnect-python

Python API for the Volkswagen WeConnect Services
MIT License
109 stars 29 forks source link

Too many requests when modifying vehicle state #89

Closed ifuller1 closed 1 year ago

ifuller1 commented 1 year ago

Describe the bug This might be related to my account but I can't validate that so apologies in advance.

If I try to modify state, e.g. setting the charge status (or AC etc etc). I get the following from the api respond (I added some logging):

{"error":{"message":"Too Many Requests","info":"Upstream service responded with an unexpected status. If the problem persists, please contact our support.","code":4296,"group":2,"retry":true}}

The more sanitised version from the library simply says:

weconnect.errors.ControlError: Could not control charging (Too Many Requests - Upstream service responded with an unexpected status. If the problem persists, please contact our support. - Please retry in a moment)

Car status is logged out correctly prior to this so reading data is fine.

To Reproduce

print('#  Initialize WeConnect')

passwordSecret = os.environ['vw-password']

weConnect = weconnect.WeConnect(username="xxxx", password=passwordSecret, updateAfterLogin=False, loginOnInit=False)
weConnect.login()
weConnect.update()

car = weConnect.vehicles["xxxx"]
print(f"Car {car}")

#car.controls.climatizationControl.value = ControlOperation.STOP
car.controls.chargingControl.value = ControlOperation.STOP

Expected behavior The command successfully updates the status

Screenshots

Logs See above

ifuller1 commented 1 year ago

p.s. the library is amazing - thank you!

tillsteinbach commented 1 year ago

The number of requests to the car is limited to not kill the battery. After a drive it should work again.

ifuller1 commented 1 year ago

Thanks. Sorry for the late reply.

On Sun, 12 Feb 2023, 08:22 Till Steinbach, @.***> wrote:

Closed #89 https://github.com/tillsteinbach/WeConnect-python/issues/89 as completed.

— Reply to this email directly, view it on GitHub https://github.com/tillsteinbach/WeConnect-python/issues/89#event-8497875499, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABDLLEDJGZ7GO7NTP6G2ZTWXCFSZANCNFSM6AAAAAAS7QYWKU . You are receiving this because you authored the thread.Message ID: @.*** com>