MQTT
由于本文涉及过多专业领域内容,对普通用户帮助不算特别多,将不会进行精翻;本文使用DeepSeek AI进行翻译,仅做参考。
这些是由Frigate生成的MQTT消息。默认的主题前缀是frigate
,但可以在配置文件中更改。
Frigate通用主题
frigate/available
设计用于与Home Assistant的可用性主题配合使用。可能的消息有: "online":当Frigate运行时发布(在启动时) "offline":当Frigate停止后发布
frigate/restart
导致Frigate退出。Docker应该配置为在退出时自动重启容器。
frigate/events
为每个变化的跟踪对象发布消息。当跟踪对象不再被标记为false_positive时发布第一条消息。当Frigate找到跟踪对象的更好快照或发生区域变化时,它将发布具有相同id的消息。当跟踪对象结束时,将发布一条带有end_time
设置的最终消息。
{
"type": "update", // new(新建), update(更新), end(结束)
"before": {
"id": "1607123955.475377-mxklsc",
"camera": "front_door",
"frame_time": 1607123961.837752,
"snapshot": {
"frame_time": 1607123965.975463,
"box": [415, 489, 528, 700],
"area": 12728,
"region": [260, 446, 660, 846],
"score": 0.77546,
"attributes": [],
},
"label": "person",
"sub_label": null,
"top_score": 0.958984375,
"false_positive": false,
"start_time": 1607123955.475377,
"end_time": null,
"score": 0.7890625,
"box": [424, 500, 536, 712],
"area": 23744,
"ratio": 2.113207,
"region": [264, 450, 667, 853],
"current_zones": ["driveway"],
"entered_zones": ["yard", "driveway"],
"thumbnail": null,
"has_snapshot": false,
"has_clip": false,
"active": true, // 便利属性,与"stationary"相反
"stationary": false, // 对象是否被认为是静止的
"motionless_count": 0, // 对象保持静止的帧数
"position_changes": 2, // 对象从静止位置移动的次数
"attributes": {
"face": 0.64
}, // 在对象上任何时候被识别的具有最高分数的属性
"current_attributes": [], // 此帧中当前属性的详细数据
"current_estimated_speed": 0.71, // 通过启用速度估算的区域移动的对象的当前估计速度(mph或kph)
"velocity_angle": 180, // 通过启用速度估算的区域移动的对象相对于帧的行进方向
"recognized_license_plate": "ABC12345", // 汽车对象的已识别车牌
"recognized_license_plate_score": 0.933451
},
"after": {
"id": "1607123955.475377-mxklsc",
"camera": "front_door",
"frame_time": 1607123962.082975,
"snapshot": {
"frame_time": 1607123965.975463,
"box": [415, 489, 528, 700],
"area": 12728,
"region": [260, 446, 660, 846],
"score": 0.77546,
"attributes": [],
},
"label": "person",
"sub_label": ["John Smith", 0.79],
"top_score": 0.958984375,
"false_positive": false,
"start_time": 1607123955.475377,
"end_time": null,
"score": 0.87890625,
"box": [432, 496, 544, 854],
"area": 40096,
"ratio": 1.251397,
"region": [218, 440, 693, 915],
"current_zones": ["yard", "driveway"],
"entered_zones": ["yard", "driveway"],
"thumbnail": null,
"has_snapshot": false,
"has_clip": false,
"active": true, // 便利属性,与"stationary"相反
"stationary": false, // 对象是否被认为是静止的
"motionless_count": 0, // 对象保持静止的帧数
"position_changes": 2, // 对象改变位置的次数
"attributes": {
"face": 0.86
}, // 在对象上任何时候被识别的具有最高分数的属性
"current_attributes": [
// 此帧中当前属性的详细数据
{
"label": "face",
"box": [442, 506, 534, 524],
"score": 0.86
}
],
"current_estimated_speed": 0.77, // 通过启用速度估算的区域移动的对象的当前估计速度(mph或kph)
"velocity_angle": 180, // 通过启用速度估算的区域移动的对象相对于帧的行进方向
"recognized_license_plate": "ABC12345", // 汽车对象的已识别车牌
"recognized_license_plate_score": 0.933451
}
}
frigate/tracked_object_update
当跟踪对象元数据更新时发布的消息,例如当GenAI运行并返回跟踪对象描述时。
{
"type": "description",
"id": "1607123955.475377-mxklsc",
"description": "The car is a red sedan moving away from the camera."
}
frigate/reviews
为每个变化的核查项目发布消息。当检测
或警报
初始化时发布第一条消息。当检测到其他对象或发生区域变化时,会发布具有相同id的update
消息。当核查活动结束时,发布最终的end
消息。
{
"type": "update", // new(新建), update(更新), end(结束)
"before": {
"id": "1718987129.308396-fqk5ka", // review_id(核查ID)
"camera": "front_cam",
"start_time": 1718987129.308396,
"end_time": null,
"severity": "detection",
"thumb_path": "/media/frigate/clips/review/thumb-front_cam-1718987129.308396-fqk5ka.webp",
"data": {
"detections": [
// 事件ID列表
"1718987128.947436-g92ztx",
"1718987148.879516-d7oq7r",
"1718987126.934663-q5ywpt"
],
"objects": ["person", "car"],
"sub_labels": [],
"zones": [],
"audio": []
}
},
"after": {
"id": "1718987129.308396-fqk5ka",
"camera": "front_cam",
"start_time": 1718987129.308396,
"end_time": null,
"severity": "alert",
"thumb_path": "/media/frigate/clips/review/thumb-front_cam-1718987129.308396-fqk5ka.webp",
"data": {
"detections": [
"1718987128.947436-g92ztx",
"1718987148.879516-d7oq7r",
"1718987126.934663-q5ywpt"
],
"objects": ["person", "car"],
"sub_labels": ["Bob"],
"zones": ["front_yard"],
"audio": []
}
}
}
frigate/stats
与/api/stats
相同的数据,按可配置的间隔发布。
frigate/camera_activity
返回每个摄像头的当前功能状态,包括是否检测到运动、对象等。可以通过向frigate/onConnect
发布消息来触发。
frigate/notifications/set
控制通知开关的主题。期望值为ON
和OFF
。
frigate/notifications/state
通知当前状态的主题。发布值为ON
和OFF
。
Frigate摄像头主题
frigate/<camera_name>/<object_name>
发布摄像头检测到的对象数量,用于Home Assistant传感器。
all
可作为object_name表示摄像头所有对象的计数。
frigate/<camera_name>/<object_name>/active
发布摄像头检测到的活动对象数量,用于Home Assistant传感器。
all
可作为object_name表示摄像头所有活动对象的计数。
frigate/<zone_name>/<object_name>
发布区域内检测到的对象数量,用于Home Assistant传感器。
all
可作为object_name表示区域内所有对象的计数。
frigate/<zone_name>/<object_name>/active
发布区域内活动对象的数量,用于Home Assistant传感器。
all
可作为object_name表示区域内所有活动对象的计数。
frigate/<camera_name>/<object_name>/snapshot
发布检测到对象类型的JPEG编码帧。当对象不再被检测到时,发布最高置信度的图像或重新发布原始图像。
快照的高度和裁剪可在配置中设置。