Announcement

Collapse
No announcement yet.

RCS variables for use in a script?

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

    #16
    Keep in mind, if you have a zone controller, then the 'get' statements will need two parameters. If you don't have a zone controller, then you only need to pass in one parameter.
    HS: 2.5.0.60
    Environment: Virtual XP as guest in VMWare Server running under Win 7
    Plug-ins: MLHSPlugin|RCS Serial Thermostat|UltraLog|UltraMon|
    Misc: 303 Devices, 313 Events, 68+ Scripts

    HSeer: 3.0.0.54
    Environment: Virtual XP as guest in VMWare Server running under Win 7
    Plug-ins: BLGData|BLRF|BLRadar|BLRandom|BLSpeech
    UltraM1G3|UltraECM3|UltraMon3|UPBSpud|Z-Wave
    Misc: 148 Devices, 116 Events, 9+ Scripts (so far, still converting)

    Comment


      #17
      commenting out the "byname" sections did the trick. thanks!
      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


        #18
        Ok, sorry to be a pest, but I think i need to modify the script, but I'm script challenged.

        What I'm trying to do is be able to trigger an event IF the system has been in a certain mode for more than XX minutes. I don't see anyway to do that so far.

        If i use the device ID's populated with this script, the event conditions are only the stock "on/off" variety (would need "changed to" not just "is" from what I understand of things.)

        If I use the RCS triggers, it only says if the mode is XX, not if the mode has been XX for XX minutes. I even thought about using a flag virtual device that would turn on, then use that device for the timer, but again, there is nothing that would turn that device on ONCE with a change, but rather repeatedly whenever the event runs.

        I suppose I could use the "can't retrigger for XX minutes" but that doesn't feel like the right way, my gut tells me something would go wrong.

        thanks for all the help everyone!

        Ian
        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


          #19
          Ian,
          I think this will get you what you want.

          within each function near the end are two lines that set the value and the string - add a third line before those to set the status of the device. The three lines shoudl look like this
          hs.SetDeviceStatus(devcode,2) 'turn it on and reset timer
          hs.SetDeviceString(devcode, str)
          hs.SetDeviceValue(devcode, CInt(value))

          Turning it on each time will reset the timer - you can then trigger the event by condition 'has been ON for' AND value = x (where x is the mode you want to match- i.e. 0=off, 1=heat, etc.). You will probably want to use 'on for exactly' and 'can't retrigger for 1 minute' or the condition will just keep triggering.

          See if that works - if not we can work on it some more.
          jim

          Comment


            #20
            Z-Wave Stat

            Will any of this work with the RCS Z-wave stat? I have an RCS #43 and would like to use scripting also.

            Jack

            Comment


              #21
              Jack,
              I think it should work. The script uses the calls from the Thermostat API, so as long as the plugin supports the Thermostat API, it seems that it should work. You'll have to edit the plugin name though to get the correct plugin object.

              jim

              Comment


                #22
                Jim,
                I appologize for needing things spelled out so simply. I copied those three lines and pasted them into the part of the script you described (I think). I tried it for the current mode function and one other, but it didn't seem to have any affect on the device either way.

                am i missing something in the implimentation?
                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


                  #23
                  When you look at the HS status page for the devices is the "last change" column updating? It shoudl reflect the last time the device changed.

                  for reference this is how the current mode function would look
                  Code:
                     Sub SetDeviceCurrentMode(ByVal devcode As String, ByVal value As Integer)
                          Dim str As String
                          Dim current As Integer
                          current = hs.DeviceValue(devcode)
                          If current <> value Then
                              Select Case value
                                  Case 0
                                      str = "Off"
                                  Case 1
                                      str = "Heat"
                                  Case 2
                                      str = "Cool"
                                  Case 3
                                      str = "Auto"
                                  Case 4
                                      str = "EMHT"
                                  Case Else
                                      str = "???"
                              End Select
                              hs.SetDeviceStatus(devcode, 2) 'make sure it's on
                              hs.SetDeviceString(devcode, str)
                              hs.SetDeviceValue(devcode, CInt(value))
                          End If
                      End Sub
                  jim

                  Comment


                    #24
                    Jim,

                    Thanks. the content of the "sub" line was different than mine, so I changed it and it works!

                    Thanks again,

                    Ian
                    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


                      #25
                      Now that I think about it - I had cleaned up some items in the script after I posted it (so that I could edit it under tenholde's scripting environment). I'll clean a couple of things up and post a revised version either tonight or tomorrow as there are probably some other similar little things that might bite.

                      jim

                      Comment


                        #26
                        Here is an updated version of the script.
                        What used to be the "byName" functions listed above is in a separate sub now and is already commented out.
                        You should just have to change the addresses to work with your system.

                        Save the file and rename the file to have a .vb extension.

                        jim
                        Attached Files

                        Comment


                          #27
                          Originally posted by jsteed View Post
                          Here is an updated version of the script.
                          What used to be the "byName" functions listed above is in a separate sub now and is already commented out.
                          You should just have to change the addresses to work with your system.

                          Save the file and rename the file to have a .vb extension.

                          jim
                          Trying to understand how the script works and had a question about the following line of code. I understand that the GetTemp returns a double, but could someone explain the Convert Integer and Convert String and multiply by 10. This results in device V50 value being 710 if the temp is 71. Is that to be expected?

                          SetDevice("V50", CStr(CInt(RCS.GetTemp(1)) * 10))

                          Comment


                            #28
                            Originally posted by mhog View Post
                            Trying to understand how the script works and had a question about the following line of code. I understand that the GetTemp returns a double, but could someone explain the Convert Integer and Convert String and multiply by 10. This results in device V50 value being 710 if the temp is 71. Is that to be expected?

                            SetDevice("V50", CStr(CInt(RCS.GetTemp(1)) * 10))
                            This is a call to the SetDevice Sub. Device Values are stored as integers so multipling by 10 allows the variable to be fully stored if it's a double. Ie 99.6 is stored as 996
                            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                            Comment


                              #29
                              Thanks Rupp, that makes perfect sense.

                              Comment

                              Working...
                              X