MQTT
这些是 Frigate 生成的 MQTT 消息。默认 topic_prefix 为 frigate
,但可在配置文件中更改。
一般主题
frigate/available
可用性主题。可能的消息有 "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_time": 1607123961.837752,
"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,
"stationary": false, // whether or not the object is considered stationary
"motionless_count": 0, // number of frames the object has been motionless
"position_changes": 2, // number of times the object has moved from a stationary position
"attributes": {
"face": 0.64
}, // attributes with top score that have been identified on the object at any point
"current_attributes": [] // detailed data about the current attributes in this frame
},
"after": {
"id": "1607123955.475377-mxklsc",
"camera": "front_door",
"frame_time": 1607123962.082975,
"snapshot_time": 1607123961.837752,
"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,
"stationary": false, // whether or not the object is considered stationary
"motionless_count": 0, // number of frames the object has been motionless
"position_changes": 2, // number of times the object has changed position
"attributes": {
"face": 0.86
}, // attributes with top score that have been identified on the object at any point
"current_attributes": [
// detailed data about the current attributes in this frame
{
"label": "face",
"box": [442, 506, 534, 524],
"score": 0.86
}
]
}
}
frigate/stats
以可配置的时间间隔发布的数据,同样的数据可在 /api/stats
中获取。
摄像机主题
frigate/<camera_name>/<object_name>
发布摄像机的目标检测计数,以便在 Home Assistant 中用作传感器。all
可以用作摄像机所有目标检测计数的目标名称。
frigate/<zone_name>/<object_name>
发布防区的目标检测计数,以便在 Home Assistant 中用作传感器。all
可以用作该防区所有目标检测计数的目标名称。
frigate/<camera_name>/<object_name>/snapshot
发布检测到的目标类型的 jpeg 编码帧。当不再检测到目标时,将发布置信度最高的图像或再次发布原始图像。
抓帕的高度和裁剪可以进行配置。
frigate/<camera_name>/audio/<audio_type>
当检测到某种音频类型时,发布"ON"消息;当不再检测到音频类型时,会发布"OFF"消息,以便在 Home Assistant 中用作传感器。
frigate/<camera_name>/audio/dBFS
发布此摄像机音频检测的 dBFS 值。
NOTE: 需要启用音频检测
frigate/<camera_name>/audio/rms
发布此摄像机音频检测的 rms 值。
NOTE: 需要启用音频检测
frigate/<camera_name>/detect/set
用于打开或关闭摄像机目标检测的主题。预期值为 ON
和 OFF
。
frigate/<camera_name>/detect/state
摄像机当前目标检测状态的主题。发布的值为 ON
和 OFF
。
frigate/<camera_name>/audio/set
用于打开或关闭摄像机音频检测的主题。预期值为 ON
和 OFF
。
frigate/<camera_name>/audio/state
摄像机当前音频检测状态的主题。发布的值为 ON
和 OFF
。
frigate/<camera_name>/recordings/set
用于打开和关闭摄像机录像的主题。预期值为 ON
和 OFF
。
frigate/<camera_name>/recordings/state
摄像机当前录像状态的主题。发布的值为 ON
和 OFF
。
frigate/<camera_name>/snapshots/set
用于打开和关闭摄像机抓拍的主题。预期值为 ON
和 OFF
。
frigate/<camera_name>/snapshots/state
摄像机当前抓拍状态的主题。发布的值为 ON
和 OFF
。
frigate/<camera_name>/motion/set
用于打开和关闭摄像机动态侦测的主题。预期值为 ON
和 OFF
。
NOTE: 如果未禁用动态侦测,则关闭动态侦测将失败。
frigate/<camera_name>/motion
此名称摄像机当前是否正在进行动态侦测。预期值为 ON
和 OFF
。
NOTE: 动态侦测初始化后,ON
将一直持续到 mqtt_off_delay
设置的时间内(默认30秒)没有动态为止。
frigate/<camera_name>/motion/state
摄像机当前动态侦测状态的主题。发布的值为 ON
和 OFF
。
frigate/<camera_name>/improve_contrast/set
用于打开和关闭摄像机 improve_contrast
的主题。预期值为 ON
和 OFF
。
frigate/<camera_name>/improve_contrast/state
摄像机当前 improve_contrast
状态的主题。发布的值为 ON
和 OFF
。
frigate/<camera_name>/motion_threshold/set
用于调整摄像机动态阀值的主题。预期值是一个整数。
frigate/<camera_name>/motion_threshold/state
摄像机当前动态阀值的主题。发布的值是一个整数。
frigate/<camera_name>/motion_contour_area/set
用于调整摄像机动态 contour area
的主题。预期值是一个整数。
frigate/<camera_name>/motion_contour_area/state
摄像机当前动态 contour area
的主题。发布的值是一个整数。
frigate/<camera_name>/ptz
向摄像机发送 PTZ 命令的主题。
命令 | 描述 |
---|---|
preset_<preset_name> | send command to move to preset with name <preset_name> |
MOVE_<dir> | send command to continuously move in <dir> , possible values are [UP, DOWN, LEFT, RIGHT] |
ZOOM_<dir> | send command to continuously zoom <dir> , possible values are [IN, OUT] |
STOP | send command to stop moving |
frigate/<camera_name>/ptz_autotracker/set
用于打开和关闭摄像机PTZ自动跟踪器的主题。预期值为 ON
和 OFF
。
frigate/<camera_name>/ptz_autotracker/state
摄像机当前PTZ自动跟踪状态器的主题。发布的值为 ON
和 OFF
。
frigate/<camera_name>/ptz_autotracker/active
用于确定PTZ自动跟踪器是否在主动跟踪目标的主题。发布的值为 ON
和 OFF
。
frigate/<camera_name>/birdseye/set
用于打开或关闭摄像机鸟瞰的主题。预期值为 ON
和 OFF
。必须在配置中启用鸟瞰模式。
frigate/<camera_name>/birdseye/state
摄像机当前鸟瞰的主题。发布的值为 ON
和 OFF
。
frigate/<camera_name>/birdseye_mode/set
设置摄像机鸟瞰模式的主题。鸟瞰提供不同的模式,可自定义在何种情况下显示摄像机画面。
Note: 从 CONTINUOUS
-> MOTION | OBJECTS
更改值最多需要 30 秒钟才能将摄像机从视图中移除。
模式 | 描述 |
---|---|
CONTINUOUS | Always included |
MOTION | Show when detected motion within the last 30 seconds are included |
OBJECTS | Shown if an active object tracked within the last 30 seconds |
frigate/<camera_name>/birdseye_mode/state
摄像机当前鸟瞰模式的主题。发布的值为CONTINUOUS
, MOTION
, OBJECTS
。