Time Trigger

Set a trigger based on current time

Overview

Set a trigger based on current time. This node is useful to get downstream nodes to take action (or not) depending on the day of week or time of day.

Example use cases:

  • Don't send alarms or alerts during work hours when a person enters an area. Occupancy Monitor -> Time Trigger -> Trigger Email Alert Node (with trigger set of Time Trigger and Occupancy Monitor Trigger)
  • Don't process the rest of the pipeline outside a set range of hours. Video Source Node -> Time Trigger -> Filter Stream Node (with trigger set to Time trigger metadata) -> rest of pipeline.

Remember : To use the output of the Time Trigger Node, you must use a Trigger Condition of type nodes.time_trigger1.triggered in a downstream node.

Inputs & Outputs

  • Inputs : 1, Media Format : Raw Video
  • Outputs : 1, Media Format: Raw Video
  • Output Metadata : Time trigger state

Properties

PropertyDescriptionTypeDefaultRequired
modeDetermines if the time trigger should only add metadata, or also stop further processing outside specified time range. Options: Add metadata (metadata): Only insert time trigger metadata. Allows all downstream processing to continue; Control processing (control): Insert time trigger metadata, and halt further processing when outside the specified time range.enummetadataNo
day_of_weekIf empty, trigger on all days, else trigger on the selected days. Leave empty if using day of week or dates in the Time range field. Options: Monday (monday); Tuesday (tuesday); Wednesday (wednesday); Thursday (thursday); Friday (friday); Saturday (saturday); Sunday (sunday). Format: array of selected option values.string[]nullNo
periodTrigger periodically. Options: Disabled (null); Daily (day); Hourly (hour); Every 30 mins (30min); Every 15 mins (15min); Every X seconds (seconds).enumnullNo
intervalSpecify interval. Conditional on period being seconds. Unit: seconds.numbernullYes
time_rangesTime range format: <Start Date | Day of Week | Weekdays | Weekends> <Start Time of Day> - <End Date | Day of Week> <End Time of Day>. End date / day / time is optional. Trigger during or at these times or time ranges. Leave schedule day of week empty if using this field.stringnullNo
timezoneTimezone. Options: US/Pacific (us/pacific); US/Central (us/central); US/Mountain (us/mountain); US/Eastern (us/eastern); Other (other).enumus/pacificYes
timezone_offsetTimezone offset from GMT. Conditional on timezone being other. Unit: hours.floatnullYes

Time Range Format

The time_ranges property supports multiple time ranges, comma separated. Each range must be of the following format, although you can mix and match types in a single node:

Range TypeFormatExample
Specific time, on all days of the week.HH:MM am/pm12:59am, 4pm
Specific time range, on all days of the week.
Time range can cross midnight when day/date is not specified.
HH:MM am/pm - HH:MM am/pm3pm - 5pm
4:30pm - 9pm
5pm to 1am
Specific day of week / date and time.MM/DD/YYYY HH:MM am/pm
DAY_OF_WEEK HH:MM am/pm
DAY_GROUP HH:MM am/pm

DAY_OF_WEEK is one of:
monday, tuesday, wednesday, thursday, friday, saturday, sunday

DAY_GROUP is one of weekdays, weekends
04/13/2022 4:50pm
monday 9am
weekdays 10am
weekends 9:55am
Specific time rangeMM/DD/YYYY HH:MM am/pm - MM/DD/YYYY HH:MM am/pm
DAY_OF_WEEK HH:MM am/pm - DAY_OF_WEEK HH:MM am/pm

DAY_OF_WEEK HH:MM am/pm - HH:MM am/pm
DAY_GROUP HH:MM am/pm - HH:MM am/pm

DAY_OF_WEEK is one of:
monday, tuesday, wednesday, thursday, friday, saturday, sunday

DAY_GROUP is one of weekdays, weekends
12/1/2022 5am - 12/15/2022 9am

monday 9am - friday 5pm

weekdays 12am - 6am

weekends 12am - 11:59pm

Behavior

This node will set a trigger when current time meets the 3 criteria specified : day_of_week and period and time_ranges.

  • Setting a period along with day_of_week and/or time_ranges lets you trigger it periodically within those time ranges
  • Setting day_of_week values along with time_rangeswill limit the trigger to the overlap of both.

Output Metadata

The fields below are declared by this node's metadata schema; the JSON values are representative examples.

PathTypeDescription
nodes.<node_id>.triggeredbooleanTrue if current time matches the configuration, else False
nodes.<node_id>.triggered_deltabooleanTrue if the triggered property changed from False to True in this frame, else False
nodes.<node_id>.typestringIdentifies the node type that produced this metadata.

JSON example

{
  "nodes": {
    "time_trigger1": {
      "triggered": true,
      "triggered_delta": false,
      "type": "time_trigger"
    }
  }
}

Did this page help you?