Need help with Frigate trigger in automation

I have an automation that is supposed to turn on the driveway light when the driveway camera sees a car. That much works fine, but my problem is that shortly after the light turns off, Frigate detects the car again. I thought that the

to: "on"
from: "off"

would prevent this retrigger.

Is my problem my automation or how Frigate detects objects?

alias: Driveway car Presence
description: Turns on driveway light for 15-minutes when a car is detected in the driveway.
mode: single
triggers:
  - entity_id:
      - binary_sensor.driveway_car_occupancy
    to: "on"
    from: "off"
    trigger: state
conditions:
  - condition: sun
    before: sunrise
    after: sunset
actions:
  - target:
      entity_id: light.driveway_light_light
    data: {}
    action: light.turn_on
  - delay:
      hours: 0
      minutes: 15
      seconds: 0
      milliseconds: 0
  - metadata: {}
    data: {}
    target:
      entity_id: switch.driveway_light
    action: switch.turn_off

Hi Stephen Mann (YAML-challenged),

I usually just move these to where they belong, but you are here long enough that you may have it in uncatagorized for a reason? Anyway just letting you know if you didn’t already that it’s in an unusual category…

I thought “Configuration” was the default.

OK, I’ll move it there for you.
As I found it it is currently NOT there…

UPDATE, moved…

It is about how Frigate detects objects.

If you mean the car gets continuously redetected (which in turn unnecessarily switches the driveway light) although the car has been parked you should tune the stationary behavior within Frigate for the camera in question.

The docs say:

Why does it matter if an object is stationary?

Once an object becomes stationary, object detection will not be continually run on that object. This serves to reduce resource usage and redundant detections when there has been no motion near the tracked object. This also means that Frigate is contextually aware, and can for example filter out recording segments to only when the object is considered active. Motion alone does not determine if an object is “active” for active_objects segment retention. Lighting changes for a parked car won’t make an object active.

For deeper insights how Frigate handles stationary objects look HERE.

And how is that done? As you quote the docs,

I read this as the object detection will not retrigger for a stationary object. So, why is it retriggering and how do I prevent it?

Well, read the docs and study the full reference config for Frigate. In particuilar the paragraph about configuring stationay objects.

You can also use your favorite search engine to find more examples. Plenty of inforrmation available on the net.

Obviously because you have not yet configued stationary objects within Frigate for the Cam in question. Play around with it, works very eliable here.