diff --git a/frigate/app.py b/frigate/app.py index 7de851234..43ce04425 100644 --- a/frigate/app.py +++ b/frigate/app.py @@ -255,6 +255,8 @@ class FrigateApp: args=( name, config, + self.mqtt_client, + self.config.mqtt.topic_prefix, model_shape, self.config.model.merged_labelmap, self.detection_queue, diff --git a/frigate/video.py b/frigate/video.py index c7fc62ad5..872b29082 100755 --- a/frigate/video.py +++ b/frigate/video.py @@ -340,6 +340,8 @@ def capture_camera(name, config: CameraConfig, process_info): def track_camera( name, config: CameraConfig, + mqtt_client, + mqtt_prefix, model_shape, labelmap, detection_queue, @@ -381,6 +383,8 @@ def track_camera( process_frames( name, + mqtt_client, + mqtt_prefix, frame_queue, frame_shape, model_shape, @@ -468,6 +472,8 @@ def detect( def process_frames( camera_name: str, + mqtt_client, + mqtt_prefix, frame_queue: mp.Queue, frame_shape, model_shape, @@ -518,6 +524,9 @@ def process_frames( # look for motion if enabled motion_boxes = motion_detector.detect(frame) if motion_enabled.value else [] + if mqtt_client: + mqtt_client(f"{mqtt_prefix}/{camera_name}/motion/detected", True if motion_boxes else False, False) + regions = [] # if detection is disabled