Decoded - EvoHome API access to control remotely.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Inferno
    Automated Home Lurker
    • Oct 2015
    • 7

    Originally posted by paulockenden View Post
    Interesting example of overshoot on some of those graphs!
    Yes that is what I see on most zones. I have enabled "adaptive mode" and I assume there is some learning, but cannot find it

    2015-10-29 09_50_09-https___admin.bsdfreaks.nl_munin_static_dynazoom.html_cgiurl_graph=_munin-cg.jpg

    Comment

    • nico
      Automated Home Jr Member
      • Oct 2015
      • 14

      magga, let someone else help you with your code, personally I could give a look and do some tests on my raspberry (local only or behind a VPN).
      You could also put the code on a private repository (github or bitbucket) and invite only few people...

      Originally posted by magga View Post
      Hi all,
      Wow, I can't believe the interest I've had about the interface I made. Sorry i haven't replied to a lot of private messages, I have recently started my own business, and have just not had time to revisit this project until recently. The main issue with the interface is that it's a bit buggy and not all that secure, so I'm reluctant to release it to the masses. It doesn't really have any error checking so if something doesn't work, it can be tricky to work out what's going on.

      I have added some support for lightwaverf and also Somfy blind motors, although these are just calls to the domoticz API that I have running on my raspberry pi.

      Thanks

      Comment

      • nico
        Automated Home Jr Member
        • Oct 2015
        • 14

        Originally posted by StuartG View Post
        The code is very scrappy (more proof of concept) but I'm happy to share if anyone wants, and promises not to criticise my very rusty PHP!!
        I'm very interested! Nice clean interface, really helpful to see how a zone respond to the set point!

        Comment

        • StuartG
          Automated Home Jr Member
          • Mar 2015
          • 45

          I'm doing a little bit of work on it at the moment as I'm also doing some modification work on the API itself. I think the best thing might to sort myself out a GitHub account, as then I can post what I've done, but also keep it updated. I'll try to do that soon.

          I should say, my PHP is very rusty so the code might be a bit clunky! I'm also not a UI sort of person, so if anyone has any good ideas or code to share on that side it would be great.

          Eventually I have in mind some sort of web portal where you could create an account and it would handle data logging for you. But I also have some ideas on 'features' that aren't in the Evohome app but could be implemented by using a web interface. For example, 'profiles' at a zone level. E.g. we have a spare room that has one typical set of setting when we don't have guests, but a completely different profile when visitors come to stay. I imagine a web module to load in stored profiles to quickly reconfigure the system. Also, a back up and restore of zones, or the entire schedule, either to a local file or perhaps to a backend database so you can access from anywhere.

          I don't see a web app 'replacing' the Evohome mobile apps which are perfect for many day-to-day cases, I'm just discovering things I'd like to be able to do, and through the API it should be possible to write them.

          And my wife would love to have an ability to "quick boost" a room - some days you get in early and you just want a 'one click' setting to say you're home. I know that's do-able through the phone app for each zone, but she'd like to be able to quickly over-ride a set of three rooms to bring the house up to temperature.

          Does anyone else see mileage in such a web app? And if so, any thoughts on what would be best. I was thinking about maybe building on top of an existing framework (I used to maintain a couple of Drupal modules) that would already have built in things like user accounts and support for multiple databases. It would mean the code could focus on the 'Evohome' and not building an entire platform.

          This is, of course, all a long way off, but it's nice to have a goal...!!

          I'll try and get the basic data logging code tidied up and shared shortly...
          Last edited by StuartG; 29 October 2015, 05:30 PM. Reason: Said web app when I meant phone app!

          Comment

          • jarrah31
            Automated Home Jr Member
            • Oct 2015
            • 15

            Originally posted by Inferno View Post
            Thanks to this thread I was able to make a plugin for Munin (http://munin-monitoring.org/) to monitor my zones of the evohome.

            The can be found here https://github.com/Infern1/evohome-munin

            [ATTACH=CONFIG]596[/ATTACH]
            Hi Inferno,

            I like what you've done there so have been trying to do this myself using your instructions, but have hit a couple of problems that I'm hoping you can help with please.

            I'm using a Raspberry Pi (Raspbian) and have installed Evohome client as per my notes here: http://www.wordpress-1219309-4387497...ll=1#post23597

            Following your instructions from here (https://github.com/Infern1/evohome-munin) I have done the following so far:

            python-munin framework
            Code:
            git clone git://github.com/samuel/python-munin.git
            sudo pip install ./python-munin
            python-weather-api
            Code:
            wget https://launchpad.net/python-weather-api/trunk/0.3.8/+download/pywapi-0.3.8.tar.gz
            tar -zxvf pywapi-0.3.8.tar.gz 
            cd pywapi-0.3.8/
            python setup.py build
            sudo python setup.py build
            At this point the command you suggested didn't work for me:

            Code:
            pi@raspberrypi ~ $ sudo pip install --allow-all-external  pywapi  --allow-unverified pywapi
            Usage: /usr/bin/pip install [OPTIONS] PACKAGE_NAMES...
            
            /usr/bin/pip install: error: no such option: --allow-all-external
            I then wasn't quite sure what to do here as I had no /etc/munin directory. Should I create the folder structures here or perhaps Munin didn't install properly? (I had no errors during install)

            Code:
            ex: /etc/munin/plugin-conf.d/plugins
            
            [evohome*] user root
            Same here, I have no /usr/local/share/munin directory.

            Code:
            ln -s /usr/local/share/munin/plugins/evohome_ /usr/local/etc/munin/plugins/evohome_Zonename
            I'll keep looking into it in the meantime though.

            Thanks in advance.

            Comment

            • PaulB
              Automated Home Sr Member
              • Sep 2015
              • 60

              Well, I've finally got my system installed, and (just so happens) already had 1 comms failure within the first few hours of setting it up...

              Still, I've managed to play with the python examples given & start pushing some metrics into Graphite



              Only thing I've noticed, is that the thermostat.changeableValues.mode entry doesn't seem to change? I'd expect that when the stat calls for heat, that this would go from 'Off' to 'Heat' as defined under thermostat.allowedModes? Similar to how the Hot Water kit switches thermostat.changeableValues.mode to either DHWOn or DHWOff, depending on whether the schedule is running or not.

              What I would prefer though, really, is that these values only change when demand IS requested, and not just as part of the schedule. Maybe this could exist in another key, who knows... But being able to actively monitor what zone IS requesting the heat, and when, would be a massive help!

              Also, I use the WeatherUnderground API for the weather data. Trying to use the OpenWeatherMap one, it only seemed to update local information every few hours. WU seems to be more frequent (every 40 mins or so).
              Last edited by PaulB; 3 November 2015, 01:34 PM.

              Comment

              • Inferno
                Automated Home Lurker
                • Oct 2015
                • 7

                I updated the README to reflect your questions

                First make sure you have working munin, see here for an install Rasperry Pi

                My previous post was about how to measure temperature using the Raspberry Pi. This time we add more power to the system, and create our monitoring center with munin. Release the crow!

                Comment

                • jarrah31
                  Automated Home Jr Member
                  • Oct 2015
                  • 15

                  Originally posted by Inferno View Post
                  I updated the README to reflect your questions

                  First make sure you have working munin, see here for an install Rasperry Pi

                  https://gajdicookbook.wordpress.com/...or-monitoring/
                  Hi Inferno,

                  Thanks for updating the readme and pointing me to a Raspberry Pu Munin installation guide.

                  Having followed the Pi guide I can successfully run "sudo munin-run rbi-internal-temp", but if I try the evohome script the following happens:

                  Code:
                  pi@raspberrypi ~ $ sudo munin-run hallway
                  Traceback (most recent call last):
                    File "/etc/munin/plugins/hallway", line 179, in <module>
                      EvohomeMuninPlugin().run()
                    File "/usr/local/lib/python2.7/dist-packages/munin/__init__.py", line 50, in run
                      values = self.execute()
                    File "/etc/munin/plugins/hallway", line 167, in execute
                      temperature, setpoint, outside_temperature = self.getzoneinfo()
                    File "/etc/munin/plugins/hallway", line 159, in getzoneinfo
                      return temperature, setpoint,outside_temperature
                  UnboundLocalError: local variable 'temperature' referenced before assignment
                  It may be something to do with the following part of your instructions because I'm not sure what "place the following there:" means? I do have a /etc/munin/plugin-conf.d/ folder, but there was no 'plugins' file or folder in there, so I created a file called plugins and pasted the text below into it, but I don't think this worked...

                  "Find your plugins directory, this is depended on your OS ex: /etc/munin/plugin-conf.d/plugins and place the following there:"
                  Code:
                  [evohome*]
                  user root
                  This is what I've done so far in case it helps:

                  python-munin framework - https://gajdicookbook.wordpress.com/...or-monitoring/
                  sudo apt-get update
                  sudo apt-get install munin munin-node apache2 git
                  sudo nano /etc/apache2/conf.d/munin
                  Modify the lines containin ‘Allow from localhost’ to ‘Allow from localhost 192.168.0.0/16′ (change as appropriate)
                  sudo service apache2 restart

                  python-weather-api
                  wget https://launchpad.net/python-weather...i-0.3.8.tar.gz
                  tar -zxvf pywapi-0.3.8.tar.gz
                  cd pywapi-0.3.8/
                  python setup.py build
                  sudo python setup.py build

                  git clone https://github.com/Infern1/evohome-munin.git
                  sudo ln -s /home/pi/evohome-munin/evohome_ /etc/munin/plugins/hallway
                  Set your username and password for the honeywell portal in the file evohome_
                  sudo chmod +x /etc/munin/plugins/hallway

                  sudo service munin-node restart

                  Comment

                  • Inferno
                    Automated Home Lurker
                    • Oct 2015
                    • 7

                    Originally posted by jarrah31 View Post
                    Hi Inferno,

                    Thanks for updating the readme and pointing me to a Raspberry Pu Munin installation guide.

                    Having followed the Pi guide I can successfully run "sudo munin-run rbi-internal-temp", but if I try the evohome script the following happens:

                    Code:
                    pi@raspberrypi ~ $ sudo munin-run hallway
                    Traceback (most recent call last):
                      File "/etc/munin/plugins/hallway", line 179, in <module>
                        EvohomeMuninPlugin().run()
                      File "/usr/local/lib/python2.7/dist-packages/munin/__init__.py", line 50, in run
                        values = self.execute()
                      File "/etc/munin/plugins/hallway", line 167, in execute
                        temperature, setpoint, outside_temperature = self.getzoneinfo()
                      File "/etc/munin/plugins/hallway", line 159, in getzoneinfo
                        return temperature, setpoint,outside_temperature
                    UnboundLocalError: local variable 'temperature' referenced before assignment
                    It may be something to do with the following part of your instructions because I'm not sure what "place the following there:" means? I do have a /etc/munin/plugin-conf.d/ folder, but there was no 'plugins' file or folder in there, so I created a file called plugins and pasted the text below into it, but I don't think this worked...

                    "Find your plugins directory, this is depended on your OS ex: /etc/munin/plugin-conf.d/plugins and place the following there:"
                    Code:
                    [evohome*]
                    user root
                    This is what I've done so far in case it helps:

                    Munin plugins need to be placed in the munin plugins folder, so the file evohome_ should be placed in /usr/share/munin/plugins/ (on Raspberry Pi)
                    If you look in that folder there should be a bunch of plugins (default munin ones)

                    Next make a symlink:
                    Code:
                    #ln -s /usr/share/munin/plugins/evohome_ /etc/munin/plugins/evohome_hallway
                    So for every zone you create a symlink where the last part of the symlink (after the underscore) contains the zonename

                    So for example I have a /etc/munin/plugins/evohome_kitchen & /etc/munin/plugins/evohome_living all linking to evohome_

                    As I found there should be a: /etc/munin/plugin-conf.d/munin-node (RasPi)
                    place this in here
                    Code:
                    [evohome*]
                    user root

                    Comment

                    • jarrah31
                      Automated Home Jr Member
                      • Oct 2015
                      • 15

                      Ahh, thank you Inferno! Sorry you had to spell it out for me, but I really appreciate your help.

                      After finishing off as you describe above, something still isn't quite right with my setup, so I'll look into it more tomorrow. In the meantime, can you successfully run "sudo munin-run evohome_kitchen" for example? I'm just wondering if the errors I'm still seeing are a red-herring or not.

                      Thanks.

                      Comment

                      • Inferno
                        Automated Home Lurker
                        • Oct 2015
                        • 7

                        If I run it:
                        For zone "Woonkamer"
                        Code:
                        # munin-run evohome_Woonkamer
                        setpoint.value 16.0
                        outside_temperature.value 11
                        temp.value 22.5
                        The config:
                        Code:
                        # munin-run evohome_Woonkamer config
                        graph_title Room temperature Woonkamer
                        graph_category domotic
                        graph_args --base 1000
                        graph_vlabel temperature
                        graph_scale yes
                        temp.info Temperature in Room
                        temp.type GAUGE
                        temp.label Temperature
                        setpoint.info Temperature Setpoint in Room
                        setpoint.type GAUGE
                        setpoint.label Temperature SP
                        outside_temperature.info Temperature outside at location
                        outside_temperature.type GAUGE
                        outside_temperature.label Outside Temperature
                        Also check you /tmp folder there should be some tmp files created

                        Comment

                        • paul777
                          Automated Home Lurker
                          • Nov 2015
                          • 9

                          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

                          • CharlieD
                            Automated Home Lurker
                            • Nov 2015
                            • 3

                            A great thread, thanks all. I am keen to contribute but fail at the first hurdle, logging in using either the python or php apis in github. Even the simple initial code on page 1 of this thread (watchforstock 27/03/2014) returns "EmailOrPasswordIncorrect". I am using my user name / pwd from my account at https://international.mytotalconnect.../Account/Login. Any ideas ?

                            Comment

                            • StuartG
                              Automated Home Jr Member
                              • Mar 2015
                              • 45

                              Is there any official documentation about the API? I'm getting on quite well with the various libraries that have been created, coupled with some trial and error, but it would be nice to know the official specifications and requests that are possible. I think there could be a really vibrant community of development around Evohome, and I get the impression that those adopting the system at the moment are quite tech savvy. Knowing the available requests and what they do might trigger creative ideas, and also ensure that the libraries use the right request for the right scenario?

                              I'd also be really interested in knowing a bit more about what goes on when we interface with Evohome via the API. For example, the phone app lets you set some types of over-ride by a number of hours, and others by setting a date, but via the API is it possible to set any mode to be active until any arbitrary time? Again, that has relevance when thinking about apps and interfaces that could add new functionality.

                              That said, I think it's great the API that has been "disclosed" so far does what it does. I don't know what Honeywell's view is of 'experimental developers', but it seems a good thing to let others have the chance to come up with creative ideas to extend the Evohome capabilities!

                              Comment

                              • wg100
                                Automated Home Lurker
                                • Jan 2015
                                • 4

                                Originally posted by PaulB View Post
                                Well, I've finally got my system installed, and (just so happens) already had 1 comms failure within the first few hours of setting it up...

                                Still, I've managed to play with the python examples given & start pushing some metrics into Graphite



                                Only thing I've noticed, is that the thermostat.changeableValues.mode entry doesn't seem to change? I'd expect that when the stat calls for heat, that this would go from 'Off' to 'Heat' as defined under thermostat.allowedModes? Similar to how the Hot Water kit switches thermostat.changeableValues.mode to either DHWOn or DHWOff, depending on whether the schedule is running or not.

                                What I would prefer though, really, is that these values only change when demand IS requested, and not just as part of the schedule. Maybe this could exist in another key, who knows... But being able to actively monitor what zone IS requesting the heat, and when, would be a massive help!

                                Also, I use the WeatherUnderground API for the weather data. Trying to use the OpenWeatherMap one, it only seemed to update local information every few hours. WU seems to be more frequent (every 40 mins or so).
                                Are you willing or able to detail how you went about graphing your heat output/demand for a programming virgin? Really frustrated that Honeywell aren't able to provide this out of the box.

                                Comment

                                Working...
                                X