Announcement

Collapse
No announcement yet.

Variable setting

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

    Variable setting

    Can anyone tell me how to set Ocelot variables with sliders in HS touch?

    #2
    Originally posted by Roby View Post
    Can anyone tell me how to set Ocelot variables with sliders in HS touch?
    I am out on a job at the moment. I think you would have to use scripting to achieve that. There might be an easier way, but off the top of my head:

    1. Create a virtual device that the slider sets values to or "tracks".
    2. Create an event that triggers any time the above virtual device changes.
    3. The event would run a GTS CPUXA script and use the value of the virtual device to set the variable.

    That should work Roby. There is an example of the set variable scripting in the help file.

    Bruce

    Comment


      #3
      Originally posted by bbowser View Post
      I am out on a job at the moment. I think you would have to use scripting to achieve that. There might be an easier way, but off the top of my head:

      1. Create a virtual device that the slider sets values to or "tracks".
      2. Create an event that triggers any time the above virtual device changes.
      3. The event would run a GTS CPUXA script and use the value of the virtual device to set the variable.

      That should work Roby. There is an example of the set variable scripting in the help file.

      Bruce
      Bruce, Many thanks for your reply. I never used scripts and I do not understand how to do it. I took a look at the example but I don't know how to use the value of virtual device in it.

      Comment


        #4
        Originally posted by Roby View Post
        Bruce, Many thanks for your reply. I never used scripts and I do not understand how to do it. I took a look at the example but I don't know how to use the value of virtual device in it.
        Roby,
        If you can get me the variable device and the virtual device's reference number, I will send you a script.

        Bruce

        Comment


          #5
          Originally posted by bbowser View Post
          Roby,
          If you can get me the variable device and the virtual device's reference number, I will send you a script.

          Bruce
          Virtual device Reference ID is 964, Variable Reference ID is 613.

          Roberto

          Comment


            #6
            Code:
            Sub Main(parm as object)
            
            ' get a reference to the plugin 
            Dim plugin = New HomeSeerAPI.PluginAccess(hs, "GTS CPUXA", "") 
            Dim arr(1) As Object 
            
            arr(0) = 613  'Variable or Output Device Ref Number
            arr(1) = hs.DeviceValue(964) 'Device value (For relays 1 = on / 0 = off) (For vars 0 thru 65535)
            
            ' call the function and set the value
            plugin.PluginFunction("CPUXA_Set", arr)
            
            End Sub
            Copy and paste the above into an empty text file, rename the text file to anythingyouwant.vb

            Put the above vb file in your HS3/Scripts folder.

            Comment


              #7
              Originally posted by bbowser View Post
              Code:
              Sub Main(parm as object)
              
              ' get a reference to the plugin 
              Dim plugin = New HomeSeerAPI.PluginAccess(hs, "GTS CPUXA", "") 
              Dim arr(1) As Object 
              
              arr(0) = 613  'Variable or Output Device Ref Number
              arr(1) = hs.DeviceValue(964) 'Device value (For relays 1 = on / 0 = off) (For vars 0 thru 65535)
              
              ' call the function and set the value
              plugin.PluginFunction("CPUXA_Set", arr)
              
              End Sub
              Copy and paste the above into an empty text file, rename the text file to anythingyouwant.vb

              Put the above vb file in your HS3/Scripts folder.
              Bruce,
              It works perfectly. Many thanks.
              Roberto

              Comment


                #8
                Excellent Roby

                Comment

                Working...
                X