fishbigger / TapoP100

A module for controlling the TP-Link Tapo P100 Plugs
MIT License
567 stars 139 forks source link

"API rate limit exceeded" for request to eu-wap.tplinkcloud.com #89

Open WouterGritter opened 1 year ago

WouterGritter commented 1 year ago

I'm getting an API rate limit exceeded error in the getToken method of P100.py. The entire JSON returned from tp-link is:

{'error_code': -20004, 'msg': 'API rate limit exceeded'}
Bloodyraw commented 1 year ago

Dunno if anyone is answering here anymore, but this isssue is most likely caused by sending too many requests to TP's servers/API. You will probably get a short term "ban" and then be allowed to connect again whenever the limit is reset.

fishbigger commented 1 year ago

Sorry didn't see this. The getToken function is part of some experiments I wrote a while ago and were never really intended to be used. @Bloodyraw is probably correct if you still need to use it.

goofy2k commented 1 year ago

What if you do the getToken only once in a while, store required info, and use that for polling your plugs?

Bloodyraw commented 1 year ago

What if you do the getToken only once in a while, store required info, and use that for polling your plugs?

I think that should work. But can't say for sure, since we don't know exactly what the rate limit is.

But usually rate limits are set pretty high. So in your case I really think it shoudl work 😊

seba1337 commented 1 year ago

Just change the UUID to something random.

doctorvenables commented 1 year ago

Not the case about waiting a while.

Is it impossible that because I've linked the tplink app to google home that my API rate limit has been exceeded? If I take out the getToken line, I get the invalid credentials error message.

Edit: credentials were in fact wrong.

Good news though - my tp100 is on the latest firmware!