Help with Frigate motion + zones

Hi all,
I have a camera in my garage that should only trigger motion or detect a person outside the door boundaries. (basically in the garage and not in the corridor)
I have created first a mask and I noticed that HA still triggers as motion and detection whenever somebody passes in the corridor (does not enter the garage), then I have created on top of the mask a zone, to include all garage with the exception of the door, however the problem still remains.

I am not sure what I am doing wrong, can I have some help if possible.

Frigate config for that camera:

Garage:
    ffmpeg:
      inputs:
        #LOW RESOLUTION
      - path: rtsp://127.0.0.1:8554/Garage_Sub
        input_args: preset-rtsp-restream
        roles:
        - detect
        #HIGH RESOLUTION
      - path: rtsp://127.0.0.1:8554/Garage_Main
        input_args: preset-rtsp-restream
        roles:
        - record
    live:
      stream_name: Garage_Sub
    detect:
      width: 896
      height: 512
      fps: 5
    snapshots:
      enabled: true
    record:
      enabled: true
      retain:
        days: 7
        mode: motion #all = 24/7, motion = when there is motion, active_objects = verified detected objects
      events:
        retain:
          default: 14
          mode: active_objects #all = 24/7, motion = when there is motion, active_objects = verified detected objects
        required_zones:
          - garage_all_except_corridor


    motion:
      threshold: 20
      lightning_threshold: 0.8
      contour_area: 10
      frame_alpha: 0.01
      mqtt_off_delay: 10
      improve_contrast: True
      mask:
        - 428,0,778,0,741,338,612,293,628,338,418,279
    zones:
      garage_all_except_corridor:
        coordinates: 0,0,311,0,368,266,745,367,764,0,896,0,896,512,426,512,424,406,0,412
        objects:
          - person
        filters:
          person:
            min_area: 7500
            max_area: 85000
            min_score: 0.7
            threshold: 0.75


    
    objects:
      track:
      - person
      filters:
        person:
          min_area: 7500
          max_area: 85000
          min_score: 0.7
          threshold: 0.75
    ui:
      order: 6
      dashboard: true

Home assistant detection
garage_ha

Frigate zone

Frigate motion mask

I would suggest:

  1. remove the motion mask, they are not meant to be used in this way
  2. add required_zones to snapshots as well, like the docs show Zones | Frigate

Thanks. I just did that, but unfortunatly still NOK.

I have added a picture with the debugging of frigate where I have a person standing in the corridor and still triggers motion in HA :frowning:

why is it a problem if motion is triggered in HA

that shouldn’t matter, you should be going off of the object detected in zones sensors for automation or using the HA notification blueprint if you are using this for notifications

Damn, I never realised that when I create a zone in frigate, a new object is created in home assistant dedicated to that zone.

Your last comment @crzynik made me think about that possibility. So I restarted the integration of frigate and there it was a new object dedicated to my zone.
If I use this new object, it works perfectly as I want.

Many thanks for your assistance!

1 Like