No announcement yet.

Usage: Creating HS Event Triggers/Actions

This is a sticky topic.
  • Filter
  • Time
  • Show
Clear All
new posts

    Usage: Creating HS Event Triggers/Actions

    HS Event Triggers:

    The following trigger types are available in the plugin:
    • Google Calendar Event Reminder
    • Google Calendar Event Start (Occures)
    • Google Calendar Event End
    Click image for larger version

Name:	Reminders.png
Views:	174
Size:	33.8 KB
ID:	1479226
    Example of trigger: trigger one hour before "Primary" calendar event with text "No School"
    The action is: Speak phrase "Started Primary: No School"
    Click image for larger version  Name:	trigger_cfg.jpg Views:	0 Size:	37.6 KB ID:	1453449​​
    Note 1: Since HST didn't port timepicker control to HS4 - you need to enter time span as text, i.e. if you want to trigger event 15 minutes before - enter 0:00:15

    Note 2: For "Calendar Event End" trigger you must enable "Show already started events" in each calendar settings. Please read Important Notes below.
    When the event triggers - plugin creates many global variables for using in actions (using format $$GLOBALVAR:name:):
    Click image for larger version  Name:	trigger_cfg_collap.jpg Views:	0 Size:	31.2 KB ID:	1453450​​

    HS Event Actions:

    The plugin creates two actions:
    • Create Google Calendar Event
    • Set Google Calendar Event End
    (1) Create Google Calendar Event

    Note: The event text can use HS Replacement Variables, i.e. device value / status.

    Say you want to keep track of your gate state in the Google calendar.

    You use "Create Calendar Event" action when your gates are open:
    ​​​ Click image for larger version  Name:	CreateCalEvent.jpg Views:	0 Size:	49.8 KB ID:	1479048
    Click image for larger version  Name:	CreateEvent1.jpg Views:	0 Size:	20.4 KB ID:	1479047

    Note the event-action id above (3-3436) you need for "Set Event End" action later.​​
    (2) Set Google Calendar Event End

    When the gates close - you use "Set Even End" action (make sure you select the id 3-3436):
    Click image for larger version  Name:	createEnd2.png Views:	0 Size:	16.1 KB ID:	1453458​​
    Click image for larger version  Name:	SetEnd.jpg Views:	0 Size:	24.6 KB ID:	1453459​​
    The above two actions will create the Google Calendar events (green color), i.e. Gates Open 10:36 - 12:06):
    Click image for larger version  Name:	323_Capture (1).png Views:	112 Size:	39.4 KB ID:	1453460​​


      Important Notes

      1. Trigger functionality depends on the calendar configuration and works only for Calendar events displayed in HS. For example if you create a trigger for Event Reminder in Today Calendar and the Calendar Event starts tomorrow (so isn't displayed in Today calendar) and the event reminder is set for "One Day before the event" - it won't trigger. In other words, the Event Reminder trigger for Today Calendar only triggers for events starting today (i.e. within 24 hours)

      2. For same reason if you want to use Event End Trigger - then "Show Started" option should be enabled for this calendar.

      3. And for the same reason if you disable updates for particular calendar (by setting number of events or update frequency to 0) - triggers for this calendar won't work.

      4. Event Reminder Triggers work only for the reminder set explicitly for the event - not the default reminders. Google Calendar API provides only reminder "overrides" by default. It is possible though to get the default reminders to work if required - please add Feature Request.

      5. For some calendars Google doesn't send the clean Name, instead it provides an ugly looking ID. In this case I recommend in Google calendar settings set the calendar description field to the display name you want to see in HS - the plugin then will use the description instead of the name.