Evohome app broken

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Stevedh
    Automated Home Guru
    • Mar 2017
    • 177

    #31
    Still working fine here, have you had a look at caching tokens so you don't re login every 5 mins

    Comment

    • gordonb3
      Automated Home Ninja
      • Dec 2016
      • 273

      #32
      Originally posted by Stevedh View Post
      Still working fine here, have you had a look at caching tokens so you don't re login every 5 mins
      Not seeing any real issues myself. The only thing I get is an occasional "Request count limitation exceeded, please try again later" message returned when I try to logon to the v1 (US) API for better temperature resolution. So yes that does require me to do a logon twice within a few seconds, but as said I only get this error occasionally - maybe once or twice a day.

      The v2 API (the one that confusingly has v1 in the URI) is not giving me any issues whatsoever. And I request status every 2 minutes.

      Comment

      • DBMandrake
        Automated Home Legend
        • Sep 2014
        • 2361

        #33
        Originally posted by Stevedh View Post
        Still working fine here, have you had a look at caching tokens so you don't re login every 5 mins
        Unfortunately saving the tokens doesn't seem to be possible in my situation as the script that calls the evohome-client libraries is not persistent across each session. (And I'm not even sure whether watchforstock's evohome-client python library can do token caching in the first place)

        Comment

        • DBMandrake
          Automated Home Legend
          • Sep 2014
          • 2361

          #34
          Originally posted by gordonb3 View Post
          Not seeing any real issues myself. The only thing I get is an occasional "Request count limitation exceeded, please try again later" message returned when I try to logon to the v1 (US) API for better temperature resolution. So yes that does require me to do a logon twice within a few seconds, but as said I only get this error occasionally - maybe once or twice a day.

          The v2 API (the one that confusingly has v1 in the URI) is not giving me any issues whatsoever. And I request status every 2 minutes.
          I've added a 30 second pause between querying the V1 and V2 API's, also I've added a 30 second pause before sending the V1 query if the cache has expired.

          This avoids the issue where the first zone query in a 5 minute period gets a failure, fails to cache any results and the second zone then tries to query immediately afterwards and so on...

          Otherwise failures results in potentially up to 8 queries in a short time (compounding on the rate limit) as each zone finds the cache empty and tries a query of its own. The alternative might be to update the cache file time but leave it empty so that following zones know not to try during that 5 minute period but that of course still results in no data for that 5 minute period and a gap in the graph.

          These two queries have improved matters but I'm still seeing a lot of failures on the V2 API where it reports HTTP 429.

          What do you guys do if your first attempt during a polling period fails - just wait until the next polling period with no more attempts ?

          It would be really nice to have some sort of official word from Honeywell what the rate limiting policy is now as it has clearly changed, and in a big way, from what it used to be. Either that or they're under a DDoS or the servers are just really flaky.

          Comment

          • dty
            Automated Home Ninja
            • Aug 2016
            • 489

            #35
            Originally posted by DBMandrake View Post
            It would be really nice to have some sort of official word from Honeywell what the rate limiting policy is now as it has clearly changed, and in a big way, from what it used to be. Either that or they're under a DDoS or the servers are just really flaky.
            Have you looked at the headers and/or body of the response? It might be that it describes the limits in there somewhere.

            Comment

            • DBMandrake
              Automated Home Legend
              • Sep 2014
              • 2361

              #36
              Originally posted by dty View Post
              Have you looked at the headers and/or body of the response? It might be that it describes the limits in there somewhere.
              No, as I specifically mentioned in an earlier post there is no additional information in the 429 response to say what the rate limits are or how long until it's OK to retry. So we can only guess what the rate limits might be.

              Comment

              • gordonb3
                Automated Home Ninja
                • Dec 2016
                • 273

                #37
                As a rule,you're bound to do multiple calls when you logon to the portal (using the v2 API):
                1. logon
                2. retrieve the user ID
                3. fetch installation info
                4. get status report
                5. (optional) get schedule info for one or more zones (each a separate call)

                Since there can be up to 12 zones for a single location and you can have multiple locations I do not think this limit they apparently introduced is related to just the number of calls originating from a single IP.

                I am in fact not doing anything special. Domoticz internals also do not allow me to access the HTTP return and programmatically respond to it and so far I've not seen reason to enable debug output on it, nor did I hear from any other user seeing the HTTP 429.

                Comment

                • paulockenden
                  Automated Home Legend
                  • Apr 2015
                  • 1719

                  #38
                  I wonder whether Honeywell uses the Laravel PHP framework? There was an (undocumented!) change to the way it handles rate limiting a few months ago. Things that had been counted separately started to be measured together. One of our data suppliers got bitten by this.

                  P.

                  Comment

                  • gordonb3
                    Automated Home Ninja
                    • Dec 2016
                    • 273

                    #39
                    Originally posted by paulockenden View Post
                    I wonder whether Honeywell uses the Laravel PHP framework? There was an (undocumented!) change to the way it handles rate limiting a few months ago. Things that had been counted separately started to be measured together. One of our data suppliers got bitten by this.

                    P.
                    Don't think that is related. @DBMandrake mentions an HTTP return code, which in my application would translate as an unknown HTTP error, while I receive a Json formatted response informing me about the request count limit.

                    Comment

                    • paulockenden
                      Automated Home Legend
                      • Apr 2015
                      • 1719

                      #40
                      Originally posted by gordonb3 View Post
                      Don't think that is related.
                      The Laravel update I'm talking about resulted in data services returning 429 errors. Exactly the same as this. We saw it with things like share price feeds.

                      From my supplier:

                      "Turns out the latest version of the Laravel PHP framework that we use has made an (undocumented!) change to the way it handles rate limiting. Previously it would handle '/url1/feed/xml' and '/url2/feed/json' as separate urls, and thus apply the rate limiting individually.

                      However,we found that the framework's throttling handler was applying the rate limiting to ALL instances as a whole! So user 1 was hitting their feed 6 times a minute, which would put user 2 over their limit! Not only is this a stupid change, but potentially very dangerous to put into place without notifying developers - and was also seriously mind-boggling to track down."

                      I'm not saying that is the cause here - just that it looks suspiciously familiar.

                      P.
                      Last edited by paulockenden; 18 November 2018, 09:29 PM.

                      Comment

                      • gordonb3
                        Automated Home Ninja
                        • Dec 2016
                        • 273

                        #41
                        Okay, but I'm not seeing the HTTP-429 or the error that the underlying framework in my case would produce in that case. I receive a Json message containing an error report, which implies HTTP-200 success and thus the cause appears to be at another level.

                        Comment

                        • DBMandrake
                          Automated Home Legend
                          • Sep 2014
                          • 2361

                          #42
                          Originally posted by gordonb3 View Post
                          Okay, but I'm not seeing the HTTP-429 or the error that the underlying framework in my case would produce in that case. I receive a Json message containing an error report, which implies HTTP-200 success and thus the cause appears to be at another level.
                          Check the debug output I posted back in post 12:



                          I'm definitely seeing HTTP 429 on the initial authentication pass when I get a failure. It's always the same mode of failure.

                          BTW, I discovered the version of evohome-client I was running, 0.2.5 was a couple of years out of date and there have been quite a few changes since then and 0.2.8 including changes to the API keys and how the login token is timed out:

                          Python client to access the Evohome web service. Contribute to watchforstock/evohome-client development by creating an account on GitHub.


                          However I've updated 0.2.8 and it didn't seem to make any real difference.
                          Last edited by DBMandrake; 19 November 2018, 12:47 AM.

                          Comment

                          • paulockenden
                            Automated Home Legend
                            • Apr 2015
                            • 1719

                            #43
                            Originally posted by gordonb3 View Post
                            I receive a Json message containing an error report, which implies HTTP-200 success
                            Implies how? 4xx errors can still have content. Just think about 404 error pages, for example.

                            Comment

                            • gordonb3
                              Automated Home Ninja
                              • Dec 2016
                              • 273

                              #44
                              Originally posted by paulockenden View Post
                              Implies how? 4xx errors can still have content. Just think about 404 error pages, for example.
                              Because the underlying client I need to work with in this case returns a boolean value matching a return of `CURLE_OK` and if that does not evaluate to true also does not fill the target buffer with whatever content got sent along with that error. From that I know that if the error produced in the log is associated with (Json) content it has to be a HTTP-200


                              Edit:
                              Do note that I'm only seeing this error on the v1 API. It is possible that the response from this API is different from that of the v2 API where @DBMandrake reports seeing this error. Although it is impossible for me to see the error code (other than by enabling debug) for the last several days I have not seen anything in the log that could be the result of HTTP-429 being returned by the portal.
                              Last edited by gordonb3; 19 November 2018, 10:06 AM.

                              Comment

                              • paulockenden
                                Automated Home Legend
                                • Apr 2015
                                • 1719

                                #45
                                From the command line you need to use -f (or --fail) with curl if you want to to error on getting a 4xx status. Or if you are using a curl library in your code then set CURLOPT_FAILONERROR to 1. With these options it'll give you Error 22 CURLE_HTTP_RETURNED_ERROR when you get a 4xx error.

                                P.

                                Comment

                                Working...
                                X