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

[Config Support]: Snapshotless Notifications #338

Open
derpderpington opened this issue Jan 8, 2025 · 1 comment
Open

[Config Support]: Snapshotless Notifications #338

derpderpington opened this issue Jan 8, 2025 · 1 comment

Comments

@derpderpington
Copy link

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

Want all notifications to have snapshots.

Version

0.12.0.4e

Automation config

alias: CAM FRONT YARD
description: ""
use_blueprint:
  path: SgtBatten/Stable.yaml
  input:
    presence_filter:
      - ""
    camera: camera.front_yard
    notify_device: 59b3816da6797c61c8d14d7a850d30f7
    android_auto: true
    notify_group: ALL_DEVICES
    base_url: https://hass.domain.org/

Frigate Config

mqtt:
  host: 192.168.0.246
  user: hass
  password: mqttpass

detectors:
  tensorrt:
    type: tensorrt
    device: 0

model:
  path: /config/model_cache/tensorrt/8.5.3/yolov7-640.trt
  input_tensor: nchw
  input_pixel_format: rgb
  width: 640
  height: 640

ffmpeg:
  hwaccel_args: preset-nvidia-h265

#Global Detect Settings
detect:
  width: 3840
  height: 2160
  fps: 7
  enabled: true

#Global Object Settings
objects:
  track:
    - dog
    - person
    - horse
    - bicycle
    - cat
    - bear
    - car
  filters:
    horse:
      min_area: 3000
      threshold: 0.75

motion:
  # Optional: The threshold passed to cv2.threshold to determine if a pixel is different enough to be counted as motion. (default: shown below)
  # Increasing this value will make motion detection less sensitive and decreasing it will make motion detection more sensitive.
  # The value should be between 1 and 255.
  threshold: 60
  #lightning_threshold should be tweaked at camera level for DOOR BELL CAMERAS
  lightning_threshold: 0.4

record:
  enabled: true
  sync_recordings: true
  retain:
    days: 0
    mode: all
  alerts:
    retain:
      days: 30
  detections:
    retain:
      days: 30
snapshots:
  enabled: true
  retain:
    default: 30

go2rtc:
  streams:
    garage: 
      rtsp://admin:{FRIGATE_RTSP_PASSWORD}@192.168.0.107:554/cam/realmonitor?channel=1&subtype=0
    garage_sub: 
      rtsp://admin:{FRIGATE_RTSP_PASSWORD}@192.168.0.107:554/cam/realmonitor?channel=1&subtype=1

    driveway: 
      rtsp://admin:{FRIGATE_RTSP_PASSWORD}@192.168.0.107:554/cam/realmonitor?channel=2&subtype=0
    driveway_sub: 
      rtsp://admin:{FRIGATE_RTSP_PASSWORD}@192.168.0.107:554/cam/realmonitor?channel=2&subtype=1

    front_yard: 
      rtsp://admin:{FRIGATE_RTSP_PASSWORD}@192.168.0.107:554/cam/realmonitor?channel=3&subtype=0
    front_yard_sub: 
      rtsp://admin:{FRIGATE_RTSP_PASSWORD}@192.168.0.107:554/cam/realmonitor?channel=3&subtype=1

    trailer: 
      rtsp://admin:{FRIGATE_RTSP_PASSWORD}@192.168.0.107:554/cam/realmonitor?channel=4&subtype=0
    trailer_sub: 
      rtsp://admin:{FRIGATE_RTSP_PASSWORD}@192.168.0.107:554/cam/realmonitor?channel=4&subtype=1

    backyard_left: 
      rtsp://admin:{FRIGATE_RTSP_PASSWORD}@192.168.0.107:554/cam/realmonitor?channel=5&subtype=0
    backyard_left_sub: 
      rtsp://admin:{FRIGATE_RTSP_PASSWORD}@192.168.0.107:554/cam/realmonitor?channel=5&subtype=1

    backyard_right: 
      rtsp://admin:{FRIGATE_RTSP_PASSWORD}@192.168.0.107:554/cam/realmonitor?channel=6&subtype=0
    backyard_right_sub: 
      rtsp://admin:{FRIGATE_RTSP_PASSWORD}@192.168.0.107:554/cam/realmonitor?channel=6&subtype=1



cameras:
  garage:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/garage
          input_args: preset-rtsp-restream
          roles:
            - record
            - detect
    live:
      stream_name: garage_sub
      height: 960
    motion:
      mask: 
        0.516,0.411,0.58,0.398,0.652,0.426,0.73,0.431,0.806,0.423,0.863,0.441,0.961,0.455,1,0.379,0.999,0.001,0,0,0.003,0.733,0.082,0.604,0.145,0.651,0.218,0.617,0.214,0.5,0.465,0.422
      threshold: 50
      contour_area: 10
      improve_contrast: 'true'
    objects:
      filters:
        car: {}
      mask:
        - 0.607,0.396,0.629,0.359,0.676,0.332,0.75,0.326,0.788,0.359,0.818,0.373,0.86,0.391,0.862,0.501,0.812,0.579,0.606,0.522
        - 0.302,0.531,0.479,0.48,0.571,0.515,0.605,0.603,0.609,0.758,0.627,0.871,0.621,0.982,0.623,1,0.321,1,0.274,0.649
        - 0.53,0.407,0.58,0.397,0.652,0.426,0.73,0.431,0.806,0.423,0.863,0.441,0.961,0.455,1,0.379,0.999,0.001,0,0,0.003,0.733,0.082,0.604,0.145,0.651,0.218,0.617,0.214,0.5,0.462,0.422
  driveway:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/driveway
          input_args: preset-rtsp-restream
          roles:
            - record
            - detect
    live:
      stream_name: driveway_sub
      height: 960
    motion:
      mask: 
        0.267,0.034,0.377,0.032,0.547,0.058,0.631,0.073,0.716,0.122,0.824,0.187,0.935,0.356,0.999,0.432,1,0,0,0,0,0.206
      threshold: 35
      contour_area: 10
      improve_contrast: 'true'
    objects:
      filters:
        car: {}
      mask:
        - 0.326,0.275,0.415,0.27,0.425,0.332,0.411,0.47,0.332,0.472
        - 0.862,0.371,0.926,0.402,0.952,0.351,1,0.393,1,0.703,0.933,0.794,0.882,0.806,0.777,0.581
        - 0.358,0.161,0.55,0.207,0.559,0.126,0.53,0.09,0.503,0.034,0.5,0,0.35,-0.005,0.345,0.066,0.348,0.109
        - 0.267,0.034,0.377,0.032,0.547,0.058,0.631,0.073,0.716,0.122,0.824,0.187,0.935,0.356,0.999,0.432,1,0,0,0,0,0.206
  front_yard:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/front_yard
          input_args: preset-rtsp-restream
          roles:
            - record
            - detect
    live:
      stream_name: front_yard_sub
      height: 960
    motion:
      mask: 
        1,0.5,0.822,0.389,0.703,0.343,0.631,0.284,0.553,0.316,0.482,0.262,0.397,0.338,0.305,0.295,0.229,0.327,0.149,0.415,0.001,0.372,0,0,1,0
      threshold: 55
      contour_area: 10
      improve_contrast: 'true'
    objects:
      mask:
        - 0.884,0.798,0.853,0.893,0.886,0.918,0.921,0.83
        - 1,0.5,0.822,0.389,0.703,0.343,0.631,0.284,0.553,0.316,0.482,0.262,0.397,0.338,0.305,0.295,0.229,0.327,0.149,0.415,0.001,0.372,0,0,1,0
  trailer:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/trailer
          input_args: preset-rtsp-restream
          roles:
            - record
            - detect
    live:
      stream_name: trailer_sub
      height: 960
    motion:
      mask: 
        1,0.481,0.624,0.262,0.495,0.229,0.388,0.22,0.321,0.217,0.243,0.199,0.178,0.21,0.068,0.267,0,0.269,0,0,0.998,0.003
    objects:
      mask:
        - 0.238,0,0.25,0.244,0.297,0.426,0.363,0.619,0.634,0.496,0.661,0
        - 1,0.481,0.624,0.262,0.495,0.229,0.388,0.22,0.321,0.217,0.243,0.199,0.178,0.21,0.068,0.267,0,0.269,0,0,0.998,0.003
  backyard_left:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/backyard_left
          input_args: preset-rtsp-restream
          roles:
            - record
            - detect
    live:
      stream_name: backyard_left_sub
      height: 960
    objects:
      mask:
        - 0.576,0.988,0.546,0.688,0.527,0.666,0.506,0.673,0.429,0.636,0.411,0.534,0.366,0.549,0.423,0.842,0.381,0.869,0.35,0.974
        - 0,0.485,0.116,0.423,0.217,0.336,0.298,0.27,0.448,0.185,0.583,0.102,0.673,0.07,0.792,0.056,0.854,0.058,1,0.062,1,0,0,0
    motion:
      mask: 
        0,0.485,0.116,0.423,0.217,0.336,0.298,0.27,0.448,0.185,0.583,0.102,0.673,0.07,0.792,0.056,0.854,0.058,1,0.062,1,0,0,0
  backyard_right:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/backyard_right
          input_args: preset-rtsp-restream
          roles:
            - record
            - detect
    live:
      stream_name: backyard_right_sub
      height: 960
    objects:
      mask:
        - 0.581,1,0.694,0.915,0.713,0.604,0.723,0.556,0.697,0.542,0.681,0.563,0.657,0.535,0.652,0.584,0.671,0.591,0.675,0.643,0.594,0.712,0.555,0.702,0.534,1
        - 0.545,0.419,0.539,0.508,0.562,0.515,0.567,0.422
        - 0.618,0.468,0.614,0.536,0.635,0.542,0.643,0.471
        - 0.977,0.41,0.815,0.299,0.745,0.208,0.649,0.157,0.541,0.135,0.486,0.118,0.417,0.11,0.3,0.109,0.201,0.131,0.087,0.163,0,0.223,0,0,1,0,1,0.422
    motion:
      mask: 
        0.977,0.41,0.815,0.299,0.745,0.208,0.649,0.157,0.541,0.135,0.486,0.118,0.417,0.11,0.3,0.109,0.201,0.131,0.087,0.163,0,0.223,0,0,1,0,1,0.422
version: 0.15-0

Any other information that may be helpful

Automation works 90% of the time but sometimes I just get blank notifications saying a car was detected by a camera with no picture. I'm looking to maybe filter by "has_snapshot: true" but unsure how to pass it with the blueprint. (Also this was happening on version 0.14 as well)

@derpderpington derpderpington changed the title Snapshotless Notifications [Config Support]: Snapshotless Notifications Jan 9, 2025
@SgtBatten
Copy link
Owner

trigger.payload.json["before"]["has_snapshot"] should be the variable you need to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants