Flair API suddenly severely limited?
So I control my vents via API, with a script that knows about the physical properties about how heat transfers through my house (my house is a little unusual). This has been fine for a couple of years now, but this morning it started failing with "Too Many Requests: 50 per day, client_id: [redacted], url: https://api.flair.co/oauth/token"
That's only two per hour, and given that each vent request is an API request, seems to mean that the API is suddenly completly unusable? Is this intended? Is it possible to at least get a temporary exception if I need to find another solution?
Thanks in advance
-
Also: is this rate limit _just on ouath_, or on the API generally? I didn't find any documentation for the limits.... if it's on oauth, we can refactor to cache tokens and such, and not constantly re-authenticate -I'm using your supplied python library, which doens't do that, but I can obviously modify it to do that. But need guidence!
-
+1. Without the Flair API, the vents are rendered completely useless in my setup. I have used Flair for several years and if the API is now crippled, the vents just became eWaste. If this is a permanent change, you just rendered the vents unusable for a large portion of your customers.
-
I was already thinking maybe the issue was related to them deprecating oauth 1.0.... But....
Where is this library? I'm looking on flair-systems and I don't see any commits since 2022 and the python library there is not using oauth2. I tried using oauth2 via just curl for testing (from the flair.co/api page) and it fails:
When I try doing the "Resource Owner Credentials" POST method using my client ID/secret/username/password, I get {"error": "unsupported_grant_type"}
(complaining about 'grant_type="password"' ). I tried both with and without the quotes around the grant_type (my home automation code was using the oauth1.0 version of this API successfully for 2-3 years up until about a day ago, when it started throwing the rate limiting errors)When I try using the "OAuth2 Token Endpoint" POST method using my client ID/secret, I get {"error": "invalid_client"}
I seem to recall from years ago when I first wrote the code that the "Token Endpoint" was for dealers only, so the 2nd error might make sense. But Resource Owner Credentials should work.
-
-
Oh! I had that problem too - if you look at the readme in that PR, you'll see that you need a new client id and secret, but that you can generate them from in the flair app (or on my.flair.co as well). You go into account seetings, then scroll down to developer options, and there's an option down there to generate the oauth2 creds you need
-
Ahhh... THAT worked! I got a Bearer token this time. Thanks!
first, I didn't realize he didn't merge the commit, so I wasn't looking at the commits themselves :)
And yes, after I created a new client ID/secret in the app, the "Token Endpoint" call now works. (for other readers, do NOT put the values in double quotes--this is a bit confusing in the API documentation, as one example has double quotes and one does not)
It still appears that my old method of using the "Resource Owner Credentials" method doesn't work anymore--maybe they deprecated it and they need to update the docs? (it still says invalid grant type) but I'm perfectly fine with switching the API in my code.
Please sign in to leave a comment.
Comments
7 comments