Skip to content

Events Payload

Object detection event payload

Overview

Traffic Monitor object detection events are generated by the connected sensors by performing object detection to identify instances of roadway users such as cars, bikes, pedestrians, and more. Additional data and metadata may also be added via other sensors and processes to create an event payload.

Hardware and Software

The camera is the primary detection method, powered by Frigate NVR. Events are created by optical camera observation and machine learning-powered object detectors inferencing the video frames to label available objects.

Future feature: The radar may also generate object detection events. This is particularly useful for nighttime and low-light conditions or even deployments that do not utilize a camera. See Radar Payload for more information on radar readings.

Frigate MQTT Incoming Payload

Events are recorded via the Frigate MQTT integration on the frigate/events topic containing type: "end",which indicates a complete capture event. See Frigate documentation for a full list of available attributes.

Events Database

Events Database

The following attributes are captured, by default, into tmdb.events.sqlite: The following attributes are captured, by default, into tmdb.events.sqlite:

AttributeDescriptionSQLite data typeValid values
idUUID for object detection. Will be generated by `source`
Frigate-generated from MQTT event `end`.
Radar-generated from flow.
TEXT, PRIMARY KEYFrigate: Unix timestamp in seconds concatenated to a hyphen and randomly-generated 6-alphanumeric value; e.g. "1721144705.617111-fg3luy"
Radar: Unix timestamp in seconds concatenated to a hyphen and randomly-generated 8-alphanumeric value concatenated with a hypen r '-r'; e.g. "1721144705.617111-fg3luy4x-r"
cameraName of camera for object detection (defined in Frigate config).
Frigate-generated from MQTT event `end`.
TEXTFree-text
labelObject label assigned by Frigate.
Frigate-generated from MQTT event `end`.
TEXTAssigned by model, based on Frigate available objects
sub_labelAdditional informatoin assigned to Frigate event.
Frigate-generated from MQTT event `end`.
TEXTAssigned via Frigate HTTP API
top_scoreModel inference score for object label. This is the highest score as object moved through field of view.
Frigate-generated from MQTT event `end`.
REAL0-1 value
frame_timeUnix timestamp in seconds for when the object was optimally identified by Frigate for the field of view.
Frigate-generated from MQTT event `end`.
REALUnix timestamp in Seconds
start_timeUnix timestamp in seconds for when the object first entered the field of view.
Frigate-generated from MQTT event `end`.
REALUnix timestamp in Seconds
end_timeUnix timestamp in seconds for when the object exited the field of view.
Frigate-generated from MQTT event `end`.
REALUnix timestamp in Seconds
entered_zonesJSON array list of zones in order the object entered each zone. Specified zones are used for various calculations.
Frigate-generated from MQTT event `end`.
TEXTFree-text via Frigate; expected:
- "zone_capture" - region for counting objects
- "zone_radar" - radar detection field of view (FOV)
- "zone_near" - area closest to radar, for determining visual direction
- "zone_far" - area furthest from radar, for determining visual direction
scoreModel inference score for the object to initiate tracking. Computed score as object moves through field of view.
Frigate-generated from MQTT event `end`.
REAL0-1 value
areaWidth*height of the bounding box for the detected object
Frigate-generated from MQTT event `end`.
REAL0-24000000
ratioWidth/height of the bounding box for the detected object; e.g. 0.5 is tall (twice as high as wide box)
Frigate-generated from MQTT event `end`.
REAL0-24000000
motionless_countNumber of frames the object has been motionless
Frigate-generated from MQTT event `end`.
REALInteger count; e.g. 0
position_changesNumber of times the object has changed position
Frigate-generated from MQTT event `end`.
REALInteger count; e.g. 2
attributesAttributes with top score that have been identified on the object at any point
Frigate-generated from MQTT event `end`.
TEXT, JSONJSON object with key:value pairs; e.g. {"face": 0.86}
direction_calcAssigned object moving direction relative to device placement; i.e. "outbound" is moving away from device.TEXT"outbound" or "inbound"
speed_calcAssigned speed/velocity calculated for entire time object was in the camera's field of view.REALPositive, Negative corresponding to inbound and outbound direction, respectively
provenanceSource(s) of event detection. List any sensor on the device that captured or created this event. The first item in the array is considered the primary source.TEXT, JSONJSON Array with every sensor that confirms the same event. e.g. Camera sensor: frigate, Radar sensor: radar
radarNameRadar sensor name that is associated (via config) with the camera during the event, regardless if event was confirmed by radar (see provenance).TEXTFree-text, defined from configs
deployment_idEach ID represents a unique deployment configuration and/or location for the device. This acts a foreign key link to the `deployment` table, `id` column.TEXT, FOREIGN KEY`deployment`.`id` foreign key, may be null

Telemetry

HTTP Telemetry

ThingsBoard HTTP upload telemetry API requests are sent for each event as a single JSON payload containing:

  • ts: frame_time * 1000 - to make it milliseconds
  • values: {event:values}- contains all attributes in Events Database

MQTT Publications

MQTT Publications

The primary event are available on-device for downstream subscriptions (e.g. Home Assistant):

Additionally, there is a daily cumulative object count utilized for the on-device dashboard and connected displays:

  • Topic: tm/events
  • Payload: Daily cumulative counts of detected objects (resets at 0400 local time). Note, these can be adjusted in the Frigate config for Available Objects.
  • car
  • person
  • bicycle
  • motorcycle
  • bicycle_adj - bicycle plus motorcycle - adjust for eBikes, but this is addressed now by Frigate configs for each object and is unnecessary for most deployments
  • person_adj - person minus bicycle - Essentially represents "pedestrian count" since every bicycle will have [at least one] rider that is detected independently of the bike.
    • Scooters and other transit modes will likely only count as a person using the base model.
    • Cars never have a person identified inside of them with the base model.
  • person_adj - person minus bicycle - Essentially represents "pedestrian count" since every bicycle will have [at least one] rider that is detected independently of the bike.
    • Scooters and other transit modes will likely only count as a person using the base model.
    • Cars never have a person identified inside of them with the base model.
  • dog
  • cat