tillsteinbach/WeConnect-python

Too many requests when modifying vehicle state

ifuller1 opened this issue · 3 comments

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

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

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