Wanted to query folks to see what hopefully minor change would be needed for a notification automation.
I have one now that watches a frigate car count specifically for usps so I get a notification when the mail truck arrives.
I currently have it set to watch the usps active count value changes above 0 with a duration of 3 seconds.
The way the mail route is for my road, mailboxes are all on the opposite side, so the truck works it way down the north side of the road (double dead end road), then flies by doing dang near 60 past the house then starts on the mailboxes on the south side.
So frigate still sees the logo/truck flying by but HA should only recognize it when the truck stops at the mailbox for more than 3 seconds.
right now I’ll get anywhere from 1-4 notifications which seems to indicate something about that automation isn’t quite right. sometimes multiple notifications are with the truck still at the mailbox.
What would be a more ideal way of setting up this detection?
In order to critique your code, it would be most helpful to actually see your code.
good call - by apologies. thought I included the yaml script.
But since this doesn’t give the visual of the device, here is a picture too.
alias: USPS
description: “”
triggers:
- type: value
device_id: a6b140cb9d94b6154bb9eb8833772708
entity_id: db4fecf0eecf0d2a2ef3a57c52926cd0
domain: sensor
trigger: device
above: 0
for:
hours: 0
minutes: 0
seconds: 3
conditions:
actions: - action: notify.send_email
metadata: {}
data:
message: USPS - action: notify.nhbalert
metadata: {}
data:
message: USPS
mode: single
I guess, it depends a lot on how quickly Frigate reacts to and communicates the change to HA.
I can see that it takes for one of my cameras 2 seconds from the time Frigate detects a person until the sensor count changes and it takes 3 second from the last detection of a person in Frigate until the censor count clears.
I haven’t worked much with zones in Frigate, but maybe there’s way to set up one zone along the route to the mailbox and one zone along the route from the mailbox, both as far apart and as far away from where the truck stops to put mail in your mailbox.
And the calculate the time between the truck leaving one zone and showing up in the other.
That might just give the system more time to react.
Just throwing out ideas here ![]()
Interesting idea. The cameras I have are a dual setup, main and sub are pulled in by Milestone, and Frigate also uses the sub stream. I’ve gone back over the milestone footage and the time HA sends out the notification is pretty much spot on to what the Milestone timestamp of the post truck stopping is.
So I guess at the moment I’m not as concerned with the time delay.
The camera I have used for the mailbox is zoomed in so that is pretty much the the mailbox is the main thing in the frame, and it’s an old country road so not terribly wide.
There are 5 mailboxes prior to mine, so depending on how much stuff needs to be crammed into each box, the time is usually all of 5-7 minutes from when the truck flies by to when it actually stops right at the mailbox. That branch is weighed down by snow, but usually it’s not blocking the view of the mailbox during the warmer months. even so Frigate detects the usps logo just fine with the branch there.
Now that I’m thinking about it, maybe a scenario where a helper could be triggered when it first detects the usps image, then only if that helper value is one, does it trigger the actual alert.
I have that setup for a geo tag, my phone comes within ~2000’ of the house, helper gets set to 1/active. then only if helper is active at 1000’ my after dark/lights on etc routine fires off.
might be worth a try unless any other ideas come to mind.

