Announcement

Collapse
No announcement yet.

Script Bypass Zone

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

    Script Bypass Zone

    Mark,

    In a script to bypass a zone can I refer to the device code (Q15) or do I need to use the Name (Patio Door)?

    Bypass(zone as string) - bypass the zone

    Thank you,

    Chris

    #2
    Additional data to help on my rather vague question..

    Code:
     
    Public Sub Main(ByVal parms As Object)
       Dim isSuccess As Boolean
       Dim Zone As String = "\2"
       Dim hspi As Object = hs.plugin("Vista Alarm")
       'isSuccess = hspi.Disarm()
       isSuccess = hspi.Bypass(Zone)
    End Sub
    When I run the above scrip with the Disarm code it works great, how ever no matter what I try the Bypass code gives the following error in the log:

    /9/2013 4:35:19 PM Event Running script in background: Bypass.vb
    4/9/2013 4:35:20 PM Error Scripting runtime error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. --- System.MissingMemberException: Public member 'Bypass' on type 'HSPI' not found. at Microsoft.VisualBasic.CompilerServices.Symbols.Container.Get Members(String& MemberName, Boolean ReportErrors) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGe t(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) at scriptcode54.scriptcode54.Main(Object parms) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments)

    Thoughts as to what I am missing?

    Chris

    Comment


      #3
      here is the api for bypass

      Public Sub BypassZone(ByVal DC As String)

      DC is the zone number ("2"), not the entire device code, "\2"
      Mark

      HS3 Pro 4.2.19.5
      Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
      Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
      Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

      Comment


        #4
        Thank you Mark, got that changed and working!!

        Thank you again

        Chris
        Last edited by dcdelong; April 9, 2013, 05:20 PM.

        Comment

        Working...
        X