Announcement

Collapse
No announcement yet.

Remotec ZRC-90 Toggle Script

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

    Remotec ZRC-90 Toggle Script

    I have a Remotec ZRC-90, and it has Button Press, Double Press, and Hold 2sec per button. I'd rather have a Toggle Button to where you press once and device on, and press again for device off. I'm guessing it can be done with a script that first determines the stat of the device before making the change. I actually found a script that I think is pretty close if not spot on, but I'm not very familiar with Homeseer in general as I just got my unit. Where does it go? What changes does it need?
    Code:
    Sub Main(ByVal theDevice As String)
    	' Toggle the Specified Device ON/OFF
    	' DIM is considered ON
    	' Specify the Device ID as the Parameter
    	Dim devValue As Double
    
    	' Get the Device Status
    	devValue = hs.DeviceValue(theDevice)
    	' Toggle it
    	Select Case devValue
    		Case Is > 0
    		' Device ON or DIM, turn it OFF
    		hs.CAPIControlHandler(hs.CAPIGetSingleControl(theDevice,true ,"off",false,true))
    		Case 0
    		' Device OFF, turn it ON
    		hs.CAPIControlHandler(hs.CAPIGetSingleControl(theDevice,true ,"on",false,true))
    	End Select
    End Sub
    Last edited by tome10; October 4, 2016, 07:04 AM.
Working...
X