[Beta Support]: mqtt frigate/available topic doesn't post offline message at shutdown #21928
Replies: 3 comments 4 replies
-
|
The error seems to indicate the frigate is getting disconnected from the mqtt server before it is able to sucessfully publish the "offline" message. I'm using the mqtt server (mosquito) that is suggested for home assistant. |
Beta Was this translation helpful? Give feedback.
-
|
The "offline" payload is published by your MQTT broker itself, not Frigate. This is part of MQTT's "last will and testament" when:
So if Frigate restarts, reconnects, and sends an This particular code in Frigate to tell your broker to publish Line 205 in 6accc38 See this discussion: #13382 |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for linking to the discussion, it's helpful to understand the background of the problem. I believe I'm still having the same issue as @bchhabra who was struggling in 2024 about how to determine when Frigate has been restarted within Home Assistant. Right now I have an MQTT binary_sensor configured in Home Assistant to watch for when frigate/available goes from online to offline or vice versa; when that happens I check certain conditions and toggle certain cameras on or off. For some reason, this used to work for me and now it does not. If the code in Frigate has not changed, the only other option is the Home Assistant Mosquitto broker defaults must have changed. According to that discussion, it was never possible to have the keep-alive set to lower than 15 seconds, but I believe I have restarted my Frigate instance many times in periods shorter than that and it got triggered correctly. I'm still puzzled though, because I do not see anywhere to configure the Mosquitto Broker to set the keep-alive value. And any discussions I find on that refer to the client library being the place where this keep-alive value is set. So should I open a separate request to ask how to monitor when frigate gets restarted instead of using frigate/available? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the problem you are having
the mqtt topic for frigate/available does not post an offline message when it shuts down like it used to. I'm not sure when this started happening, but I do recall it working in the 0.16.0 days, because I have scripts which monitor this state.
It does post the "online" message when it starts up correctly.
Beta Version
0.17.0-rc1
Issue Category
Other
Frigate config file
Relevant Frigate log output
Relevant go2rtc log output (if applicable)
No response
Install method
Docker Compose
docker-compose file or Docker CLI command
Operating system
Debian
CPU / GPU / Hardware
Intel(R) N100
Screenshots
No response
Steps to reproduce
run:
docker compose up
The mqtt message for frigate/available/online appears.
Ctrl-C (to stop the docker instance)
mqtt message frigate/available/online persists (it's a retained message); no "offline" replaces it after the frigate docker instance has stopped running
Any other information that may be helpful
No response
Beta Was this translation helpful? Give feedback.
All reactions