frigate-hass-integration icon indicating copy to clipboard operation
frigate-hass-integration copied to clipboard

person cameras not updating since upgrade

Open errolsancaktar opened this issue 2 years ago • 4 comments

Version of the custom_component

3.0.0

Configuration

alias: Front Door Motion Notification
description: Send push notification to people
trigger:
  - platform: state
    entity_id:
      - binary_sensor.front_door_motion
    to: "on"
condition:
  - condition: template
    value_template: >-
      {{ (as_timestamp(now()) -
      as_timestamp(states.automation.front_door_motion_notification.attributes.last_triggered
      | default(0)) | int > 300)}}
action:
  - service: |-
      {% if (is_state("input_boolean.person1_notify", "on")) -%}
        notify.notify_person1
      {% elif (is_state("input_boolean.person2_notify", "on")) %}
        notify.notify_person1
      {% else %}
        notify.notify_person3
      {% endif %}
    data:
      message: Person at Door
      title: Front Door
      data:
        entity_id: camera.front_door_person
        tag: front_door
mode: single

Describe the bug

I think this is just a mistake on my part but it seems the cameras for specific objects dont seem to be working, were they removed?

as you can see in the automation above. i had it set that when it triggers a person object at the front door it is supposed to send a screenshot of the camera.front_door_person which was working up until 0.11 release. are these object cameras no longer supported? i couldnt really find anything about it in the docs and it seems the design is now to pull the info from MQTT. is that right?

Debug log



errolsancaktar avatar Oct 06 '22 18:10 errolsancaktar

Try using MQTT explorer and see if the snapshot topic is being entered. We didn't change anything with that so it should still be working as before.

NickM-27 avatar Oct 06 '22 18:10 NickM-27

similar issue for me, re-install of my mqtt addon has got things closer... but now many of my entities say unavailable

geftactics avatar Oct 07 '22 09:10 geftactics

seems that the retained messages werent cleared up during upgrade. removing the messages looks like it solved the problem. will continue to monitor though

errolsancaktar avatar Oct 09 '22 00:10 errolsancaktar

Scratch that. Seems to still be showing the old image again. Now it's stuck on the image after I cleared the retainer message

errolsancaktar avatar Oct 09 '22 02:10 errolsancaktar

I just installed the frigate and frigate integration. Same here, I cannot get the person camera entity to show anything on all my cameras. Though I can see the thumbs. image image

Salvora avatar Oct 23 '22 21:10 Salvora

it does not appear that frigate is updating the image in the frigate//person/snapshot anymore

errolsancaktar avatar Oct 24 '22 17:10 errolsancaktar

it does not appear that frigate is updating the image in the frigate//person/snapshot anymore

Again would recommend checking MQTT explorer and others along with providing your actual frigate config. Using MQTT explorer I can see that the images are being updated and the integration is showing the most recent image as well

NickM-27 avatar Oct 24 '22 17:10 NickM-27

image above is the image for what i see on MQTT and below is my configuration:

---
detectors:
  coral:
    type: edgetpu
    device: usb

mqtt:
  host: <Hostname>
  user: <user>
  password: <Pass>
  client_id: frigate

# Optional: logger verbosity settings
logger:
  # Optional: Default log verbosity (default: shown below)
  default: info
  # Optional: Component specific logger overrides
  #logs:
  #  frigate.event: debug

ffmpeg:
  global_args:
    - -hide_banner
    - -loglevel
    - error
  hwaccel_args:
    - -hwaccel
    - cuda
  input_args:
    - -c:v
    - h264_cuvid
    - -strict
    - experimental
    - -avoid_negative_ts
    - make_zero
    - -fflags
    - nobuffer
    - -fflags
    - +igndts
    - -flags
    - low_delay
    - -fflags
    - +genpts+discardcorrupt
    - -rtsp_transport
    - -use_wallclock_as_timestamps
    - '1'
  output_args:
    # Optional: output args for detect streams (default: shown below)
    detect: -f rawvideo -pix_fmt yuv420p
    # Optional: output args for record streams (default: shown below)
    record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac
    # Optional: output args for rtmp streams (default: shown below)
    rtmp: -c copy -f flv


# Optional: Detect configuration
# NOTE: Can be overridden at the camera level
detect:
  # Optional: width of the frame for the input with the detect role (default: shown below)
  width: 1920
  # Optional: height of the frame for the input with the detect role (default: shown below)
  height: 1080
  # Optional: desired fps for your camera for the input with the detect role (default: shown below)
  # NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera.
  fps: 5
  # Optional: enables detection for the camera (default: True)
  # This value can be set via MQTT and will be updated in startup based on retained value
  enabled: True
  # Optional: Number of frames without a detection before frigate considers an object to be gone. (default: 5x the frame rate)
  max_disappeared: 25
  # Optional: Configuration for stationary object tracking
  stationary:
    # Optional: Frequency for confirming stationary objects (default: shown below)
    # When set to 0, object detection will not confirm stationary objects until movement is detected.
    # If set to 10, object detection will run to confirm the object still exists on every 10th frame.
    interval: 0
    # Optional: Number of frames without a position change for an object to be considered stationary (default: 10x the frame rate or 10s)
    threshold: 50
    # Optional: Define a maximum number of frames for tracking a stationary object (default: not set, track forever)
    # This can help with false positives for objects that should only be stationary for a limited amount of time.
    # It can also be used to disable stationary object tracking. For example, you may want to set a value for person, but leave
    # car at the default.
    # WARNING: Setting these values overrides default behavior and disables stationary object tracking.
    #          There are very few situations where you would want it disabled. It is NOT recommended to
    #          copy these values from the example config into your config unless you know they are needed.
    max_frames:
      # Optional: Default for all object types (default: not set, track forever)
      default: 3000
      # Optional: Object specific values
      objects:
        person: 1000

# Optional: Object configuration
# NOTE: Can be overridden at the camera level
objects:
  # Optional: list of objects to track from labelmap.txt (default: shown below)
  #track:
  #  - person
  # Optional: mask to prevent all object types from being detected in certain areas (default: no mask)
  # Checks based on the bottom center of the bounding box of the object.
  # NOTE: This mask is COMBINED with the object type specific mask below
  #mask: 0,0,1000,0,1000,200,0,200
  # Optional: filters to reduce false positives for specific object types
  filters:
    person:
      # Optional: minimum width*height of the bounding box for the detected object (default: 0)
      min_area: 5000
      # Optional: maximum width*height of the bounding box for the detected object (default: 24000000)
      max_area: 100000
      # Optional: minimum score for the object to initiate tracking (default: shown below)
      min_score: 0.5
      # Optional: minimum decimal percentage for tracked object's computed score to be considered a true positive (default: shown below)
      threshold: 0.7
      # Optional: mask to prevent this object type from being detected in certain areas (default: no mask)
      # Checks based on the bottom center of the bounding box of the object
      #mask: 0,0,1000,0,1000,200,0,200

# Optional: Motion configuration
# NOTE: Can be overridden at the camera level
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: 25
  # Optional: Minimum size in pixels in the resized motion image that counts as motion (default: 30)
  # Increasing this value will prevent smaller areas of motion from being detected. Decreasing will
  # make motion detection more sensitive to smaller moving objects.
  # As a rule of thumb:
  #  - 15 - high sensitivity
  #  - 30 - medium sensitivity
  #  - 50 - low sensitivity
  contour_area: 30
  # Optional: Alpha value passed to cv2.accumulateWeighted when averaging the motion delta across multiple frames (default: shown below)
  # Higher values mean the current frame impacts the delta a lot, and a single raindrop may register as motion.
  # Too low and a fast moving person wont be detected as motion.
  delta_alpha: 0.2
  # Optional: Alpha value passed to cv2.accumulateWeighted when averaging frames to determine the background (default: shown below)
  # Higher values mean the current frame impacts the average a lot, and a new object will be averaged into the background faster.
  # Low values will cause things like moving shadows to be detected as motion for longer.
  # https://www.geeksforgeeks.org/background-subtraction-in-an-image-using-concept-of-running-average/
  frame_alpha: 0.2
  # Optional: Height of the resized motion frame  (default: 50)
  # This operates as an efficient blur alternative. Higher values will result in more granular motion detection at the expense
  # of higher CPU usage. Lower values result in less CPU, but small changes may not register as motion.
  frame_height: 50
  # Optional: motion mask
  # NOTE: see docs for more detailed info on creating masks
  #mask: 0,900,1080,900,1080,1920,0,1920
  # Optional: improve contrast (default: shown below)
  # Enables dynamic contrast improvement. This should help improve night detections at the cost of making motion detection more sensitive
  # for daytime.
  improve_contrast: True

# Optional: birdseye configuration
birdseye:
  # Optional: Enable birdseye view (default: shown below)
  enabled: True
  # Optional: Width of the output resolution (default: shown below)
  width: 1280
  # Optional: Height of the output resolution (default: shown below)
  height: 720
  # Optional: Encoding quality of the mpeg1 feed (default: shown below)
  # 1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources.
  quality: 8
  # Optional: Mode of the view. Available options are: objects, motion, and continuous
  #   objects - cameras are included if they have had a tracked object within the last 30 seconds
  #   motion - cameras are included if motion was detected in the last 30 seconds
  #   continuous - all cameras are included always
  mode: motion

record:
  enabled: True
  retain:
    days: 30
    mode: all
  events:
    pre_capture: 30
    post_capture: 30
    retain:
      default: 90
      mode: motion

cameras:

##################
## Front Door
##################
  front_door:

    ffmpeg:
      inputs:
        - path: r<RTSP PATH>
          roles:
            - detect
            - record
            - clip
          input_args:
            - -avoid_negative_ts
            - make_zero
            - -flags
            - low_delay
            - -strict
            - experimental
            - -fflags
            - +genpts+discardcorrupt
            - -use_wallclock_as_timestamps
            - "1"
            - -c:v
            - h264_cuvid

    zones:
      front_door_person_area:
        coordinates: 816,800,1291,809,1578,793,1920,887,1920,1080,1037,1080,214,1080,538,966
        objects:
          - person
      zone_driveway_entry:
        coordinates: 856,717,480,682,337,730,819,783
        objects:
          - car
      door_car_str_area:
        coordinates: 890,690,1409,708,1423,738,869,719
        objects:
          - car



##################
## Driveway
##################
  Driveway:

    ffmpeg:
      inputs:
        ## Main Stream
        - path: <RTSP PATH>
          roles:
            - record
            - detect
            - clips
          input_args:
            - -avoid_negative_ts
            - make_zero
            - -flags
            - low_delay
            - -strict
            - experimental
            - -fflags
            - +genpts+discardcorrupt
            - -use_wallclock_as_timestamps
            - "1"
            - -c:v
            - h264_cuvid
              #          input_args: -strict experimental -r 10 -rw_timeout "5000000"  -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp  -c:v h264_cuvid
    detect:
      height: 1920
      width: 2560
      fps: 5

    motion:
      mask:
        - 1646,264,2332,256,2306,0,0,0,0,1253
    zones:
      zone_driveway_entry:
        coordinates: 1565,243,1238,221,0,840,0,1182
        objects:
          - car
      driveway_person_area:
        coordinates: 1932,146,2326,271,2560,1920,819,1920,0,1920,0,1202
        objects:
          - person
      bicycles:
        coordinates: 1932,146,2326,271,2560,1920,819,1920,0,1920,0,1202
        objects:
          - bicycle
##################
## Porch SouthEast
##################
  Porch_SE:
    ffmpeg:
      inputs:
        - path: <RTSP PATH>
          roles:
            - record
            - detect
            - clip
            - clips
          input_args: -strict experimental -r 10 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -probesize 100M  -analyzeduration 250M  -c:v h264_cuvid
    detect:
      width: 3840
      height: 2160
      fps: 5

    motion:
      mask:
        - 1448,796,1296,800,3343,2160,3647,2160
        - 3840,1341,3840,0,0,0,0,751,1777,816,3840,2115

    zones:
      porch_person_area:
        coordinates: 0,2160,103,1325,729,1448,2105,1364,3295,2160
        objects:
          - person
      bicycles:
        coordinates: 3840,2160,0,2128,303,206,1628,600,3840,1599
        objects:
          - bicycle

##################
## Gate
##################
  Gate:
    ffmpeg:
      inputs:
        - path: <RTSP PATH>
          roles:
            - record
            - detect
            - clip
            - clips
          input_args: -strict experimental -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -c:v h264_cuvid
    detect:
      width: 2560
      height: 1920
      fps: 5
    motion:
      mask:
        - 2536,0,2240,785,1967,591,1554,617,0,1315,0,817,0,0,853,0

    objects:
      track:
        - person
        - car
        - dog

##################
## Backyard SE
##################
  Backyard_E:
    ffmpeg:
      inputs:
        - path: <RTSP PATH>
          roles:
            - record
            - detect
            - clip
            - clips
              #input_args: -strict experimental -r 10 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp  -c:v h264_cuvid
          input_args: -strict experimental -r 10 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -c:v h264_cuvid
    motion:
      mask:
        - 2560,0,862,0,1197,236,2268,411,2560,888
    detect:
      width: 2560
      height: 1920
      fps: 5

    objects:
  # Optional: list of objects to track from labelmap.txt (default: shown below)
      track:
      - person

##################
## Patio
##################
  Patio:
    ffmpeg:
      inputs:
        - path: <RTSP PATH>
          roles:
            - record
            - detect
            - clips
            - clip
          input_args: -strict experimental -r 10 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -c:v h264_cuvid
    detect:
      width: 2560
      height: 1920
      fps: 5


    motion:
      mask:
        - 1990,135,1971,0,0,0,0,423,0,1122,544,520

    zones:
      patio_detect:
        coordinates: 2560,1920,2560,916,2057,645,1995,157,600,488,0,1109,0,1920
        objects:
            - person
            - dog

errolsancaktar avatar Oct 24 '22 19:10 errolsancaktar

I notice you don't have snapshots enabled, I would enable that and try again and see if the behavior is different.

NickM-27 avatar Oct 24 '22 19:10 NickM-27

I do have the snapshots enabled but still the same issue.

image

mqtt:
  host: 192.168.1.45
  user: mqtt-user
  password: "mqtt-password"
  topic_prefix: frigate
  client_id: laxpi4b
  stats_interval: 60

detectors:
  coral:
    type: edgetpu
    device: usb

snapshots:
  # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
  # This value can be set via MQTT and will be updated in startup based on retained value
  enabled: True
  # Optional: save a clean PNG copy of the snapshot image (default: shown below)
  clean_copy: False
  # Optional: print a timestamp on the snapshots (default: shown below)
  timestamp: False
  # Optional: draw bounding box on the snapshots (default: shown below)
  bounding_box: True
  # Optional: crop the snapshot (default: shown below)
  crop: False
  # Optional: height to resize the snapshot to (default: original size)
  # height: 175
  # Optional: Restrict snapshots to objects that entered any of the listed zones (default: no required zones)
  # required_zones: []
  # Optional: Camera override for retention settings (default: global values)
  retain:
    default: 10

cameras:
  Kapi_Kamera:
    ffmpeg:
      inputs:
        - path: "rtsp://Frigate:[email protected]/cam/realmonitor?channel=1&subtype=2"
          roles:
            - detect
        - path: "rtsp://Frigate:[email protected]/cam/realmonitor?channel=1&subtype=0"
          roles:
            - rtmp
      # hwaccel_args:
      #   - -c:v
      #   - h264_v4l2m2m 
    rtmp:
      enabled: True # <-- RTMP should be disabled if your stream is not H264
    mqtt:
      enabled: True
      timestamp: False
      bounding_box: True
    detect:
      stationary:
        interval: 50
        threshold: 50
      enabled: True
      width: 1280 # <---- update for your camera's resolution
      height: 720 # <---- update for your camera's resolution
      fps: 5
    objects:
      track:
        - person
        - cat
      filters:
        person:
          threshold: 0.7
        cat:
          threshold: 0.7
  Ara_Sokak_Kamera:
    ffmpeg:
      inputs:
        - path: "rtsp://Frigate:[email protected]/cam/realmonitor?channel=1&subtype=1"
          roles:
            - detect
        - path: "rtsp://Frigate:[email protected]/cam/realmonitor?channel=1&subtype=0"
          roles:
            - rtmp
      # hwaccel_args:
      #   - -c:v
      #   - h264_v4l2m2m 
    rtmp:
      enabled: True # <-- RTMP should be disabled if your stream is not H264
    mqtt:
      enabled: True
      timestamp: False
      bounding_box: True
    snapshots:
      required_zones:
        - vehicle_zone
        - person_zone
    motion:
      mask: 
        - 552,500,325,373,97,215,47,187,0,201,0,576,224,576,704,576,704,554
        - 704,0,704,139,640,129,330,43,352,0
    zones:
      vehicle_zone:
        coordinates: 304,42,222,67,109,162,319,339,471,239,670,312,704,186,540,127,468,92
        objects:
          - motorcycle
          - car
          - bus
          - bicycle
      person_zone:
        coordinates: 704,127,704,576,269,432,0,167,28,60,120,31,281,0
        objects:
          - person
    detect:
      stationary:
        interval: 50
        threshold: 50
      enabled: True
      width: 704 # <---- update for your camera's resolution
      height: 576 # <---- update for your camera's resolution
      fps: 5
    objects:
      track:
        - person
        - motorcycle
        - car
        - bus
        - bicycle
      filters:
        person:
          threshold: 0.5

  On_Sokak_Kamera:
    ffmpeg:
      inputs:
        - path: "rtsp://Frigate:[email protected]/cam1/onvif-h264"
          roles:
            - detect
            - rtmp
      # hwaccel_args:
      #   - -c:v
      #   - h264_v4l2m2m 
    rtmp:
      enabled: True # <-- RTMP should be disabled if your stream is not H264
    mqtt:
      enabled: True
      timestamp: False
      bounding_box: True
    detect:
      stationary:
        interval: 50
        threshold: 50
      enabled: True
      width: 1280 # <---- update for your camera's resolution
      height: 720 # <---- update for your camera's resolution
      fps: 5
    objects:
      track:
        - person
        - motorcycle
        - car
        - bus
      filters:
        person:
          threshold: 0.7

  Mutfak_Kamera:
    ffmpeg:
      inputs:
        - path: "rtsp://Frigate:[email protected]/cam/realmonitor?channel=1&subtype=1"
          roles:
            - detect
        - path: "rtsp://Frigate:[email protected]/cam/realmonitor?channel=1&subtype=0"
          roles:
            - rtmp
      # hwaccel_args:
      #   - -c:v
      #   - h264_v4l2m2m
      # output_args:  # Converts h265 to h264 on the fly
      #   rtmp: -c:v libx264 -an -f flv
    rtmp:
      enabled: False # <-- RTMP should be disabled if your stream is not H264
    mqtt:
      enabled: True
      timestamp: False
      bounding_box: True
    motion:
      mask: 
        - 132,160,140,260,69,302,49,243
    detect:
      stationary:
        interval: 50
        threshold: 50
      stationary:
        interval: 50
        threshold: 50
      enabled: True
      width: 640 # <---- update for your camera's resolution
      height: 480 # <---- update for your camera's resolution
      fps: 5
    objects:
      track:
        - person
      filters:
        person:
          threshold: 0.65

  Salon_Kamera:
    ffmpeg:
      inputs:
        - path: "rtsp://Frigate:[email protected]/cam/realmonitor?channel=1&subtype=1"
          roles:
            - detect
        - path: "rtsp://Frigate:[email protected]/cam/realmonitor?channel=1&subtype=0"
          roles:
            - rtmp
      # hwaccel_args:
      #   - -c:v
      #   - h264_v4l2m2m
      # output_args:  # Converts h265 to h264 on the fly
      #   rtmp: -c:v libx264 -an -f flv
    rtmp:
      enabled: False # <-- RTMP should be disabled if your stream is not H264
    mqtt:
      enabled: True
      timestamp: False
      bounding_box: True
    detect:
      stationary:
        interval: 50
        threshold: 50
      enabled: True
      width: 640 # <---- update for your camera's resolution
      height: 480 # <---- update for your camera's resolution
      fps: 5
    objects:
      track:
        - person
      filters:
        person:
          threshold: 0.65

Salvora avatar Oct 24 '22 19:10 Salvora

if your thumbs are updating then it is seeing the image, not sure why the camera entity is not showing the full image but that is different than what OP is reporting

NickM-27 avatar Oct 24 '22 19:10 NickM-27

Hmm, ok. I guess I will open a new issue then.

Salvora avatar Oct 24 '22 19:10 Salvora

Ok so after turning snapshots back on, the issue has gotten better. The only remaining issue which I can't seem to figure out is I will get a motion notification with an old image. I'm sure I'm missing something but it seems I'm getting a person notification without it taking a snapshot.

errolsancaktar avatar Nov 04 '22 05:11 errolsancaktar

Ok so after turning snapshots back on, the issue has gotten better. The only remaining issue which I can't seem to figure out is I will get a motion notification with an old image. I'm sure I'm missing something but it seems I'm getting a person notification without it taking a snapshot.

What does your automation look like?

NickM-27 avatar Nov 04 '22 12:11 NickM-27

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.

github-actions[bot] avatar Jun 10 '23 17:06 github-actions[bot]