I have a Kwikset 916 Lock that I just got working
I am trying to create a script to toggle the lock with a single button press in HsTouch (Android client)
I found a toggle switch for lights and have modified it. It works half way. Essentially I can unlock the device but I can't lock it for some reason
Below is the script
No matter what it sends an unlock command even though it knows it knows that it is unlocked
What am I missing here?
I am trying to create a script to toggle the lock with a single button press in HsTouch (Android client)
I found a toggle switch for lights and have modified it. It works half way. Essentially I can unlock the device but I can't lock it for some reason
Below is the script
Code:
Sub Main(ByVal theDevice as string) '' Specify the Device Name, including Locations, as a Parm Dim devValue as double '' Get the Device Status devValue = hs.DeviceValue(theDevice) hs.writelog("Info","lock value is " & devValue) '' Toggle it Select Case devValue Case 255 '' Device Locked, UNLOCK it hs.CAPIControlHandler(hs.CAPIGetSingleControl(theDevice,true,"Unlock",false,true)) Case 0 '' Device Unlocked, LOCK it hs.CAPIControlHandler(hs.CAPIGetSingleControl(theDevice,true,"Lock",false,true)) End Select End Sub
What am I missing here?
Comment