SgtBatten / HA_blueprints

Somewhere to store automation blueprints
151 stars 55 forks source link

[Config Support]: Notifications only work seemingly randomly #200

Closed sluflyer06 closed 1 month ago

sluflyer06 commented 2 months ago

Describe the problem you are having or the outcome you are trying to achieve.

So i have Frigate setup and it never fails to miss someone and make its event with a clip internal to frigate, checking the logbook in HA i see events from the integration all the time, the issue is that less than half the time frigate tags a "person" (or any object) does any phone actually get a notification, sometimes it works, sometimes it doesn't and I can't find a pattern.

Version

0.12.0.3c and 12.0.2 stable

Automation config

- id: '1713820186133'
  alias: Frigate Notifications (0.12.0.3c)
  description: ''
  use_blueprint:
    path: SgtBatten/Beta.yaml
    input:
      camera: camera.frontdoor
      notify_device: f6e584a9eca3eb3e760fd9b5fd4c4d8d
      base_url: my URL HERE
      message: Someone has been spotted in the front yard
      attachment: snapshot.jpg
      update_thumbnail: true
      video: '{{base_url}}/api/frigate{{client_id}}/notifications/{{id}}/{{camera}}/clip.mp4'
      android_auto: true
      zone_filter: true
      zones:
      - yard
      labels:
      - person
      - dog
      - cat
      cooldown: 45
      trace:
  stored_traces: 20

Frigate Config

mqtt:
  host: 10.10.10.60
  port: 1883
#  client_id: frigate
  user: USER
  password: PASSWORD HERE
  topic_prefix: frigate
#  stats_interval: 60

objects:
  track:
  - person
  - dog
  - car
  - cat
  - motorcycle
  - bird

detectors:
  tensorrt:
    type: tensorrt
    device: 0 #This is the default, select the first GPU

model:
#  path: /trt-models/yolov7-tiny-416.trt
  path: /config/model_cache/tensorrt/yolov7-320.trt
  input_tensor: nchw
  input_pixel_format: rgb
  width: 320
  height: 320

cameras:
  frontdoor:
    zones:
      yard:
        coordinates: 21,555,716,565,708,433,12,319
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
      - path: 
          rtsp://admin:PASSWORD#@10.10.10.200:554/cam/realmonitor?channel=1&subtype=1&authbasic=64
        hwaccel_args: preset-nvidia-h264
        roles:
        - detect
        - rtmp
      - path: 
          rtsp://admin:PASSWORD@10.10.10.200:554/cam/realmonitor?channel=1&subtype=0&authbasic=64
        hwaccel_args: preset-nvidia-h264
        roles:
        - record
        - audio
    detect:
      width: 720
      height: 576
      fps: 5
    snapshots:
      enabled: true
      required_zones:
      - yard
    record:
      enabled: true
      retain:
        days: 7
        mode: all
      events:
        required_zones:
        - yard
        retain:
          default: 30
    motion:
      mask:
      - 339,264,720,294,720,0,0,0,0,218,65,258

Any other information that may be helpful

i've tried both stable and beta, with and without thumbnail updates, i've tried 2 automations, 1 for each phone, and all a notify group, i've look at traces but i can't tell what it's telling me. The attached trace is from me walking in front of the camera and frigate saw me and tagged me as a person but no notification was ever sent to the phone. Thank you! trace automation.frigate_notifications_0_12_0_3c_anthony2 2024-04-23T02_49_33.300691+00_00.json

PurelyAbrasive commented 1 month ago

My issue is kinda like this but only with camera's that have zone's. I am getting the events in Frigate but only randomly getting the notifications from HA.

sluflyer06 commented 1 month ago

So this issue comes down to the cooldown settings, events that are correctly not firing off notifications are still triggering the cooldown thus prevent the real notification from ever going out. For example, someone walking up to the front door the camera sees and sends and event triggering a cooldown so when the person finally gets into the zone it prevented from firing off a message because the cooldown is in effect. The only option was to reduce cooldown to around 2 seconds so that I could actually get notifications.

PurelyAbrasive commented 1 month ago

So this issue comes down to the cooldown settings, events that are correctly not firing off notifications are still triggering the cooldown thus prevent the real notification from ever going out. For example, someone walking up to the front door the camera sees and sends and event triggering a cooldown so when the person finally gets into the zone it prevented from firing off a message because the cooldown is in effect. The only option was to reduce cooldown to around 2 seconds so that I could actually get notifications.

That worked for me. I lowered the cooldown to like 5 sec and I started getting notifications.

SgtBatten commented 1 month ago

i hope to eventually move the object filter higher in the blueprint so that it fails before HA deems it to have run, thus alleviating this issue