From a87b53e3ace8c159c959ef997d05babc2271db41 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sun, 26 Jan 2025 09:21:55 -0600 Subject: [PATCH] v-m: Add alert for Frigate camera no video At some point this week, the front porch camera stopped sending video. I'm not sure exactly what happened to it, but Frigate kept logging "Unable to read frames from ffmpeg process." I power-cycled the camera, which resolved the issue. Unfortunately, no alerts were generated about this situation. Home Assistant did not consider the camera entity unavailable, presumably because Frigate was still reporting stats about it. Thus, I missed several important notifications. To avoid this in the future, I have enabled the "Camera FPS" sensors for all of the cameras in Home Assistant, and added this alert to trigger when the reported framerate is 0. I really also need to get alerts for log events configured, as that would also indicated there was an issue. --- victoria-metrics/alerts.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/victoria-metrics/alerts.yml b/victoria-metrics/alerts.yml index 94c4dda..3d3909c 100644 --- a/victoria-metrics/alerts.yml +++ b/victoria-metrics/alerts.yml @@ -132,6 +132,14 @@ groups: expr: homeassistant_entity_available{domain="camera"} != 1 for: 10m + - alert: No camera video frames + expr: + homeassistant_sensor_unit_fps{entity=~"sensor.*_camera_fps"} <= 0 + annotations: + summary: No video received from camera + description: >- + Frigate is not receiving video from the camera. The camera may be + offline. - name: Home Assistant rules: