blakeblackshear/frigate-hass-integration

Weird logic of Clips creation depending on event type (Alert, Detection)

Closed this issue · 4 comments

Version of the custom_component

Frigate 14.0
Integration v5.4.0

Configuration

Only relevant part of the configuration showing alerts setup per camera

cameras:
  outdoor:
    review:
      alerts:
        labels:
          - person
        required_zones:
          - gate
  indoor:
    review:
      alerts:
        labels: []
        required_zones: []

Describe the bug

I have two cameras, indoor and outdoor.
Outdoor is configured to only consider Alerts when "person" is in the "gate" zone, the rest are Detections.
Indoor is configured that none is an Alert (empty arrays in config), everything goes to Detections.

In native Frigate UI everything is displayed correctly according to config, i.e. Alerts and Detections from outdoor, only Detections from indoor.

Strange things happens in HA though: In Media Browser -> Clips, and in the card (https://github.com/dermotduffy/frigate-hass-card) when viewing clips, there are only Alerts from outdoor, not a single Detection; while from indoor, all the Detections are there.
So I guess current logic is maybe "For particular camera, show ONLY Alerts if there's any, and show Detections if there's no Alerts" - which is weird, why not to show both Alerts and Detections from outdoor?

Debug log

No relevant logs

You're referring to a new system in 0.14 that the integration doesn't support. The integration uses the old events, this is working as expected based on how you've described your config.

@NickM-27 can you clarify a little bit more, why Detections from outdoor camera do not produce Clips? If the integration can't tell the difference between Alerts and Detections, I would expect it to create Clips for both.

If it can create Clips for Alerts on one camera, and it also can create Clips for Detections on another camera, so why there's no Detections for the first one?

Is it something weird is happening on the Frigate side so that it does not notify on Detections if there are Alerts?

I would expect it to create Clips for both.

the integration does not decide what is created, that is frigate. Because you have required zones for the outdoor camera frigate is making some assumptions based on the way things worked in the past ("detections" were never saved as events before 0.14, only alerts) and only creating events for objects that entered that required zone.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.