Sets the MQTT config for a particular camera.
Object Position Events from the camera will be published to the MQTT broker specified in the MQTT config.
What is MQTT?
MQTT (Message Queuing Telemetry Transport) is a lightweight and open-source messaging protocol designed for efficient communication between devices in a network. MQTT uses a publish and subscribe architecture, where devices (clients) can publish messages to specific topics or subscribe to receive messages on particular topics. In this scenario, the Verkada camera publishes real-time positions of detected people and vehicles to an MQTT server, acting as the subscriber.
This is a great way to extrapolate the people and vehicle data being processed by the camera for real-time computation or additional analysis. Because the MQTT publisher also returns the exact position of each object, users can gain additional insight as to traffic or behavior patterns within their sites.
How to use MQTT with Verkada cameras?
This POST endpoint allows users to set the MQTT configuration for a Verkada camera in their Command organization. To set a camera's MQTT configuration, users will need to input the following:
- The CA (Certificate Authority) signed certificate which will be used to secure the TLS connection between the camera and the MQTT server.
- The host and port number of the MQTT server to allow communication between the camera and the MQTT broker. Users can input the server's IP address or hostname as the host value. Communication is only supported over ports 443, 123, and 53 (although port 443 is strongly recommended).
- The proper formatting for this field when using port 443 is the following:
10.0.0.156:443
orserver.hostname:443
- The proper formatting for this field when using port 443 is the following:
- The Verkada camera ID from which to retrieve the published events from.
- (Optional) If the MQTT server has a username and password, make sure to input the credentials in the optional
client_username
andclient_password
fields.
Once the MQTT configuration has been set on the camera, the Object Position Events will be directly published to the MQTT server up to 10 times per second. These Object Position Events (seen below) are an array representing the people and vehicle detections being made by the camera in real-time. The following parameters listed in the table can be found in the returned JSON file.
Object Position Event Schema
Parameter | Type | Description |
---|---|---|
camera_id | Integer | The unique identifier of the camera. |
objects | Array of Objects | An array of objects that were detected. |
obj_id | Integer | The unique identifier of the detected object. |
detections | Array of Detections | An array of instances where the objects were detected. |
timestamp | Integer | The time where the object was detected. Formatted as a Unix timestamp in milliseconds. |
x1, y1 | Integer | The coordinates of the upper-left corner of the detected object. Measured as the relative distance in pixels form the upper-left corner of the image. |
x2, y2 | Integer | The coordinates of the bottom-right corner of the detected object. Measured as the relative distance in pixels form the bottom-right corner of the image. |
Example of Object Position Event
{
"camera_id": "9863f032-f354-4bf6-94b1-e9ae84406809",
"objects": [
{
"obj_id": 165879446013500,
"type": "person",
"detections": [
{
"timestamp": 1658794462235,
"x1": 0.2589378356933594,
"y1": 0.34261420369148254,
"x2": 0.34516018629074097,
"y2": 0.6407618522644043
}
]
},
{
"obj_id": 165879445343501,
"type": "person",
"detections": [
{
"timestamp": 1658794462235,
"x1": 0.19411784410476685,
"y1": 0.3762255311012268,
"x2": 0.27725690603256226,
"y2": 0.667906641960144
}
]
}
]
}