Announcement

Collapse
No announcement yet.

Multiple Trigger Phrase in one Handler?

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

    #16
    Try 3.0.12 in the beta section
    Cheers,
    Bob
    Web site | Help Desk | Feature Requests | Message Board

    Comment


      #17
      Sorry Blade, no change in this version. The problem persist. Could there be a date/time format problem causing this?

      I have created an event called "Test1"
      Start Date/Time 15.03.2018 06.40.00
      End Date/Time 15.03.2018 06.41.00

      The handler will trigger on start time and not on X amount of minutes before as set in the handler config. The "After command" does not work at all.

      Comment


        #18
        It is possible - I did notice that your date format was completely different

        Can you capture a small debug log of your test event not triggering before
        Let me know the exact time it was supposed to trigger
        Cheers,
        Bob
        Web site | Help Desk | Feature Requests | Message Board

        Comment


          #19
          The handler has been configured to look in one specific calender for an event with name "Test1". Offset values are set to 5 minutes before and after. Before/After Commands are to write "BLGData Event start" and "BLGData Event end"

          I created an event with Event name "Test1" in the exact same calendar with Start Date/Time 15.03.2018 12.40.00 and End Date/Time 15.03.2018 12.41.00

          The handler was supposed to trigger at 12:35 with an end action at 12:46
          (5 minutes before and after). Instead the handler only triggered on Start Date/Time 12:40 and there is no "after" action either.

          If you look in the attached logfile line 90766 you can see that the logfile was updated with the "before command" 15.03.2018 12.40.09 : v3.0.12.0 - HomeseerCommandProcessor.Process_Homeseer_Command(): myHomeseerCommandData.ToString -->
          HomeseerCommandData:
          --------------------
          command: WriteLog
          data: Info~BLGData Event start
          isHandler: False
          isAfter: False

          There is nothing logged for "Info~BLGData Event end" in the logfile (expected to see this at 12.46). The attached logfile has only events from today at 12.34-12.46. The password for the zip-file is the same as before.
          Attached Files
          Last edited by ToonWolf; March 15, 2018, 09:03 AM. Reason: forgot to upload attachements

          Comment


            #20
            I just have to say that this new feature of being able to select a calendar in a handler is awesome.
            Originally posted by rprade
            There is no rhyme or reason to the anarchy a defective Z-Wave device can cause

            Comment


              #21
              I can see your event here:

              CalendarEvent:
              --------------
              Key: U20180307T162346744_C0004_1hlii9eu8tcl5r6sdmj2pfbhbp
              EventId: 1hlii9eu8tcl5r6sdmj2pfbhbp
              Name: Test1
              Description:
              Location:
              StartDateReal: 15.03.2018 12.40.00
              StartDate: 15.03.2018
              StartTime: 12.40
              EndDate: 15.03.2018
              EndTime: 12.41
              EndDateReal: 15.03.2018 12.41.00

              The plugin keeps track of the calendar key and event id combination to know whether the event has run the before and after. You can see here that it has already ran the before and after for this calendar key and event id combination

              15.03.2018 12.35.22 : v3.0.12.0 - Check_Calendar_Events(): processed event offset --> ProcessedEventOffset: CalendarKey: U20180307T162346744_C0004; EventId: 1hlii9eu8tcl5r6sdmj2pfbhbp; OffsetBeforeExecuted: True; OffsetAfterExecuted: True

              Was this a brand new created event? Or did you just use the same event and change the start and end times. If it was a brand new event, it should have had its own unique event id and therefore would run the before and after

              Let me know
              Cheers,
              Bob
              Web site | Help Desk | Feature Requests | Message Board

              Comment


                #22
                Originally posted by Blade View Post
                Was this a brand new created event? Or did you just use the same event and change the start and end times.
                The "Test1" event was not a brand new event and that explains why the handler did not trigger before and after like it was supposed to do.

                I created a brand new event "Test1" and the handler was triggered 5 minutes before and after as configured. However I also see that it was triggered on Event start time?

                This is the event start and end date/time of Test1
                16.03.2018 10.35.00
                16.03.2018 10.36.00

                From the log
                mar-16 10.41.04 Info BLGData Event end (ok)
                mar-16 10.35.14 Info BLGData Event start (did not expect this)
                mar-16 10.30.27 Info BLGData Event start (ok)

                Comment


                  #23
                  Yes it has always triggered on event start
                  Cheers,
                  Bob
                  Web site | Help Desk | Feature Requests | Message Board

                  Comment


                    #24
                    Originally posted by Blade View Post
                    Yes it has always triggered on event start
                    OK thank's for the info. The issue with offset values has been fixed from my end.

                    I noticed a small bug in the new feature where you can select from which calendars the Trigger Phrase should look in. If you have already selected one or more calendars but deselect all of them and save, the configuration will remain the same. The calendars you had selected previously will still be selected even if you deselect all of them.

                    Also this is kind of related to this post https://forums.homeseer.com/showthread.php?t=194620 Is it possible to trigger the event using a wildcard, or is this a new feature request?

                    What I would like to do is:
                    1. Trigger a handler with all events starting with "R" from selected calendars.
                    2. Capture the Event name and store it as a variable. Example of such an event is: "R3941656 Luke Skywalker"
                    3. Do some magic coding and extract 4 digits from the event name and store it as a variable "3941". It's probably best to take the first digits after "R"
                    4. Create an action to set the code of a Z-wave lock to "3941" using BLLock


                    I understand that my request is something that would be considered as "custom development", but can you please acknowledge that it's possible to do and if yes, can I add this as a feature request?

                    Comment


                      #25
                      I will check the saving issue and let you know

                      As for the feature request, I will need to digest it more before answering
                      Cheers,
                      Bob
                      Web site | Help Desk | Feature Requests | Message Board

                      Comment


                        #26
                        FYI: The Event name with the number originates from the Planyo booking system. When someone makes a reservation for a tennis court a new calendar event with the reservation number and the name of the person booking a tennis court will automatically be added in the Google Calendar (There is a two-way sync between Planyo and GCal). Each tenniscourt has it's own calendar. All reservations will always be in the same format starting with R followed by the 7 digit reservation number, then the name of the customer/player. Note: in the same calendar there exist other events starting with "R" but without number. These events shall not trigger the handler.

                        Comment


                          #27
                          Originally posted by ToonWolf View Post
                          What I would like to do is:
                          1. Trigger a handler with all events starting with "R" from selected calendars.
                          2. Capture the Event name and store it as a variable. Example of such an event is: "R3941656 Luke Skywalker"
                          3. Do some magic coding and extract 4 digits from the event name and store it as a variable "3941". It's probably best to take the first digits after "R"
                          4. Create an action to set the code of a Z-wave lock to "3941" using BLLock
                          With one minor modification to BLGData, I think this would be fairly easy using some scripting calls.

                          Item 2 above - capture event name and store it in a usable variable for the Handler - would need to be added to BLGData. I do not think any part of the calendar item is captured as a variable for use in the Handler today.

                          But then, you could have a script and pass the event name to the script.

                          For example:

                          1. Handler called "Reservation" trigger (with a trigger phrase as "R"?)
                          2. Event gets stored in a variable called EVENTNAME for use in the Handler
                          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.

                          This would allow anyone to perform custom functions given data in the event, and would leave the plugin fairly generic. If Blade were feeling dangerous, the plugin COULD provide a facility in the UI to perform a regular expression, extract a piece of data, and call a script or function with that data. But really, users could do the same thing with a script.

                          Anyway, just thinking out loud here...

                          hjk
                          ---

                          Comment


                            #28
                            hjk,

                            This is the sort of thing I was kicking around in my mind

                            The ability to use variables in the HS[] commands and then the plugin would substitute in those values when it executed the commands

                            I was thinking:

                            $EVENTID
                            $EVENTNAME
                            $EVENTLOCATION
                            $EVENTDESCRIPTION
                            $EVENTSTART
                            $EVENTEND

                            That should do it

                            Now to code it
                            Cheers,
                            Bob
                            Web site | Help Desk | Feature Requests | Message Board

                            Comment


                              #29
                              Here is a link to a beta build (3.0.14.0) that will allow the variables for HomeSeer commands

                              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

                              The following variables will work:

                              $EVENTID
                              $EVENTNAME
                              $EVENTLOCATION
                              $EVENTDESCRIPTION
                              $EVENTSTART
                              $EVENTEND

                              Let me know if any issues
                              Cheers,
                              Bob
                              Web site | Help Desk | Feature Requests | Message Board

                              Comment


                                #30
                                Hi Blade,

                                This new fonction is awesome.. thank to both (OP) of you.

                                I do use the plugin to call ''real'' events in hs3 event engine. Is there a way to call those variables in a text to speech action i use in hs3 event?

                                edti: or i gguess i should just convert my events completly in to the handlers...

                                If i want to add a
                                Code:
                                &hs.waitsecs(0.654)
                                command how do i do it in the plugin without creating a scrip?
                                Last edited by ; March 17, 2018, 03:37 PM.

                                Comment

                                Working...
                                X