No announcement yet.

Using thermostat device status

  • Filter
  • Time
  • Show
Clear All
new posts

  • Using thermostat device status

    I know this has been discussed in at least one other thread, but I just couldn't figure out how from those threads.

    I'm trying to use the information which is stored in the text string in the thermostat status field. Currently, it simply reads "Temperature:75F Setpoint(Heat): 75 ... etc.". I would like to update a set of devices with the value of each of those variables, current temperature, setpoint, mode and fan status. The purpose is so that I can pull this data into Main Lobby.

    First, am I approaching this the right way? Is there a better way to control a z-wave thermostat from Main Lobby through HS?

    Second, assuming that I'm on the right path, how do I set the event up? If I need a script, what do the scrips look like for these four functions?

    Any help is much appreciated.

  • #2
    have you setup devices on the Devices tab of the HAI plug-in? once you do this (the plug-in will maintain the values) and you should be able to setup events to do what you want

    HS3 Pro
    Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway
    Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 (by Kirby) | Ultra1Wire3 | RFXCOM | NetCAM | MyQ | BLRadar | BLDenon | Jon00 Charting
    Platform: HP h8-1360t, Windows Server 2012 R2, i7-3.4GHz, 16GB memory


    • #3
      Originally posted by mnsandler View Post
      have you setup devices on the Devices tab of the HAI plug-in? once you do this (the plug-in will maintain the values) and you should be able to setup events to do what you want
      It's actually the RCS TZ16 z-wave thermostat using the z-wave thermostat plug-in in HS.

      Any way I can do something similar?


      • #4

        Not sure how familiar you are with scripting, but check out the Thermostat API. The calls are documented here:

        But you can also check out the SDK for more info on this. The thermostat ID for each unit is available on the configuration page.
        -RJ (HomeSeer Tech)


        • #5
          Originally posted by RJ View Post

          Not sure how familiar you are with scripting, but check out the Thermostat API. The calls are documented here:

          But you can also check out the SDK for more info on this. The thermostat ID for each unit is available on the configuration page.
          I did see that thread, but since I'm completely unfamiliar with scripting I will definetly need a little nudge to know how to use the data. I've been skimming through the help documentation in HS to see if I can figure it out, but it's a little hard without any practical examples.

          I was hoping there was a script that attempts to do something similar, that I can at least use to reverse engineer the scripts that I need. Seems like a few people out there have dealt with the same issue and I'm still hoping that someone could share a script or two with me that might give me something to work with.

          I've never used the SDK. Is this the dev kit for HS plugins?

          Thanks for the pointers RJ ... I appreciate the help.


          • #6
            Hi Richard-

            Let me give you an example to get you started:
            Sub Main 
            Dim Mode 
            Dim CSP
            Dim HSP
            Dim Fan
            Dim Temp
            Dim pi
            set pi = hs.Plugin("ZWave Thermostats")
            Mode = pi.GetModeSet(1) ' This gets Thermostat 1, indices are available on the config page
            CSP = pi.GetCoolSet(1)
            HSP = pi.GetHeatSet(1)
            Fan = pi.GetFanMode(1)
            Temp = pi.GetTemp(1)
            ' Mode is an enum with these values:
            ' 0 = Off
            ' 1 = Heat
            ' 2 = Cool
            ' 3 = Auto
            ' 4 = Aux/EMHT
            Select case Mode
            case 0
            Mode = "Off"
            Case 1
            Mode = "Heat"
            Case 2 
            Mode = "Cool"
            Case 3 
            Mode = "Auto"
            Case 4
            Mode = "EMHT"
            end select
            ' Fan is 1 for on, 0 for off/auto
            If Fan = 1 then Fan = "On"
            If Fan = 0 then Fan = "Off/auto"
            ' You can now use the above variables to interface with mainlobby.
            ' I'm afraid you're out of luck here though, I don't know the syntax for ML.
            End Sub
            -RJ (HomeSeer Tech)


            • #7
              RJ - Thank you so much. I won't have time to look at this until the weekend, but it looks like something I can figure out (maybe with a question or two). I think I have the ML side figured out.

              I'll let you know how it goes either way.

              Again, thank you.


              • #8
                Just tried the script out and after a little tinkering got it to work.

                What I'm doing is using the script to populate status changes for five virtual devices that I then pull into the MLHS Plugin.

                I added the following lines to the end of the script (where m3 through m7 are the relevant device codes):
                hs.SetDeviceString "m3",Mode
                hs.SetDeviceValue "m4",CSP
                hs.SetDeviceString "m4",CSP
                hs.SetDeviceValue "m5",HSP
                hs.SetDeviceString "m5",HSP
                hs.SetDeviceString "m6",Fan
                hs.SetDeviceValue "m7",Temp
                hs.SetDeviceString "m7",Temp

                Of course, there is really no reason to duplicate both the device value and string ... I just chose to do it this way because both get pulled into ML Server. It also took me a little while before I figured out that you couldn't load Mode or Fan into the device value.

                And then I just made sure that I subscribed the devices in the MLHS Plugin.

                I think the status returned in my case for Fan and Mode is a little different than what's in the above script, but I'll figure that out with a little playing around. Are the return values for Fan and Mode completely universal for every thermostat? Or could it be that my TZ16 returns slightly different results? (I'm primarily thinking about Fan)

                Thank you so much for your help RJ. Hopefully this will be usefull in the future for other scripting newbies.


                • #9
                  Hi Richard-

                  The values are the same on the API. IF there is a problem, let me know and I will see what needs to be done to fix it.
                  -RJ (HomeSeer Tech)


                  • #10
                    Nah ... works like a charm ... my confusion.



                    • #11
                      More confusion

                      I am still a bit (OK, a lot) confused.

                      Can you please help with the following questions:

                      1. I did use the updater to install the zwave thermostat plugin but did not notice any changes in HS. Since I could not find any documentation, I am not sure what it actually does.

                      2. I tried to run the script in this thread and got an error message in the log sayin "object required hs.plugin (...). What is that? Also, am I supposed to put in my thermostat name in the quotes?

                      3. Looking at the logic, since this script will run every time there is a change in the status of the device, what happens if the system is restarted? Will I have to make sure I run this script the first time I load ML and I should be fine after that?

                      4. I think I know the answer to this question but thought I would ask again on this forum. To change the temp/status of the thermostat, I have to create 4 events that would change the temp up/down for both cold and heat. I would then run these events from ML using the MLhs plugin? What about if I wanted to change the status? How do I change the mode? The same way or is there a direct command I could use?

                      I would greatly appreciate any help you can give me.


                      • #12
                        Let me see if I can help ... anyone else with more knowledge jump in anytime ...

                        1 - which thermostat model do you have? have you added it to your network? and gone through the process of adding the device to HS? after you downloaded the thermostat plugin, did you restart HS?

                        2 - I'm guessing the error is related to the problem in 1 ... and also, you should not have to change the portion inside the quotes of the set pi = hs.Plugin("ZWave Thermostats") command line, since it references the plugin (not the device)

                        3 - I have not actually had any success in getting the script to run based on a status or value change in my thermostat device ... right now, I'm simply running the script every four minutes, which is the same as my polling period for my thermostat. I actually tried to set the polling period for the thermostat to 1 second, and HS didn't seem to mind, so I'm sure I could figure out a way to trigger the even based on change, but no luck for me so far ... anyone have any tips?

                        4 - I've actually put the project of using ML to control my thermostat on hold. For now, I'm simply pulling in thermostat status, temperature status in the different rooms I have sensors and I can execute any of my events that control temps (for example, I have specific events that run regularily to change setpoints based on time of day). There is obviously a way to use ML, but I've moved on until I have a little more time ... the biggest obstacle was figuring out how to make the display in ML change the temp every time I adjusted the temperature up/down a degree (the time delay of the thermostat update made this impossible).


                        • #13
                          Still need help please

                          Thanks Richardfj,

                          1. I have the camstat that I got from HS. I believe it is zt000 or somethig like that. Yes, I had it working on the network and connected to HS. But, I did not have the plugin enabled. Thanks to RJ, I did that and restarted so that it is now enabled and working.

                          2. I thought that enabling the plugin would solve this but it has not. I have to ask RJ again. Thanks for clearing up the text in the quote question.

                          3. Here is where it gets interesting a bit. The script was working with the status change when I had the zwave thermostat as a standard unit on the devices page. However, once I enabled the zwave interface plugin, I started having the same problem you are describing. I hope this will help the HS techs figure it out. I could just have it poll every few minutes for now (once I get the script to actualy work)

                          4. Once I get the script to work and get the variables, I will need a way to access them from ML. I am not sure how I can do that using MLHS plugin. I will have to ask Krumpy. I would like to see the temp the way you have done it but can not yet.



                          • #14
                            next error

                            I just got past the object required error. I checked and it was because I had changed the text in the quotes. However, now I am getting

                            Running script, script run or compile error in file: thermostatvars.vbs13:Type mismatch: 'Fan' in line 41 More info: Type mismatch: 'Fan'
                            Any ideas? Do I need a separate variable like fantxt="on" or something?



                            • #15
                              Verify that the thermostat id is the right one ... if you click through on the config page ... there should be a line at the bottom saying something like "id number for scripting purposes ..."

                              that number is the one you'll want to use inside the paranteses ... in RJ's example he uses thermostat 1 ...