From f0e836e5b6657e9ab529e6407b622c02bd9f866b Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Sat, 1 Oct 2022 08:01:43 -0600 Subject: [PATCH] Update MQTT along with enabling motion detection (#3898) --- frigate/mqtt.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frigate/mqtt.py b/frigate/mqtt.py index a1e564f7d..82e1c4f0f 100644 --- a/frigate/mqtt.py +++ b/frigate/mqtt.py @@ -84,6 +84,8 @@ def create_mqtt_client(config: FrigateConfig, camera_metrics): f"Turning on motion for {camera_name} due to detection being enabled." ) camera_metrics[camera_name]["motion_enabled"].value = True + state_topic = f"{message.topic[:-11]}/motion/state" + client.publish(state_topic, payload, retain=True) elif payload == "OFF": if camera_metrics[camera_name]["detection_enabled"].value: logger.info(f"Turning off detection for {camera_name} via mqtt")