I am trying to use HSTouch to collect and pass to the DSC alarm panel the Dis Arm codes. I want the user to enter their disarm ode in the security codebox and pass it to the panel using the SendKeystrokeString call. I do not want to create an action for each user in HS since the owner of the DSC system may add other users to the system and would require hard coding user access codes in a HS event.
Here is my code:
Sub Main(ByVal parm As Object)
Dim AlarmCmd as String = ""
Dim UserPassword as String = ""
Dim Zone as String = ""
Dim CmdError as Object= ""
AlarmCmd = parm(0).ToString
Select Case AlarmCmd
Case "ArmStay"
UserPassword = parm(1).ToString
hs.WriteLog("Alarm Script", "Arm Stay - User Password = " & UserPassword)
Case "ArmAway"
UserPassword = parm(1).ToString
CmdError = hs.PluginFunction("EnvisaLink", "","ArmAway",UserPassword )
hs.WriteLog("Alarm Script", "Arm Away - User Password = " & UserPassword & " error = " & CmdError )
Case "DisArm"
UserPassword = parm(1).ToString
CmdError = hs.PluginFunction("EnvisaLink", "","SendKeystrokeString",UserPassword )
hs.WriteLog("Alarm Script", "Disarm - User Password = " & UserPassword)
Case "Bypass"
Zone = parm(1).ToString
hs.WriteLog("Alarm Script", "Bypass Zone = " & Zone)
Case "GetStatus"
Case Else
End Select
End Sub
Here is the response:
Running script AlarmEvent.vb :Exception has been thrown by the target of an invocation.->Does entry point Main exist in script? at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Obj ect obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at A.c17b105f989efe61e5979e67bec1ef734.cffd66cb0782c50126727e3f a75582d7a()
Do you have to use HS Events to signal back to EnvisaLink?
The SendKeystrokeString action requires a hard coded string. Can this be a Global?
Here is my code:
Sub Main(ByVal parm As Object)
Dim AlarmCmd as String = ""
Dim UserPassword as String = ""
Dim Zone as String = ""
Dim CmdError as Object= ""
AlarmCmd = parm(0).ToString
Select Case AlarmCmd
Case "ArmStay"
UserPassword = parm(1).ToString
hs.WriteLog("Alarm Script", "Arm Stay - User Password = " & UserPassword)
Case "ArmAway"
UserPassword = parm(1).ToString
CmdError = hs.PluginFunction("EnvisaLink", "","ArmAway",UserPassword )
hs.WriteLog("Alarm Script", "Arm Away - User Password = " & UserPassword & " error = " & CmdError )
Case "DisArm"
UserPassword = parm(1).ToString
CmdError = hs.PluginFunction("EnvisaLink", "","SendKeystrokeString",UserPassword )
hs.WriteLog("Alarm Script", "Disarm - User Password = " & UserPassword)
Case "Bypass"
Zone = parm(1).ToString
hs.WriteLog("Alarm Script", "Bypass Zone = " & Zone)
Case "GetStatus"
Case Else
End Select
End Sub
Here is the response:
Running script AlarmEvent.vb :Exception has been thrown by the target of an invocation.->Does entry point Main exist in script? at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Obj ect obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at A.c17b105f989efe61e5979e67bec1ef734.cffd66cb0782c50126727e3f a75582d7a()
Do you have to use HS Events to signal back to EnvisaLink?
The SendKeystrokeString action requires a hard coded string. Can this be a Global?
Comment