Support all audio type in MQTT

This commit is contained in:
Nicolas Mowen 2025-08-26 08:17:03 -06:00
parent 6c3f99150c
commit d6ff8d1172
2 changed files with 3 additions and 0 deletions

View File

@ -279,6 +279,8 @@ The height and crop of snapshots can be configured in the config.
Publishes "ON" when a type of audio is detected and "OFF" when it is not for the camera for use as a sensor in Home Assistant.
`all` can be used as the audio_type for the status of all audio types.
### `frigate/<camera_name>/audio/dBFS`
Publishes the dBFS value for audio detected on this camera.

View File

@ -181,6 +181,7 @@ class AudioActivityManager:
new_detections = new_activity[camera].get("detections", [])
if self.compare_audio_activity(camera, new_detections, now):
logger.debug(f"Audio detections for {camera}: {new_activity}")
self.publish(f"{camera}/audio/all", "ON" if len(self.current_audio_detections[camera]) > 0 else "OFF")
self.publish(
"audio_detections",
json.dumps(self.current_audio_detections),