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

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

Closed
dramis opened this issue Apr 22, 2024 · 12 comments
Closed

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

dramis opened this issue Apr 22, 2024 · 12 comments

Comments

@dramis
Copy link

dramis commented Apr 22, 2024

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
Copy link
Collaborator

benwebbbenwebb commented Apr 22, 2024

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:

  • new API limit enforced (up to 5 requests in 5 seconds or 10 in 10 seconds when compressed)
  • Add "Accept-Encoding: gzip" header to your client to increase the allowed limit
  • — compressed (in curl), will need to see if existing API/Networking library supports

@dramis
Copy link
Author

dramis commented Apr 22, 2024

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
Copy link

I have the same error. Plugin is Version 2.3.4.

@benwebbbenwebb
Copy link
Collaborator

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
Copy link

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

@benwebbbenwebb
Copy link
Collaborator

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
Copy link
Author

dramis commented Apr 29, 2024

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

@LeonFedotov
Copy link

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

@benwebbbenwebb
Copy link
Collaborator

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
Copy link

@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
Copy link
Contributor

This is fixed in #136 (added retries for 429 status code)

@benwebbbenwebb
Copy link
Collaborator

Thanks @LeonFedotov, @dramis and @bileman0

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

benwebbbenwebb pushed a commit that referenced this issue Jul 5, 2024
Big fix: add gzip header to requests to increase Sensibo API rate limit (#132, #138 and #140)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants