Can anyone tell me how to set Ocelot variables with sliders in HS touch?
Announcement
Collapse
No announcement yet.
Variable setting
Collapse
X
-
Originally posted by Roby View PostCan anyone tell me how to set Ocelot variables with sliders in HS touch?
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
-
Originally posted by bbowser View PostI 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
-
Originally posted by Roby View PostBruce, 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.
If you can get me the variable device and the virtual device's reference number, I will send you a script.
Bruce
Comment
-
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
Put the above vb file in your HS3/Scripts folder.
Comment
-
Originally posted by bbowser View PostCode: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
Put the above vb file in your HS3/Scripts folder.
It works perfectly. Many thanks.
Roberto
Comment
Comment