Decoded - EvoHome API access to control remotely.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • DBMandrake
    Automated Home Legend
    • Sep 2014
    • 2361

    Hi All,

    New evohome user and being a techy of course I had to graph my temperatures, especially with winter approaching

    After looking at a few different options I've set up munin with a modified version of Infernos munin plugin, which uses watchforstock's evohome python library, all running on a disused Raspberry Pi

    One thing I immediately noticed is that I was getting a lot of gaps in my graphs and doing a little bit of debugging directly with some python code calling watchforstock's libraries I realised the issue is nothing local but rather that approximately 20-30% of the calls to the servers are failing with HTTP 500 errors...

    My first thought was rate limiting of course, however I'm only polling once every 5 minutes, and dropping the polling back to 10 minutes didn't help either. There is no particular pattern except that the failure rate is pretty consistent and it's always an HTTP 500 error. Another thing that suggests its not rate limiting related is that I can retry just a few seconds later and nearly every time it will go through. And it doesn't matter whether I wait 10 seconds or a minute to retry, the chance of success is about the same.

    The symptoms seem awfully like one or more bad servers behind a load balancer - you have a statistical chance of being redirected to the bad server, but an immediate retry will probably direct you to a different, working server, thus succeed.

    I modified Inferno's script to try a second time on failure after 20 seconds and that helped a lot but there were still a few gaps, even a 3rd time after another 40 seconds was still showing the occasional gap. Of course I'm not very happy with this as a workaround.

    On a hunch I tried switching the script to use the V1 API instead of the V2 API that it had been using and removed the retry mechanism I'd added to prevent that masking any issue - all I'm polling for is zone name, set point and temperature, and both API's provide this, so I don't actually need to use the V2 API.

    Presto - no more random server failures, so far it's succeeding every time although I haven't given it a full 24 hours yet to see if there are any gaps in the graph.

    Is anyone else noticing the V2 API is a bit unreliable ? I also notice similar unreliability on the Honeywell App on my iPhone - although the App doesn't show errors, I notice that a manual refresh often doesn't show any change even though the data has had plenty of time to propagate from the controller, and despite my graph already showing the updated data (proving it has reached the servers) - a 2nd manual refresh on the phone seconds later does show the updated data. It's as if the phone app silently ignored a failure to connect to the server...

    I've also had 10 "Alert: Failed Zone Change" emails from Honeywell in just 4 days of use, in response to trying to send remote commands from the iPhone app, and this was before I ever started trying to poll the servers to graph temperatures... it's a bit disappointing that the servers seem to be this unreliable - without an email alert I would never be aware that the command I just sent from the phone to turn off the heating never actually went through, because the phone UI shows that the command succeeded, and only if you wait a few seconds and do a forced refresh (drag down) will you see the truth that the command did not actually go through.
    Last edited by DBMandrake; 9 December 2015, 02:42 PM.

    Comment

    • paulockenden
      Automated Home Legend
      • Apr 2015
      • 1719

      I had a Failed Zone Change email yesterday, first time ever. So yes, perhaps something at wrong at their end.

      P.

      Comment

      • nico
        Automated Home Jr Member
        • Oct 2015
        • 14

        I'm also having a lot of connection errors, I'm using python api from this thread.
        I'm polling every 30 minutes, I solved reiterating the connection after 30 seconds with a max of 4 iteration...

        Comment

        • DBMandrake
          Automated Home Legend
          • Sep 2014
          • 2361

          Originally posted by nico View Post
          I'm also having a lot of connection errors, I'm using python api from this thread.
          I'm polling every 30 minutes, I solved reiterating the connection after 30 seconds with a max of 4 iteration...
          I found even three attempts to poll occasionally fail. What data are you polling for ?

          All I did to change to the V1 API was change the import line from from evohomeclient2 import EvohomeClient to from evohomeclient import EvohomeClient, and then in the actual EvohomeClient() call if you are using the third debug argument (whether false or true) you need to remove that as it doesn't seem to be supported when importing the V1 methods.

          So far not a single failed query to the V1 API, and that's with my retry code removed.
          Last edited by DBMandrake; 9 December 2015, 03:53 PM.

          Comment

          • nico
            Automated Home Jr Member
            • Oct 2015
            • 14

            Originally posted by DBMandrake View Post
            I found even three attempts to poll occasionally fail. What data are you polling for ?
            All I did to change to the V1 API was change the import line from from evohomeclient2 import EvohomeClient to from evohomeclient import EvohomeClient, and then in the actual EvohomeClient() call if you are using the third debug argument (whether false or true) you need to remove that as it doesn't seem to be supported when importing the V1 methods.
            So far not a single failed query to the V1 API, and that's with my retry code removed.
            I'm getting only rooms temperatures and sets, to have a history graph (check attached screenshot). I switched to V1 api as you suggested, no more errors and faster connection!
            Attached Files

            Comment

            • Conseils
              Automated Home Jr Member
              • Nov 2014
              • 31

              Evohome server issues

              Originally posted by DBMandrake View Post
              Hi All,

              ...

              I've also had 10 "Alert: Failed Zone Change" emails from Honeywell in just 4 days of use, in response to trying to send remote commands from the iPhone app, and this was before I ever started trying to poll the servers to graph temperatures... it's a bit disappointing that the servers seem to be this unreliable - without an email alert I would never be aware that the command I just sent from the phone to turn off the heating never actually went through, because the phone UI shows that the command succeeded, and only if you wait a few seconds and do a forced refresh (drag down) will you see the truth that the command did not actually go through.
              This time last year they had similar issues. They have had drop-outs for the last two to three weeks, perhaps the server is cold! (or busy). I seem to recall they took out the server last year as well for service, struck me as odd there was no backup server.

              Evohome dropouts 00.jpg
              See where there are boxes missing on the graph. The software polls every 10 minutes on a cron job. At the moment, if it can't get the Evohome data, it drops all data. Now with over a years worth of logged data. I can be reasonably sure it's not my end. If someone cares, you can have text log for dates and times. I could log and verify the fails if I was overly interested.

              P.S. Honeywell did not respond to my request for a developer account, made a couple of months ago. :-(
              Last edited by Conseils; 10 December 2015, 12:03 AM.

              Comment

              • Conseils
                Automated Home Jr Member
                • Nov 2014
                • 31

                Recent e-mail re service status.

                Planned Maintenance - Total Connect Comfort server outage - 16/12/15

                The Total Connect Comfort servers will undergo planned maintenance at the following point in time:

                Start: 16/12/15 5:00 AM (UTC)
                End: 16/12/15 11:00 AM (UTC)

                During the outage customers will not be able to access the Total Connect Comfort web login, app, or make API calls (e.g. via IFTTT, Pebble).
                .....

                Comment

                • sd84
                  Automated Home Lurker
                  • Dec 2015
                  • 6

                  C# European Version

                  Hi paul777,

                  Great work on the c# library. I have cloned it and have been playing around a bit. I presume this is the USA version of the service this has been implemented for?

                  Has anyone used c# to connect to the EMEA version which I believe uses OAUTH for authentication?


                  Originally posted by paul777 View Post
                  I have published a .Net / C# version of the API to GitHub here https://github.com/paul-777/Evohome....er/EvoHome.Lib

                  Code:
                      class Program
                      {
                          static int REFRESH_SECONDS = 300;
                          static void Main(string[] args)
                          {
                              Controller cn = new Controller();
                              Task t = cn.Init("yourusername", "yourpassword");
                              t.Wait();
                              
                              // Set a temp override and cancel again
                              cn.Locations[0].Gateways[0].TemperatureControlSystems[0].Zones[0].SetTemperatureOverride(11, DateTime.Now.AddHours(1)).Wait();
                              cn.Locations[0].Gateways[0].TemperatureControlSystems[0].Zones[0].CancelTemperatureOverride().Wait();
                             
                              // Copy the schedule down and writeit back again
                              var st = cn.Locations[0].Gateways[0].TemperatureControlSystems[0].Zones[0].GetSchedule();
                              st.Wait();
                              var sched = st.Result;
                  
                              cn.Locations[0].Gateways[0].TemperatureControlSystems[0].Zones[0].SetSchedule(sched).Wait();
                              
                              // Export data to a csv file
                              using (var s = File.AppendText(@"data.csv"))
                              {
                                  foreach (var x in cn.Locations)
                                  {
                                      foreach (var gateway in x.Gateways)
                                      {
                                          foreach (var tc in gateway.TemperatureControlSystems)
                                          {
                                              string line = "Time," + string.Join(",", from z in tc.Zones select z.Name) + "," + string.Join(",", from z in tc.Zones select z.Name);
                                              Console.WriteLine(line);
                                                  s.WriteLine(line);
                                          }
                                      }
                                  }
                  
                  
                                  while (true)
                                  {
                                      Stopwatch sw = new Stopwatch();
                                      sw.Start();
                                      try
                                      {
                                          cn.UpdateStatus().Wait();
                                          foreach (var x in cn.Locations)
                                          {
                                              foreach (var gateway in x.Gateways)
                                              {
                                                  foreach (var tc in gateway.TemperatureControlSystems)
                                                  {
                                                      string line = DateTime.UtcNow.ToString("HH:mm dd MMM yyyy") + "," + string.Join(",", from z in tc.Zones select z.Status.TemperatureStatus.Temperature) + "," + string.Join(",", from z in tc.Zones select z.Status.HeatSetpointStatus.TargetTemperature);
                                                      Console.WriteLine(line);
                                                      s.WriteLine(line);
                                                  }
                                              }
                                              s.Flush();
                                          }
                                      }
                                      catch
                                      { }
                                      sw.Stop();
                                      Thread.Sleep((int)Math.Max(0,(REFRESH_SECONDS * 1000) - sw.ElapsedMilliseconds));
                                  }
                              }
                  
                              Console.ReadLine();
                          }
                      }

                  Comment

                  • paul777
                    Automated Home Lurker
                    • Nov 2015
                    • 9

                    I am in the UK and using this so I know it works here, not sure about the rest of the world.

                    Comment

                    • maurgaj
                      Automated Home Lurker
                      • Dec 2015
                      • 7

                      Originally posted by magga View Post
                      Hi weejimmy,

                      That's some data you've got going on there!

                      Interesting to see those things that you mention above. If you take a look at my graphs (just click on any room on the link below), I don't get any of this kind of thing, the setpoints always seem to be correct. I do get the temperatures going a fair bit above the setpoints in some rooms, though.

                      Evohome Web Controller

                      Matt
                      I installed two days ago evohome in my house and now I tried to log into the site Evohome Web Controller
                      But I always get the message "Login Failed".
                      Why?
                      Can anyone help me?

                      Thanks

                      Comment

                      • Gudge
                        Automated Home Jr Member
                        • Dec 2015
                        • 18

                        Originally posted by maurgaj View Post
                        I installed two days ago evohome in my house and now I tried to log into the site Evohome Web Controller
                        But I always get the message "Login Failed".
                        Why?
                        Can anyone help me?

                        Thanks
                        I too have the same problem

                        Comment

                        • paul777
                          Automated Home Lurker
                          • Nov 2015
                          • 9

                          As I understand it that website is one users personal site they have built not a general public login.

                          Comment

                          • Gudge
                            Automated Home Jr Member
                            • Dec 2015
                            • 18

                            Originally posted by paul777 View Post
                            As I understand it that website is one users personal site they have built not a general public login.
                            oh I didn't realise, what a pitty

                            Comment

                            • sd84
                              Automated Home Lurker
                              • Dec 2015
                              • 6

                              Thanks @paul777. Yes I am not sure what I was doing the first time I was looking at this but now have it working using your library. I am expanding it and trying to create a webforms/MVC app using the nice css someone previously used for the site mentioned above. Like everyone else though I can no longer login. Does anyone still have access to this other than the owner?

                              Comment

                              • maurgaj
                                Automated Home Lurker
                                • Dec 2015
                                • 7

                                Originally posted by sd84 View Post
                                Thanks @paul777. Yes I am not sure what I was doing the first time I was looking at this but now have it working using your library. I am expanding it and trying to create a webforms/MVC app using the nice css someone previously used for the site mentioned above. Like everyone else though I can no longer login. Does anyone still have access to this other than the owner?
                                Hi sd84, I'm also a programmer, so if you want we can collaborate on the project

                                Comment

                                Working...
                                X