Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Review:Alert/Detection settings to MQTT so they can be enabled/disabled via home assistant #13038

Open
Jurykov opened this issue Aug 13, 2024 · 5 comments
Labels
enhancement New feature or request pinned

Comments

@Jurykov
Copy link

Jurykov commented Aug 13, 2024

Describe what you are trying to accomplish and why in non technical terms
My cameras are setup to detect and record 24/7, but I'm really only interested in reviewing events that happen when no-one is home. It would be nice to be able to not have to acknowledge hundreds of Alerts and Detections in the review section, when I'm only interested in Alerts that happen during certain time periods. I'd still like to record any events for potential review later if something unusual happens, so I'm not interested in disabling detection completely, but it would be nice to flag items as Alerts, only if certain conditions are met.

Describe the solution you'd like
My Home assistant instance tracks when people leave, and arrive. It could enable/disable alerts appropriately if these settings were exposed to MQTT like RECORDINGS, DETECT, MOTION, etc. are.

Describe alternatives you've considered
Again, I could disable detections completely when no one is home, but then I would lose the flagging of person, dog, and so on in the review tab. It sounds like per user reviews are coming in a later version. Perhaps there could be some more granularity in the settings as to what is an Alert or Detection per user?

@Jurykov Jurykov added the enhancement New feature or request label Aug 13, 2024
@mavacpjm
Copy link

I second this request, would be awesome to have this additional functionality with conditions to alert...

@phoenixtechnam
Copy link

I also support this. But instead of defining time frames I would couple it with Home Assistant's Alarm Control Panel, e.g. only create Alerts when the Alarm Control Panel is in a specific state, e.g. "Armed Home", independent of the alarm actually being triggered by that alert.

@Jurykov
Copy link
Author

Jurykov commented Aug 15, 2024

I also support this. But instead of defining time frames I would couple it with Home Assistant's Alarm Control Panel

Exactly. Not based on time frames, but based on when no one is home, e.g. when the alarm in home assistant is turned on. If this was exposed either via mqtt, or an API it could be toggled appropriately from a home assistant automation.

I'm just getting too many 'alerts' from Frigate in the review panel to be useful. I'm trying to work out some way to better filter them so I don't see hundreds of alerts of me walking around my house in the evening. Maybe the solution is to just disable detections completely when I'm home, but then I'd lose some data that is potentially useful to me.

@MintyTrebor
Copy link

A quick thought: Is it possible to set up 2 different configurations for the same camera feed, one with alerts enabled the other without, then swap between disabling record/detect/motion on the "alerting" camera config, and enabling record/detect/motion on "non alerting" camera according to the trigger/scenario you need?

@d-steve
Copy link

d-steve commented Aug 17, 2024

I definitely want this for similar reasons: using Home Assistant to only enable certain alerts/detections at night or when away.

Best workaround I’ve found is to run an automation in Home Assistant to mark as read (or delete) for new review items that fall outside the desired criteria.

Create a rest_command in HA configuration.yaml (or use a curl command) to mark an ID as reviewed:

rest_command:
  frigate_mark_reviewed:
    url: 'http://<frigate>:5000/api/reviews/viewed'
    method: POST
    payload: '{ "ids": ["{{ id }}" ] }'
    content_type: 'application/json; charset=utf-8'

Then an automation:

alias: Frigate mark as reviewed
description: ""
trigger:
  - platform: mqtt
    topic: frigate/reviews
  - condition: template
    value_template: >-
      {{ trigger.payload_json['after']['severity'] == 'detection' and
      trigger.payload_json['type'] == 'end' }}
action:
  - service: rest_command.frigate_mark_reviewed
    metadata: {}
    data:
      id: "{{ trigger.payload_json['after']['id'] }}"
mode: single

Where you can modify the conditions as needed based on sensor status, time of day, review item attributes, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pinned
Projects
None yet
Development

No branches or pull requests

6 participants