Announcement

Collapse
No announcement yet.

BLsecurity Function commands

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

    BLsecurity Function commands

    Blade,

    I running vb code that I copy from BLsecurity Help file.
    I copy line by Line.

    Could you tell me why I getting a error running this script.

    ____________________________________________________________ ___________________

    Sub Main(parm as object)

    Dim myTags As Object = hs.PluginFunction("BLSpeech", "", "GetCurrentSpeechTags", Nothing)
    hs.writelog("Info", "Tag priority: " & myTags.Priority)
    hs.writelog("Info", "Tag speaker: " & myTags.Speaker)
    hs.writelog("Info", "Tag sound: " & myTags.Sound)
    hs.writelog("Info", "Tag volume: " & myTags.VolumeLevel)
    hs.writelog("Info", "Tag queue setting: " & myTags.QueueSetting)
    hs.writelog("Info", "Tag voice: " & myTags.Voice)
    hs.writelog("Info", "Tag BLBroadcast client: " & myTags.BLBroadcastClient)
    hs.writelog("Info", "Tag Is Speaker: " & myTags.IsSpeaker.ToString)
    hs.writelog("Info", "Tag Is Zone: " & myTags.IsZone.ToString)
    myTags = Nothing

    For Each spkr As Object In hs.PluginFunction("BLSpeech", "", "Speakers", Nothing)
    hs.writelog("Info", "Speaker key: " & spkr.Key & " is a speaker!")
    Next

    End Sub
    ____________________________________________________________ ________________________

    Error>>:

    Running script Casatune_SetZones3.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()

    Thank you

    Greg Mack

    #2
    Try this:

    Code:
    Sub Main(ByVal parm as object)
    
    Dim myTags As Object = hs.PluginFunction("BLSpeech", "", "GetCurrentSpeechTags", Nothing) 
    hs.writelog("Info", "Tag priority: " & myTags.Priority) 
    hs.writelog("Info", "Tag speaker: " & myTags.Speaker) 
    hs.writelog("Info", "Tag sound: " & myTags.Sound) 
    hs.writelog("Info", "Tag volume: " & myTags.VolumeLevel) 
    hs.writelog("Info", "Tag queue setting: " & myTags.QueueSetting) 
    hs.writelog("Info", "Tag voice: " & myTags.Voice) 
    hs.writelog("Info", "Tag BLBroadcast client: " & myTags.BLBroadcastClient) 
    hs.writelog("Info", "Tag Is Speaker: " & myTags.IsSpeaker.ToString) 
    hs.writelog("Info", "Tag Is Zone: " & myTags.IsZone.ToString) 
    myTags = Nothing 
    
    For Each spkr As Object In hs.PluginFunction("BLSpeech", "", "Speakers", Nothing) 
    hs.writelog("Info", "Speaker key: " & spkr.Key & " is a speaker!") 
    Next 
    
    End Sub
    Cheers,
    Bob
    Web site | Help Desk | Feature Requests | Message Board

    Comment


      #3
      Blade,

      What change did you make? I must be over looking it, because i don't see it! .....

      I now getting this error: Running script C:\Program Files (x86)\HomeSeer HS3\scripts\Casatune_SetZones3.vb :Exception has been thrown by the target of an invocation.Timeout occured. Did not receive a response.

      Running script Casatune_SetZones3.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()

      I not see any information display in log file.

      Thank you

      Greg Mack
      Last edited by BIGMACK48; October 3, 2013, 08:18 PM.

      Comment


        #4
        I changed this line:

        Code:
        Sub Main(ByVal parm as object)
        Turn on debug logging in the plugin and then run the script, the disable debug logging and attach the BLSpeech-Detailed.log file or email me the log directly.
        Cheers,
        Bob
        Web site | Help Desk | Feature Requests | Message Board

        Comment


          #5
          Greg,
          Can you try this code and let me know what you get?

          Code:
          Sub Main(ByVal parm as object)
          
          Try
          
              Dim myTags As Object = hs.PluginFunction("BLSpeech", "", "GetCurrentSpeechTags", Nothing) 
              hs.writelog("Info", "Tag priority: " & myTags.Priority) 
              hs.writelog("Info", "Tag speaker: " & myTags.Speaker) 
              hs.writelog("Info", "Tag sound: " & myTags.Sound) 
              hs.writelog("Info", "Tag volume: " & myTags.VolumeLevel) 
              hs.writelog("Info", "Tag queue setting: " & myTags.QueueSetting) 
              hs.writelog("Info", "Tag voice: " & myTags.Voice) 
              hs.writelog("Info", "Tag BLBroadcast client: " & myTags.BLBroadcastClient) 
              hs.writelog("Info", "Tag Is Speaker: " & myTags.IsSpeaker.ToString) 
              hs.writelog("Info", "Tag Is Zone: " & myTags.IsZone.ToString) 
              myTags = Nothing 
          
              For Each spkr As Object In hs.PluginFunction("BLSpeech", "", "Speakers", Nothing) 
                  hs.writelog("Info", "Speaker key: " & spkr.Key & " is a speaker!") 
              Next 
          
          Catch ex As Exception
              hs.writelog("Error", "Caught this exception - " & ex.Message)
          End Try
          
          End Sub
          Cheers,
          Bob
          Web site | Help Desk | Feature Requests | Message Board

          Comment

          Working...
          X