#Frigate Snapshot

1 messages · Page 1 of 1 (latest)

amber rapids
#

I have an automation that sends a snapshot and the link to a camera stream to phones running the HA app when person is detected in a zone. Most of the time (96+%) it works fine. Occasionally it sends the most recent previous snapshot not the snapshot for the current detection. I added a 500 ms delay but it happened again. How I force a snapshot or force getting the most recent snapshot. I don't want to delay notifications

eternal oxide
#

you'd need to use the /events or /reviews topic via mqtt to get the event id and pull it using the api

amber rapids
#

I'm not using mqtt, I use a HA event, but I do use the API

description: ""
trigger:
  - type: occupied
    platform: device
    device_id: 1d6b6b0373474153b48b8f6ecec9937e
    entity_id: e527c1542b7226c8ecec5a2afce70022
    domain: binary_sensor
    for:
      hours: 0
      minutes: 0
      seconds: 0
condition:
  - condition: state
    entity_id: lock.front_door
    state: locked
    for:
      hours: 0
      minutes: 0
      seconds: 45
  - condition: time
    after: "07:00:00"
    before: "23:00:00"
    weekday:
      - sun
      - mon
      - tue
      - wed
      - thu
      - fri
      - sat
action:
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 500
  - data:
      title: PORCH ALERT!
      message: Person detected on front porch
      data:
        color: Red
        sticky: "true"
        priority: high
        clickAction: "{{server}}/dashboard-doorbell/doorbell"
        image: >-
          {{server}}/api/image_proxy/image.doorbell_person?token={{access_token}}
        actions:
          - action: URI
            title: View Stream
            uri: "{{server}}/dashboard-doorbell/doorbell"
          - action: SILENCE_NOTIFY
            title: Silence Notification (10)
    action: notify.{{phone}}
  - action: script.porch_announce
    data: {}
  - delay:
      hours: 0
      minutes: 0
      seconds: 20
      milliseconds: 0
mode: single
variables:
  server: https://secret.ui.nabu.casa
  camera_location: doorbell
  camera_entity: camera.{{camera_location}}
  image: "{{state_attr(camera_entity,'entity_picture')}}"
  camera_name: "{{state_attr(camera_entity,'friendly_name')}}"
  access_token: "{{ state_attr('image.doorbell_person', 'access_token') }}"
  phone: Family_Notification
max_exceeded: silent
max: 6
trace:
  stored_traces: 10
#

This has worked reliably until 14.x

eternal oxide
#

we have had some people say similar but this part of the code was not changed and I can't reproduce so it is really not clear why the behavior changed. We are most likely doing to be redoing that part of the code in a future update

analog hill
#

I've been trying to track down what's maybe a similar issue where I get a trigger from the "events" or "reviews" topics, but I get an "event not found" when I try to send a notification with the thumbnail and clip via the HA API endpoint. I can reproduce it when I try to visit the endpoint from my browser, but (sometimes?) the thumbnail/clip eventually become available. It's like there's a race condition or delay that results in sending the "new" message before the media is available. It's annoying to track down because it works fine about 60% of the time for me, and then (sometimes? all the time?) when I try to reproduce the failure in a browser later

amber rapids
#

Yeah. I'm not even sure how to debug this. I suspect that some times the current snapshot is delayed and that's why I get the previous snapshot.

analog hill
#

the API calls are something like /api/frigate/notifications/1726524531.903407-wxxp1m/thumbnail.jpg that include the timestamp and what appears to be a random string, so it seems unlikely that there would be a conflict

eternal oxide
analog hill
#

The same automation was bulletproof with Frigate 0.13, but has been very hit-or-miss with 0.14. If the code didn't change, I don't know why it would behave differently for me

eternal oxide
#

you aren't alone so it is clear something happened, but it really doesn't make sense what

#

0.15 reworks some things so it is possible it is already fixed

analog hill
#

Maybe I'll try that and see if it helps

#

Sometimes I see the media on my iPhone, but not on my Apple Watch, which I think retrieves it separately

amber rapids