Closed Tuckie closed 2 years ago
Require a zone or multiple zones in the conditions. https://docs.frigate.video/guides/stationary_objects
Note that 0.10.0 will track the car continuously.
Thank you for the super quick response! I started playing with zones, although I'm not sure how well it's going to work due to the downward slope of my drive. I'm currently using the frigate-hass-integration, is there a way to replicate the mqtt entered_zones
concept? (I haven't really done much with MQTT events)
I would recommend using the mqtt topic for notifications rather than the sensors provided in the integration: https://docs.frigate.video/guides/ha_notifications
Unfortunately it looks like I ran into a snag unmasking the street in order to get the bottom half of the driveway (again, the bottom half is basically a few pixels tall as it slopes down to the street). Now, frigate captures a video of every car that drives past and it fills up my disk.
Basically I would need the same exact type of entered_zones
concept for recordings and snapshots as well.
Any other ideas on tackling this? Is there a motion setting I should tweak?
Motion settings won't help with object detection. You need to use required_zones for events and snapshots to prevent cars on the street from creating events.
required_zones
appears to be an or
instead of and
.
Driveway:
ffmpeg:
inputs:
- path: rtsp://cam:554/live
roles:
- detect
- path: rtsp://cam:554/live
roles:
- rtmp
- record
detect:
width: 1920 #704
height: 1080 #480
motion:
mask:
- 789,328,377,401,376,122,794,132 # garage door
- 205,217,269,209,262,47,204,44 # window
#- 1920,145,1920,375,1750,374,1063,321,1089,182 # street
- 1263,104,1855,105,1855,35,1262,38 #timestamp
zones:
main_drive:
coordinates: 1920,652,402,348,376,148,797,132,1244,167,1260,343,1920,398
street:
coordinates: 1225,185,1920,224,1920,390,1213,343
detached_garage:
coordinates: 0,508,482,404,1920,541,1920,1080,0,1080
objects:
track:
- person
- car
- cat
record:
events:
required_zones:
- street
- main_drive
snapshots:
required_zones:
- street
- main_drive
That's right. Only list the zones where you want snapshots and recordings. If you don't want cars that only drive on the street, then don't list street. Split your driveway into two zones and make them both required.
Don't forget that the zone is evaluated based on the bottom center of the bounding box. It doesn't matter if any other part of the bounding box overlaps with the zone.
I had the same issue before Frigate. Any light action was detected by the ONVIF camera as a motion and turned on lights again. What you could do is to check the last light on event time and block the Frigate action propagation in the HA rules. You can use something like this in HA:
- alias: "Camera person detection sync"
trigger:
platform: mqtt
topic: frigate/events
condition:
- condition: template
value_template: '{{ trigger.payload_json["type"] == "end" }}'
action:
- delay: 00:00:01
- service: input_boolean.turn_on
data_template:
entity_id: 'input_boolean.{{ trigger.payload_json.get("after",{}).get("camera") }}_person_detected'
- delay: 00:00:10
- service: input_boolean.turn_off
data_template:
entity_id: 'input_boolean.{{ trigger.payload_json.get("after",{}).get("camera") }}_person_detected'
mode: single
- alias: Frigate alerts
description: Person/car detection in cameras from Frigate
trigger:
platform: mqtt
topic: frigate/events
condition:
condition: and
conditions:
- condition: template
value_template: '{{ trigger.payload_json["type"] == "end" }}'
- condition: template
value_template: >
{% set name = trigger.payload_json.get("after",{}).get("camera") %}
{{ (now().timestamp() - as_timestamp(states.input_boolean[name+'_person_detected'].last_changed)) > 1800 }}
action:
- service: notify.telegram_bot
data:
title: Alert at camera {{trigger.payload_json.get("after",{}).get("camera")}}
message: Person detected
data:
photo:
- url: http://x.x.x.x:5000/clips/{{trigger.payload_json.get("after",{}).get("camera")}}-{{trigger.payload_json.get("after",{}).get("id")}}.jpg
caption: Человек на камере {{trigger.payload_json.get("after",{}).get("camera").replace("_","-")}}
This code block uses 2 fake input_boolean's to track the last detection event time in the first rule for 2 cameras. Then the second rule gets blocked if the following event appears within 30 minutes. That way I send Telegram messages with the screenshot of the person in my garden if no person was detected at least for 30 mins.
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.
Describe the problem you are having
The situation:
The Problem:
A vehicle sitting on the driveway at night starts an infinite detection loop, as the lights turning off triggers a new detection event.
Any ideas on how to tune my install to prevent this from happening?
Version
0.9.4
Frigate config file
Relevant log output
FFprobe output from your camera
Frigate stats
Operating system
HassOS
Install method
HassOS Addon
Coral version
PCIe
Network connection
Wired
Camera make and model
Dahua
Any other information that may be helpful
No response