Try 3.0.12 in the beta section
Announcement
Collapse
No announcement yet.
Multiple Trigger Phrase in one Handler?
Collapse
X
-
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
-
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.
Comment
-
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
Comment
-
Originally posted by Blade View PostWas this a brand new created event? Or did you just use the same event and change the start and end times.
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
-
Originally posted by Blade View PostYes it has always triggered on event start
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:- Trigger a handler with all events starting with "R" from selected calendars.
- Capture the Event name and store it as a variable. Example of such an event is: "R3941656 Luke Skywalker"
- 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"
- 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
-
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
-
Originally posted by ToonWolf View PostWhat I would like to do is:- Trigger a handler with all events starting with "R" from selected calendars.
- Capture the Event name and store it as a variable. Example of such an event is: "R3941656 Luke Skywalker"
- 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"
- Create an action to set the code of a Z-wave lock to "3941" using BLLock
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
-
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
Comment
-
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
Comment
-
Guest
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 aCode:&hs.waitsecs(0.654)
Comment
Comment