Returns a List of device refs that are in the Category with a name of CatName. GetRefsB圜ategoryName(hs4, CatName as String) as List(Of Integer) If there is an error, a message is written to the HS4 log.ĭim Cats As (Of String)Ĭats = GetCategoriesByRef(hs4, 174) 'a list of all Categories for device 174 Returns Nothing if hs4 is invalid, returns an empty list if either the device is not included in any Category or if there is an error. Returns a List of strings that contains the names of all of the Categories in which the specified device is included. GetCategoriesByRef(hs4, DevRef as Integer) as List(Of String) For many devices ToggleDeviceOnOff(hs, 174) would do the same as ToggleDevice(hs, 174, 0, 100).ĭim s1 As String = ToggleDevice(hs, 174, 0, 100) 'toggle device with ref 174 Returns "" if OK, or Error Message if something failed. Both Value1 and Value2 must be valid as defined for the devices' Status/Graphics pairs. Using CAPI, if this device has a value of Value1, it will set its value to Value2 otherwise, it will set its value to Value1. ToggleDevice(hs, DevRef as Integer, Value1 as Double, Value2 as Double) as String Returns "" if OK, or Error Message if something failed.ĭim s1 As String = ToggleDeviceOnOff(hs, 174) 'toggle device with ref 174 The device must have the ControlUse_Off and ControlUse_ON properties defined. Using CAPI, if this device is OFF, it will turn it ON otherwise, it will turn it OFF (i.e. ToggleDeviceOnOff(hs, DevRef as Integer) as String Returns "" if OK, or Error Message if something failed.ĭim s1 As String = DeviceOff(hs, 174) 'turn OFF device with ref 174ĭim s2 As String = DeviceOff(hs, GetRefsB圜ategoryName(hs4, "Kitchen")) 'Turn OFF all devices in Category Kitchen All of the devices must have the ControlUse_Off property defined. Issues CAPI commands to turn off an individual device ( DevRef), or all devices in a list of devices ( DevRefs). Returns "" if OK, or Error Message if something failed.ĭim s1 As String = DeviceOn(hs, 174) 'turn ON device with ref 174ĭim s2 As String = DeviceOn(hs, GetRefsB圜ategoryName(hs4, "Kitchen")) 'Turn ON all devices in Category KitchenĭeviceOff(hs, DevRef as Integer) as StringĭeviceOff(hs, DevRefs as List(Of Integer) as String All of the devices must have the ControlUse_On property defined. Issues CAPI commands to turn on an individual device ( DevRef), or all devices in a list of devices ( DevRefs). Index to Extension Methods ReferenceĭeviceOn(hs, DevRef as Integer) as StringĭeviceOn(hs, DevRefs as List(Of Integer) as String When you Export your script from tenScripting4 to the HS4 script folder, the reference to hs4 will be replaced with hs. If you are testing under tenScripting4, then hs must be hs and hs4 must be hs4. If your script is running within HS4 (called by an Event), then you should enter hs for both the hs and hs4 parameters. In the following reference, some methods will show an hs parameter, and some will show an hs4 parameter. Most of these methods access HS functions, and as a result, you must pass the hs object to the method. Following is a list of all of the extension methods included in this product distribution.