nitaybz / homebridge-sensibo-ac

Homebridge plugin for Sensibo - Smart AC Control
GNU General Public License v3.0
69 stars 15 forks source link

[SensiboAC] ERROR: Request failed with status code 429 #132

Closed dramis closed 3 months ago

dramis commented 5 months ago

It's look like there is a limit on the api call: 10 requests per 10 seconds: https://www.facebook.com/groups/sensibo/permalink/2120146091489446/

benwebbbenwebb commented 5 months ago

Thanks for the heads up @dramis

Please provide any additional background on what your setup is like and what GET / POST actions you were performing when you received the issue.

This will help with recreating it in my local so that I can then provide a patch.

Comments from Facebook thread:

dramis commented 5 months ago

it’s the homebridge configuration: {     "apiKey": "****",     "disableFan": false,     "disableDry": false,     "ignoreHomeKitDevices": false,     "enableSyncButton": false,     "syncButtonInAccessory": false,     "enableOccupancySensor": false,     "enableClimateReactSwitch": false,     "enableHistoryStorage": false,     "disableHorizontalSwing": false,     "disableLightSwitch": false,     "externalHumiditySensor": false,     "allowRepeatedCommands": false,     "debug": false,     "platform": "SensiboAC" }

It’s just added to m’y homekit device and i got the error in the homebridge log

Pblondin123 commented 5 months ago

I have the same error. Plugin is Version 2.3.4.

benwebbbenwebb commented 5 months ago

Thanks @dramis and @Pblondin123

Are you performing any action(s) when the error is seen? E.g. turning a unit on or off. Or does it show up periodically?

The GET call should only happen every 90ish seconds, and all the POST calls should only occur when you change a mode etc.

Pblondin123 commented 5 months ago

Hi, on my side i got the error while restarting HB. I just went ahead today and no error message (?).

benwebbbenwebb commented 5 months ago

Thanks for the input @Pblondin123 and @bileman0

I ran some tests on my own Homebridge setup and I'm not seeing the 429 error, even after restarting or trying to adjust multiple settings in quick succession...

Note that I am running the v2.5.0-alpha.2 though. Planning to release the new version to Production in the next week, so would you mind giving the alpha a go to see if it helps reduce or eliminate the 429 issue?

To do so, navigate to your Homebridge install in the browser, then open the Plugins page, click the three vertical dots on the 'Sensibo for Homebridge' plugin and then Manage Version, select the Alpha from the list and click Install.

v2.5.0-alpha.2 includes several new features, some code clean-up, as well as updating a number of dependencies and packages, including Axios (which does the heavy lifting for API calls, v0.21.4 to v1.6.5) so I'm hoping/wondering if that includes API compression - which is one of the recommendations from Sensibo on the Facebook post from above.

dramis commented 5 months ago

I just update to v2.5.0-alpha.2 I don't have 429 error, I will keep an eye on it. Thanks

LeonFedotov commented 4 months ago

same here, ive seen theres a gzip option, maybe we can enable that?

benwebbbenwebb commented 4 months ago

Hi @LeonFedotov

same here, ive seen theres a gzip option, maybe we can enable that?

When you say “same here” do you mean the error or that v2.5 alpha resolves any API 429 issues?

LeonFedotov commented 4 months ago

@benwebbbenwebb 2.5 seems to work :P sorry i wasn't paying attention to the comments. since this is a rate limit issue i will update if the issue persists.

seidnerj commented 3 months ago

This is fixed in https://github.com/nitaybz/homebridge-sensibo-ac/pull/136 (added retries for 429 status code)

benwebbbenwebb commented 3 months ago

Thanks @LeonFedotov, @dramis and @bileman0

I’m marking this as Resolved as there is a fix on the way to main release.