Announcement

Collapse
No announcement yet.

Thermostat API calls -- when invoked?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Thermostat API calls -- when invoked?

    Rick, Rupp, (other gurus?)

    I have a prototype plug in that is creating thermostat devices and has the thermostat API methods defined on the HSPI class. I have confirmed that I can call these methods from a script ok.

    The thermostat devices are set to MISC_THERM and the thermostat controls appear on the status page. However, none of these controls seems to call any of the API routines.

    Here are the device property settings when the device is created:
    Code:
    [FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000]// Create the device[/COLOR][/SIZE][/FONT]
    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]dev = m_objApp.ifHSApp.NewDeviceEx(objZone.Name);[/SIZE][/FONT]
    [/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000]// And then, set all the relevant information[/COLOR][/SIZE][/FONT]
    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]dev.location = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]"HVAC"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2];[/SIZE][/FONT]
    [SIZE=2][FONT=Consolas]dev.hc = m_objApp.HouseCode;[/FONT][/SIZE]
    [SIZE=2][FONT=Consolas]dev.dc = [/FONT][/SIZE][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]Convert[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].ToString(m_objApp.GetNextFreeDevCode());[/SIZE][/FONT]
    [SIZE=2][FONT=Consolas]dev.@interface = [/FONT][/SIZE][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]EnviracomApp[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].PI_NAME_SHORT;[/SIZE][/FONT]
    [SIZE=2][FONT=Consolas]dev.misc = [/FONT][/SIZE][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]HomeSeer[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].MISC_THERM;[/SIZE][/FONT]
    [SIZE=2][FONT=Consolas]dev.dev_type_string = DT_ZONE_NAME;[/FONT][/SIZE]
    [SIZE=2][FONT=Consolas]dev.iotype = [/FONT][/SIZE][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]HomeSeer[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].IOTYPE_INPUT;[/SIZE][/FONT]
    [SIZE=2][FONT=Consolas]dev.iomisc = [/FONT][/SIZE][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]Convert[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].ToString(objZone.Number);[/SIZE][/FONT]
    [/SIZE][/FONT]
    There is clearly something I am missing here to get the thermostats working -- help!!

    #2
    Ok, it gets stranger, I had the thermostat devices set up as IOTYPE_INPUT and all of the control buttons appeared on the status page.

    But reading the SDK documentation indicated that the devices need to be IOTYPE_CONTROL -- so I changed it, rebuilt the plugin, deleted the devices and restarted homeseer -- now the thermostats do NOT show the thermostat button controls on the status page.

    Scratching my head...

    Comment


      #3
      I'm having the same issue as in the first post. When I set the .misc property on a new device to MISC_THERM I get control buttons on the status page, but they don't seem to do anything.

      I've traced and HS is not calling SetIOEx, ButtonPressEx, or any of my thermostat API methods. When I don't set the .misc property then I get the standard on/off buttons, which do invoke SetIOEx.
      HS Pro 3.0 | Linux Ubuntu 16.04 x64 virtualized under Proxmox (KVM)
      Hardware: Z-NET - W800 Serial - Digi PortServer TS/8 and TS/16 serial to Ethernet - Insteon PLM - RFXCOM - X10 Wireless
      Plugins: HSTouch iOS and Android, RFXCOM, BlueIris, BLLock, BLDSC, BLRF, Insteon PLM (MNSandler), Device History, Ecobee, BLRing, Kodi, UltraWeatherWU3
      Second home: Zee S2 with Z-Wave, CT101 Z-Wave Thermostat, Aeotec Z-Wave microswitches, HSM200 occupancy sensor, Ecolink Z-Wave door sensors, STI Driveway Monitor interfaced to Zee S2 GPIO pins.

      Comment


        #4
        I've also noticed the same thing.

        I'm not sure how HS would know to call the thermostat API calls based off the buttons, as I've provided no way of telling it what index to use...

        I would expect ButtonPressEx to be called though? In my case NThermostats() doesn't appear to ever be called either. So I'm thinking these calls are only for scripts/HSTouch...

        Hopefully HS can chime in and tell us how to use these buttons.... For now I'll just keep using discrete devices

        Comment


          #5
          Yes, same thing here. NThermostats() doesn't get called. It's really not clear how HS knows what index to use when calling the Thermostat API methods, as there doesn't appear to be any way of telling HS which thermostat is associated with which index.

          HST, HELP please!
          HS Pro 3.0 | Linux Ubuntu 16.04 x64 virtualized under Proxmox (KVM)
          Hardware: Z-NET - W800 Serial - Digi PortServer TS/8 and TS/16 serial to Ethernet - Insteon PLM - RFXCOM - X10 Wireless
          Plugins: HSTouch iOS and Android, RFXCOM, BlueIris, BLLock, BLDSC, BLRF, Insteon PLM (MNSandler), Device History, Ecobee, BLRing, Kodi, UltraWeatherWU3
          Second home: Zee S2 with Z-Wave, CT101 Z-Wave Thermostat, Aeotec Z-Wave microswitches, HSM200 occupancy sensor, Ecolink Z-Wave door sensors, STI Driveway Monitor interfaced to Zee S2 GPIO pins.

          Comment


            #6
            I'll ask Rick to have a look at this thread for you guys.
            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

            Comment


              #7
              Thanks Rupp, it's much appreciated.
              HS Pro 3.0 | Linux Ubuntu 16.04 x64 virtualized under Proxmox (KVM)
              Hardware: Z-NET - W800 Serial - Digi PortServer TS/8 and TS/16 serial to Ethernet - Insteon PLM - RFXCOM - X10 Wireless
              Plugins: HSTouch iOS and Android, RFXCOM, BlueIris, BLLock, BLDSC, BLRF, Insteon PLM (MNSandler), Device History, Ecobee, BLRing, Kodi, UltraWeatherWU3
              Second home: Zee S2 with Z-Wave, CT101 Z-Wave Thermostat, Aeotec Z-Wave microswitches, HSM200 occupancy sensor, Ecolink Z-Wave door sensors, STI Driveway Monitor interfaced to Zee S2 GPIO pins.

              Comment


                #8
                To recap the issues:
                1) setting device.misc to MISC_THERM adds thermostat control buttons to the status page, but they don't appear to call any methods

                2) There doesn't appear to be any documented method for associating a thermostat index (which is required by the thermostat API) with a device. How does a thermostat plugin know which device to operate on?

                3) NThermostats never seems to be called, or in my experience, any of the other thermostat API specific methods.

                Hopefully Rick can shed some light on this as these issues are keeping me from completing my WiFi thermostat plugin.
                HS Pro 3.0 | Linux Ubuntu 16.04 x64 virtualized under Proxmox (KVM)
                Hardware: Z-NET - W800 Serial - Digi PortServer TS/8 and TS/16 serial to Ethernet - Insteon PLM - RFXCOM - X10 Wireless
                Plugins: HSTouch iOS and Android, RFXCOM, BlueIris, BLLock, BLDSC, BLRF, Insteon PLM (MNSandler), Device History, Ecobee, BLRing, Kodi, UltraWeatherWU3
                Second home: Zee S2 with Z-Wave, CT101 Z-Wave Thermostat, Aeotec Z-Wave microswitches, HSM200 occupancy sensor, Ecolink Z-Wave door sensors, STI Driveway Monitor interfaced to Zee S2 GPIO pins.

                Comment


                  #9
                  All is answered in the Plug-In SDK, which is available in the Updater.

                  Thermostat DEVICES are dead. Done. Buried. They are not going to be supported at all in HS3 and only have script based support in HS2 right now. When you set the devices' MISC property to include the bit for thermostat, you are trying to create a thermostat device.

                  The PLUG IN returns a value when the call is made to its "Capabilities" property that tells HomeSeer what its capabilities are. CA_IO for an IO plug-in, CA_X10 for an X-10 plug-in, CA_IR for an Infrared plug-in, CA_THERM <--- for a thermostat plug-in, and CA_MUSIC for a music plug-in - you can OR multiples of those together if the plug-in does several functions. Typically a thermostat plug-in would be CA_IO and CA_THERM or'd together.

                  The full API is described in the SDK, and in your scripts directory (or find a copy on this message board) is the thermostat enumeration and test script, which will test a thermostat plug-in to see if it is representing/providing thermostat information correctly. (It tests by reading information only - does not attempt to control test anything.)

                  So your plug-in, without any devices, can be a thermostat plug-in. Now, you can create a custom web page to provide an interface to the thermostats, or you may choose to create devices to represent the thermostats. If you do that, you can create a single device and add the buttons to it for each mode, fan mode, hold mode, etc. or you can create a separate device for each functional area. In each case, the plug-in SDK talks about adding buttons to a device, control drop-down list options, value/status pairs, etc. to create how that device will be rendered by HomeSeer and what control options will appear.

                  We also got your email to the comment area of our website about this plug-in. There is a contact point in the SDK to get started with a new plug-in and get it registered so you can get a license. When you are developing a plug-in like this, you get access to us via email so we can help you with questions you have about the SDK. So, please get the SDK loaded and start down that path and I think things will start moving very fast for you!

                  The plug-in SDK was written before many of the new versions of browsers, so use Internet Exploder to view it as it appears everything (menus, table of contents, search, etc.) still works fine with that browser.
                  Regards,

                  Rick Tinker (a.k.a. "Tink")

                  Comment


                    #10
                    Thank you for the update Rick. I am using the SDK to create my devices as you specified. What wasn't clear to me was that thermostat devices were dead. I'll add the control buttons manually.
                    HS Pro 3.0 | Linux Ubuntu 16.04 x64 virtualized under Proxmox (KVM)
                    Hardware: Z-NET - W800 Serial - Digi PortServer TS/8 and TS/16 serial to Ethernet - Insteon PLM - RFXCOM - X10 Wireless
                    Plugins: HSTouch iOS and Android, RFXCOM, BlueIris, BLLock, BLDSC, BLRF, Insteon PLM (MNSandler), Device History, Ecobee, BLRing, Kodi, UltraWeatherWU3
                    Second home: Zee S2 with Z-Wave, CT101 Z-Wave Thermostat, Aeotec Z-Wave microswitches, HSM200 occupancy sensor, Ecolink Z-Wave door sensors, STI Driveway Monitor interfaced to Zee S2 GPIO pins.

                    Comment


                      #11
                      Originally posted by Rick Tinker View Post
                      All is answered in the Plug-In SDK, which is available in the Updater.

                      Thermostat DEVICES are dead. Done. Buried. They are not going to be supported at all in HS3 and only have script based support in HS2 right now. When you set the devices' MISC property to include the bit for thermostat, you are trying to create a thermostat device.

                      The PLUG IN returns a value when the call is made to its "Capabilities" property that tells HomeSeer what its capabilities are. CA_IO for an IO plug-in, CA_X10 for an X-10 plug-in, CA_IR for an Infrared plug-in, CA_THERM <--- for a thermostat plug-in, and CA_MUSIC for a music plug-in - you can OR multiples of those together if the plug-in does several functions. Typically a thermostat plug-in would be CA_IO and CA_THERM or'd together.

                      The full API is described in the SDK, and in your scripts directory (or find a copy on this message board) is the thermostat enumeration and test script, which will test a thermostat plug-in to see if it is representing/providing thermostat information correctly. (It tests by reading information only - does not attempt to control test anything.)

                      So your plug-in, without any devices, can be a thermostat plug-in. Now, you can create a custom web page to provide an interface to the thermostats, or you may choose to create devices to represent the thermostats. If you do that, you can create a single device and add the buttons to it for each mode, fan mode, hold mode, etc. or you can create a separate device for each functional area. In each case, the plug-in SDK talks about adding buttons to a device, control drop-down list options, value/status pairs, etc. to create how that device will be rendered by HomeSeer and what control options will appear.

                      We also got your email to the comment area of our website about this plug-in. There is a contact point in the SDK to get started with a new plug-in and get it registered so you can get a license. When you are developing a plug-in like this, you get access to us via email so we can help you with questions you have about the SDK. So, please get the SDK loaded and start down that path and I think things will start moving very fast for you!

                      The plug-in SDK was written before many of the new versions of browsers, so use Internet Exploder to view it as it appears everything (menus, table of contents, search, etc.) still works fine with that browser.
                      Thanks Rick. Was aware of the SDK, wasn't aware the thermostat devices were obsolete (perhaps should be mentioned in the SDK?). I suspected these devices would not work as hoped here though.

                      The reason I wanted them to work however, is correct me if I'm wrong but there is no way currently to mimic the textbox/set functionality that these thermostats have (from device status)?

                      Comment


                        #12
                        Originally posted by AllanMar View Post
                        Thanks Rick. Was aware of the SDK, wasn't aware the thermostat devices were obsolete (perhaps should be mentioned in the SDK?). I suspected these devices would not work as hoped here though.

                        The reason I wanted them to work however, is correct me if I'm wrong but there is no way currently to mimic the textbox/set functionality that these thermostats have (from device status)?
                        That is correct, but we are already looking at that functionality for HS3 amongst some other new capabilities. However, not having the text box is only an issue when you do not know the thermostat and the range of values. Some thermostats accept decimal points, some do not, and all have a fixed range of high and low values that they can have. Therefore, you can add value/status pairs (as a range) to a device and that will result in the temperature selection appearing as a drop-down list of values to choose from, which reduces the chance of error on the entry and the amount of data validation that your plug-in will have to perform.

                        The other option available to you is to have the current temperature and the current temperature setpoint(s) displayed in a device, but leave the temperature setting to either a plug-in created event action or a custom web page created by the plug-in.


                        Thermostat DEVICES are not referenced in the plug-in SDK except in the copy of the device MISC bit settings provided in Appendix A. They still work in HS2, but there is much more to them than setting that bit. I would describe it in detail except that as I mentioned, it is being completely removed in HS3. The other advantage to not using a thermostat device is that it required that ONE device to show everything about the thermostat and it allowed all forms of control to the thermostat on a single device. It is much more practical to create a device for each functional area of thermostat - e.g. a thermostat mode device, a thermostat setpoint device, a thermostat fan mode device, and then devices that hold status information only such as operating mode and current temperature. This is what we are going to be doing in HS3 w/r/t Z-Wave thermostats - the Z-Wave thermostat plug-in will be going away in HS3.
                        Regards,

                        Rick Tinker (a.k.a. "Tink")

                        Comment


                          #13
                          are there still going to be thermostat plug ins at all?? I rely completely on the RCS serial plugin basically for the complete operation of a basic part of my HVAC... I use an RCS zone controller.. and the .NET plugin for it does a decent job... but all this talk of changing or doing away with big parts of the API is scary as I have a rather large external program that runs alongside homeseer using the T-stat API extensively to handle my HVAC... in the next couple years im plannng on weening all that control to dedicated embedded boxes and having HS just be the interface to the HVAC but im not there yet.. and dont want to get stuck with an unsupported version of HS by not being able to upgrade to 3 when the time comes.. so im hoping the API, the The RCS serial plugins and such still remain a part of HS...
                          -Christopher
                          PerfecTemp - the Most advanced HVAC system I've ever Built - and its in my House

                          Comment


                            #14
                            Cadillac - who exactly said that the thermostat API was going away? I did not say that.
                            Regards,

                            Rick Tinker (a.k.a. "Tink")

                            Comment


                              #15
                              Originally posted by Rick Tinker View Post
                              Cadillac - who exactly said that the thermostat API was going away? I did not say that.
                              Rick, I'll admit that I was left wondering that myself after your post. In my case at least, it's more a case of not 100% understanding the HS SDK. I didn't know if your last post meant the thermostat API was going away or if you just meant there was a better way to accomplish the task. I understand now what you meant. I'll be modifying my thermostat plugin to incorporate function-based devices now. Thank you for the guidance.
                              HS Pro 3.0 | Linux Ubuntu 16.04 x64 virtualized under Proxmox (KVM)
                              Hardware: Z-NET - W800 Serial - Digi PortServer TS/8 and TS/16 serial to Ethernet - Insteon PLM - RFXCOM - X10 Wireless
                              Plugins: HSTouch iOS and Android, RFXCOM, BlueIris, BLLock, BLDSC, BLRF, Insteon PLM (MNSandler), Device History, Ecobee, BLRing, Kodi, UltraWeatherWU3
                              Second home: Zee S2 with Z-Wave, CT101 Z-Wave Thermostat, Aeotec Z-Wave microswitches, HSM200 occupancy sensor, Ecolink Z-Wave door sensors, STI Driveway Monitor interfaced to Zee S2 GPIO pins.

                              Comment

                              Working...
                              X