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.triggeredin a downstream node.
Inputs & Outputs
- Inputs : 1, Media Format : Raw Video
- Outputs : 1, Media Format: Raw Video
- Output Metadata : Time trigger state
Properties
| Property | Description | Type | Default | Required |
|---|---|---|---|---|
mode | Determines 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. | enum | metadata | No |
day_of_week | If 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[] | null | No |
period | Trigger periodically. Options: Disabled (null); Daily (day); Hourly (hour); Every 30 mins (30min); Every 15 mins (15min); Every X seconds (seconds). | enum | null | No |
interval | Specify interval. Conditional on period being seconds. Unit: seconds. | number | null | Yes |
time_ranges | Time 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. | string | null | No |
timezone | Timezone. Options: US/Pacific (us/pacific); US/Central (us/central); US/Mountain (us/mountain); US/Eastern (us/eastern); Other (other). | enum | us/pacific | Yes |
timezone_offset | Timezone offset from GMT. Conditional on timezone being other. Unit: hours. | float | null | Yes |
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 Type | Format | Example |
|---|---|---|
| Specific time, on all days of the week. | HH:MM am/pm | 12: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/pm | 3pm - 5pm4:30pm - 9pm5pm to 1am |
| Specific day of week / date and time. | MM/DD/YYYY HH:MM am/pmDAY_OF_WEEK HH:MM am/pmDAY_GROUP HH:MM am/pmDAY_OF_WEEK is one of:monday, tuesday, wednesday, thursday, friday, saturday, sundayDAY_GROUP is one of weekdays, weekends | 04/13/2022 4:50pmmonday 9amweekdays 10amweekends 9:55am |
| Specific time range | MM/DD/YYYY HH:MM am/pm - MM/DD/YYYY HH:MM am/pmDAY_OF_WEEK HH:MM am/pm - DAY_OF_WEEK HH:MM am/pmDAY_OF_WEEK HH:MM am/pm - HH:MM am/pmDAY_GROUP HH:MM am/pm - HH:MM am/pmDAY_OF_WEEK is one of:monday, tuesday, wednesday, thursday, friday, saturday, sundayDAY_GROUP is one of weekdays, weekends | 12/1/2022 5am - 12/15/2022 9ammonday 9am - friday 5pmweekdays 12am - 6amweekends 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
periodalong withday_of_weekand/ortime_rangeslets you trigger it periodically within those time ranges - Setting
day_of_weekvalues along withtime_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.
| Path | Type | Description |
|---|---|---|
nodes.<node_id>.triggered | boolean | True if current time matches the configuration, else False |
nodes.<node_id>.triggered_delta | boolean | True if the triggered property changed from False to True in this frame, else False |
nodes.<node_id>.type | string | Identifies the node type that produced this metadata. |
JSON example
{
"nodes": {
"time_trigger1": {
"triggered": true,
"triggered_delta": false,
"type": "time_trigger"
}
}
}Updated 3 days ago
