From c6991db432df89f8a12736e4274f2287ccf7a540 Mon Sep 17 00:00:00 2001 From: leccelecce <24962424+leccelecce@users.noreply.github.com> Date: Thu, 19 Mar 2026 20:46:37 +0000 Subject: [PATCH] MQTT: Publish "stopped" to available topic on app stop (#22527) * Publish "stopped" to available topic on app stop * Add docs --- docs/docs/integrations/mqtt.md | 3 ++- frigate/comms/mqtt.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/docs/integrations/mqtt.md b/docs/docs/integrations/mqtt.md index 0a04e7be6..49d1a20e8 100644 --- a/docs/docs/integrations/mqtt.md +++ b/docs/docs/integrations/mqtt.md @@ -11,7 +11,8 @@ These are the MQTT messages generated by Frigate. The default topic_prefix is `f Designed to be used as an availability topic with Home Assistant. Possible message are: "online": published when Frigate is running (on startup) -"offline": published after Frigate has stopped +"stopped": published when Frigate is stopped normally +"offline": published automatically by the MQTT broker if Frigate disconnects unexpectedly (via MQTT Will Message) ### `frigate/restart` diff --git a/frigate/comms/mqtt.py b/frigate/comms/mqtt.py index dfb81fb97..89a986e08 100644 --- a/frigate/comms/mqtt.py +++ b/frigate/comms/mqtt.py @@ -38,6 +38,7 @@ class MqttClient(Communicator): ) def stop(self) -> None: + self.publish("available", "stopped", retain=True) self.client.disconnect() def _set_initial_topics(self) -> None: