Announcement

Collapse
No announcement yet.

RCS variables for use in a script?

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

    RCS variables for use in a script?

    What are the RCS Serial variables and the syntax for using them in scripts? I want to use these to write out the temp and setpoint information to some virtual devices and I can't find any documentation on it? Thanks.

    #2
    I would like to do the same thing, but I think the only way to do it is to parse each desired piece of data out of the device status information. All of the data is lumped together in this one set. Rich could confirm this.

    It might be different for a zoned system. I don't have zones.

    We might be able to accomplish this by setting up an event for each piece of data and then triggering on any change in the value to update a virtual device.

    Comment


      #3
      This thread has the scripting for the thermostat plugins posted in it.

      jim

      Comment


        #4
        Thanks - ironically I started that thread over a year ago but couldn't find it this time around!

        Another question - GetCurrentMode is only returning a 0, regardless of the mode setting on my thermostat. I am presuming that 0 is HEAT and 1 COOL?

        I set it to COOL and then wait 60 seconds - check the status of the thermostat in the Homeseer web interface and it confirms that it is in COOL mode, but GetCurrentMode only returns a 0?

        At the same time GetModeSet is returning 1 when the thermostat is set to HEAT. According to the docs it should be returning a 2. I am running the latest version of the plugin. Does anyone have this working successfully and can offer advice? Thanks.

        Comment


          #5
          GetCurrentMode is the "running' state of the system. If it's set to COOL but not running then it will return 0 for OFF. GetModeSet is what mode the thermostat is set to. I think you're misreading the note at the bottom of the table 0=OFF and 1=Heat, etc.

          I'll attach the script I'm using. Rename the file with a "vb" extension. You'll have to change all the addresses for variables. There are also a couple of extra virtual devices that track cooling or heating status (You can comment them out if not needed- look for the byName functions to find them. I have a heat pump so a couple different modes are heating- this simplified logic elsewhere. )

          EDIT: posted an updated script later in the thread.
          Last edited by jsteed; August 1, 2009, 11:35 AM.

          Comment


            #6
            jsteed,

            Thanks for posting that script! That will make it easy when I get to this project.

            Comment


              #7
              Thanks, I checked through your code and I am still confused. Checking your case statements for GetCurrentMode and GetModeSet it appears that they both return 0 or Off when the system is not running. I am trying to set a flag for current state of the system regardless of whether it is running or not. Do I have to wait for it the system to kick in and check the status at that point? Thanks.

              Comment


                #8
                I threw a couple of writelogs in the script. Right now it is returning
                hs.writelog("RCS","GetModeSet " & RCS.GetModeSet(1))
                hs.writelog("RCS","GetCurrentMode " & RCS.GetCurrentMode(1))

                12/14/2008 8:20:29 PM ~!~RCS~!~GetModeSet 1
                12/14/2008 8:20:29 PM ~!~RCS~!~GetCurrentMode 0

                which is correct. The thermostat is set to HEAT (1) and the system is OFF (0) at the moment.

                My thermostat is a TR16, perhaps you have a differnet model that is returning something else?
                jim

                Comment


                  #9
                  What do the values for GetModeSet equate to? 1 is Heat, 2 is Cool? I can't seem to return a 2 when I switch to cool.

                  Comment


                    #10
                    Yes, I just switched mine from HEAT to COOL to HEAT and got hte following
                    12/14/2008 8:55:49 PM ~!~RCS~!~GetModeSet 1
                    12/14/2008 8:55:49 PM ~!~RCS~!~GetCurrentMode 0
                    12/14/2008 8:56:09 PM ~!~RCS~!~GetModeSet 2
                    12/14/2008 8:56:09 PM ~!~RCS~!~GetCurrentMode 0
                    12/14/2008 8:56:29 PM ~!~RCS~!~GetModeSet 2
                    12/14/2008 8:56:29 PM ~!~RCS~!~GetCurrentMode 0
                    12/14/2008 8:56:49 PM ~!~RCS~!~GetModeSet 1
                    12/14/2008 8:56:49 PM ~!~RCS~!~GetCurrentMode 0

                    What is your polling rate set to - sometimes it seems like the return values lag until after a poll and other times it seems to happen immediately.
                    jim

                    Comment


                      #11
                      I set up your script to run. I created devices and edited the script to have the correct device id. I'm only getting heat and cool setpoints, the operating mode and currentmode are not populating, but there are no errors in the log either.

                      are there any areas I'm supposed to edit the device ID other than at the top?
                      Plugins:
                      BLLogMonitor, BLGarbage, BLBackup, BLOutGoingCalls, BLUps, BLRfid, JvEss, DooMotion, Applied Digital Ocelot, AC RF Processor, UltraMon, PJC AVR 430, UPB, Rain8net, DSC Panel, JRiver Media center, Windows Media Player, SageMediaCenter, SnevlCID, MCSTemperature.

                      Comment


                        #12
                        They have it in the SDK.

                        Set Properties or Methods

                        For compatibility with older COM plug-ins, VB.NET plug-ins should return a Short Integer when an Integer return is called for.
                        Mode value codes are listed here.

                        Property / Function Name
                        Parameters
                        Return Data Type
                        Description
                        CmdSetHeat


                        • Thermostat number (NThermostats) as Integer
                        • Temperature as Double
                        • Temperature Sensor (NTemps) as Integer

                        Integer
                        Set the heat setpoint temperature.
                        CmdSetCool
                        • Thermostat number (NThermostats) as Integer
                        • Temperature as Double
                        • Temperature Sensor (NTemps) as Integer

                        Integer
                        Set the cool setpoint temperature (If supported)
                        CmdSetMode

                        • Thermostat number (NThermostats) as Integer
                        • Mode as Integer
                        • Temperature Sensor (NTemps) as Integer

                        Integer
                        Set the thermostat operating mode.
                        CmdSetFan
                        • Thermostat number (NThermostats) as Integer
                        • Mode as Integer
                        • Temperature Sensor (NTemps) as Integer

                        Integer
                        Set the thermostat fan operating mode.
                        CmdSetHold
                        • Thermostat number (NThermostats) as Integer
                        • Mode as Integer
                        • Temperature Sensor (NTemps) as Integer

                        Integer
                        Set the thermostat hold mode. (If supported)


                        ~Bill

                        Comment


                          #13
                          Here are some .vb code snippets:

                          dim rcs
                          rcs=hs.plugin("RCS Serial Thermostats")
                          in_now_str = rcs.gettemp(1,1)
                          sph_feedback_str = rcs.getheatset(1,1)
                          spc_feedback_str = rcs.getcoolset(1,1)


                          ~Bill

                          Comment


                            #14
                            Link for SDK: http://homeseer.com/support/homeseer...lug-In_SDK.htm


                            ~Bill

                            Comment


                              #15
                              Originally posted by completelyhis View Post
                              I are there any areas I'm supposed to edit the device ID other than at the top?
                              No, other then commenting out the "byName" functions in SetDeviceThermMode.

                              You may need to add the zone to the function calls with your thermostat - in the other thread you were using GetXX(1,0) where in this script the calls are GetXX(1) form.

                              You can add some writelogs within the function to see what is getting passed through.

                              Comment

                              Working...
                              X