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

PropertyValue
day_of_week Trigger on these days of the week. If null or empty, trigger on all days.

Type: Array of options. Options:
- sunday
- monday
- tuesday
- wednesday
- thursday
- friday
- saturday
period Trigger periodically

Options:
- null : Disabled
- day : Every day at 00:00
- hour : Every hour at 0 mins past the hour
- 30min : Every 30 mins, starting at 0 mins past the hour
- 15min : Every 15 mins, starting at 0 mins past the hour
- seconds : Every X seconds from start of deployment
interval Trigger at a fixed interval, when period is seconds.
Only required when period is seconds.

Ex. 60 will trigger at every sixty seconds.
time_ranges Comma separated times or time ranges to trigger at. If you specify days of week or dates as a part of the time ranges, you may want to leave out specifying day_of_week property above. See section below for format.

ex. 12pm to 4pm, 5pm, 8pm-9pm, weekdays 11pm - 11:30pm will set the trigger continuously :
- between 12pm and 4pm all days of week,
- then once at 5pm all days of week,
- and then continuously between 8pm and 9pm all days of week
- and lastly between 11pm and 11:30pm on weekdays
timezone Timezone.

Options:
- us/pacific
- us/central
- us/mountain
- us/eastern
- other : Specify offset from GMT using timezone_offset
timezone_offset Timezone Offset in hours from GMT, when timezone is other

Ex. 5.5 is GMT +5:30

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_WEEKis one of:
monday, tuesday, wednesday, thursday, friday, saturday, sunday

DAY_GROUP is one ofweekdays, 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_WEEKis one of:
monday, tuesday, wednesday, thursday, friday, saturday, sunday

DAY_GROUP is one ofweekdays, 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.

Metadata

Metadata PropertyDescription
nodes.<node_id>Format : as defined in the table below.

<node_id> for is of the form time_triggerX (ex. time_trigger1)

Example

"nodes": {
    "time_trigger1": {
        "type": "time_trigger",
        "triggered": True
    }
}

Format

KeyTypeDescription
triggeredBooleanTrue if current time matches the configuration, else False