Announcement

Collapse
No announcement yet.

Multiple Trigger Phrase in one Handler?

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

    #31
    I can add a homeseer command for waitsecs if you need one

    If this is not what you want give me an example of you are trying to do
    Cheers,
    Bob
    Web site | Help Desk | Feature Requests | Message Board

    Comment


      #32
      Yes that would be great ! Thank you

      Comment


        #33
        Download the same zip from the link I posted above
        Build will be 3.0.15.0

        You can now use:

        HS[WaitSecs~2]
        Cheers,
        Bob
        Web site | Help Desk | Feature Requests | Message Board

        Comment


          #34
          Originally posted by Blade View Post
          Download the same zip from the link I posted above
          Build will be 3.0.15.0

          You can now use:

          HS[WaitSecs~2]
          it works thanks !

          Comment


            #35
            Originally posted by hjk View Post
            3. Command: HS[RunScript~ReservationScript.vb~Main~%EVENTNAME%]
            4. A script that you create, called "ReservationScript.vb", then takes EVENTNAME (which in this case is "R3941656 Luke Skywalker") and performs a regular expression on it to extract the last 4 digits of the number, then calls BLLock by script to set the lock: hs.PluginFunction("BLLock", "", "EnableLockUser", New Object(){660,1}) --- or whatever the scripting call is to set a lock code.
            ---
            @hjk I'm at loss when it comes to VBscripting or coding. I do however manage to get by with some help and instructions. I understand the part "3. Command: HS[RunScript~ReservationScript.vb~Main~%EVENTNAME%]" and that I should create a vbscript in the HS3 scripts folder and that HS3 will execute this script, but "4. A script that you create, called "ReservationScript.vb" I'm at loss. Can you or someone please give me a working example of such a script? The script must take into consideration that it shall only trigger/continue on events where there exist "R+7 digit number" so if there is an event with name "R&R" it will exit and not continue.

            @Blade: In order for my events with "R+7 digits number" to trigger the handler, the Trigger Phrase function must support wildcards. Is this something that also can be supported? Also the bug with not being able to deselect all Calendars after one or more calendars has been selected is still there in version 3.0.15.0 (just so you don't forget :-)

            Comment


              #36
              I have fixed the saving for calendar ids in 3.0.16
              I still need to figure out how I am going to add the ability to search for R#######

              I wrote this script but have not tested it:

              This assumes that your lock root device ref is 660 and the pin location you want to add the user to is 1

              If this was used as an example:

              R3941656 Luke Skywalker

              The lock code would be 1656 and the user name for the lock pin would be "Luke Skywalker"

              Note: You will need BLLock 3.0.13 for this to work (which I have submitted to the updater)


              Code:
              Sub Main(ByVal eventName As String)
              	Dim splitArray As String() = eventName.Trim.Split(" ")
              	If splitArray.Length = 3 Then
              		Dim reservationNumber As String = splitArray(0).Trim
              		Dim userName As String = splitArray(1).Trim & " " & splitArray(2).Trim
              		reservationNumber = reservationNumber.Replace("R", "")
              		Dim lockCode As String = reservationNumber.Substring(reservationNumber.Length - 4)
              		
              		If IsNumeric(lockCode) Then
              			hs.PluginFunction("BLLock", "", "AddUserCodePin", New Object(){660,1,Integer.Parse(lockCode),userName})
              		End If
              
              		lockCode = Nothing
              		userName = Nothing
              		reservationNumber = Nothing
              	End If
              	splitArray = Nothing
              End Sub
              Cheers,
              Bob
              Web site | Help Desk | Feature Requests | Message Board

              Comment


                #37
                I have attempted to add regular expression ability to the trigger phrase
                You will need to select the checkbox below the trigger phrase to select regular expression

                You could try the following regular expression for you R1234567 trigger:

                Code:
                R\d{7}
                The saving of no calendars should be fixed as well

                Here is the build (3.0.16.0)

                http://www.bladeplugins.com/betas/HSPI_BLGData.zip

                1. Shutdown HS3
                2. Backup the existing HSPI_BLGData.exe
                3. Unzip the HSPI_BLGData.exe to the HS3 root folder and overwrite
                4. Restart HS3

                Let me know
                Last edited by Blade; March 19, 2018, 02:31 PM.
                Cheers,
                Bob
                Web site | Help Desk | Feature Requests | Message Board

                Comment


                  #38
                  Installed version 3.0.16.0

                  What's working: saving of calendars
                  Not working: regular expression:
                  Code:
                  /R\d{7}/g
                  - the handler will not trigger if I create a new event with name: "R3941656 Luke Skywalker". Tested with all calendars unchecked and also the specific calendar checked.

                  Also I could not find BLLock 3.0.13 in the updater? Checked under Beta aswell. Only 3.0.11.0 under "Security"

                  Comment


                    #39
                    BLLock 3.0.13 is not there yet but has been submitted to HS for approval

                    Can you capture a debug log of the regular expression not working
                    Attach it zipped
                    Cheers,
                    Bob
                    Web site | Help Desk | Feature Requests | Message Board

                    Comment


                      #40
                      Here you go Blade, same password as b4
                      Created a brand new event:

                      R3441646 Luke Skywalker
                      Start:19.03.2018 06.50.00
                      End: 19.03.2018 06.51.00
                      Attached Files

                      Comment


                        #41
                        Can you try the trigger string like this:

                        Code:
                        R\d{7}
                        Cheers,
                        Bob
                        Web site | Help Desk | Feature Requests | Message Board

                        Comment


                          #42
                          The latest regex suggested by you will trigger on all events, but from all calendars of the user even if only one has been selected? Also it seem's to trigger several times? I know the drill now. Same password as b4
                          Attached Files

                          Comment


                            #43
                            Yes I do see it running more than once
                            It does seem to be different events that are triggering
                            I will check into that and let you know
                            Cheers,
                            Bob
                            Web site | Help Desk | Feature Requests | Message Board

                            Comment


                              #44
                              Try out 3.0.18 in the beta section
                              Cheers,
                              Bob
                              Web site | Help Desk | Feature Requests | Message Board

                              Comment


                                #45
                                Originally posted by Blade View Post
                                Try out 3.0.18 in the beta section
                                3.0.18 installed and can confirm the handler will now trigger correctly by using the regex
                                Code:
                                R\d{7}
                                Now I would like to test this together with BLLock 3.0.13 and the vbscript you made to set the code of a lock, but I can't find this version in the updater. Can you provide a download link instead?

                                Comment

                                Working...
                                X