Frigate 0.16 Beta help creating automation

Hi there,

im trying to create an automation that opens my garage when is closed and when Frigate recognize a specific license plate, the problem is i dont undersatand very wll the event so i can make this work
im using Frigate 0.16 Beta wich have LPR locally and i manage to configure known license plates.
Could anyone here help me figure this out?

My automation code now

alias: Frigate open Garage Volvo
description: ""
triggers:
  - trigger: mqtt
    topic: frigate/events
conditions:
  - condition: template
    value_template: "{{ trigger.payload_json.after.recognized_license_plate == 'XXXXXX'}}"
  - type: is_not_open
    condition: device
    device_id: ff6e2d5aaaae8541dceeabaeb75dee2e
    entity_id: be89da71bbe72911372aa274ef073a1f
    domain: binary_sensor
actions:
  - type: turn_off
    device_id: ff6e2d5aaaae8541dceeabaeb75dee2e
    entity_id: bf3881e894f6ba57ca0431f82275acae
    domain: switch
mode: single

Detecting a specific license plate is a feature I would pay for, but I think that Frigate Plus only detects “A” License plate. Any license plate would trigger an automation.

Maybe a specific license plate would be one of the 12 Fine Tune objects your subscription allows.

I would like to be proven wrong, but I don’t see this in the Frigate+ docs. If I missed it, point me to a link.

1 Like

The beta Version have introduce the FPR native you can check here, thanks for the help.
https://deploy-preview-16390--frigate-docs.netlify.app/configuration/license_plate_recognition/

Thanks for the link. Definitely something I want to learn more about. (And I still haven’t mastered Frigate).

Do I need Frigate+ or is it just recommended? (I am basically lazy, so if + makes license plate reading easier, I’ll subscribe.)

Is lpr something I need to install separately?

On your automation, you have both entity_id and device_id. You don’t need both and using entity_id are usually easier to read and manage. But where did you get these entity IDs? It should look like binary_sensor.garge_door. Device ID’s are long random strings.

Is Frigate detecting the plate? (Watch the MQTT message using MQTT Explorer).

Have you looked at the automation traces to see how far into the automation you go?

1 Like

Frigate 16 is detecting number plates OK for me, on my normal camera, but as far as I know it is really intended for a camera dedicated to number plates. Mine recognises which one of my 3 cars has driven in. It also manages to detect sign written vans and think they are number plates.

1 Like

@stevemann
You dont need Frigate+ and LPR is embedded on frigate already, no need to install separately. In my frigate is working great, detects my wife car license plate every time she gets home. My problem is creating the automation, i dont understant how can i check the events so i can pick him up and create the automation.
i tried check MQTT explorer (thanks, didn’t know about this) like you suggest but cant find the LPR detection for my camera. maybe io dont know how to work with the addon :stuck_out_tongue:

Thank you for the help

@Arh
My frigate is detecting the plate all the time, my problem is making the automation, i dont understand “events” and when i can work with them.

Hi everyone,

@hhrocha000

instead try:

topic: frigate/tracked_object_update

Good day!

1 Like

It’s probably easier to install the Frigate HA Integration [Home Assistant Integration blakeblackshear/frigate-hass-integration: Frigate integration for Home Assistant

It creates sensors for detected objects that you can use. According to the release notes the latest version should include a sensor for detected license plates. Releases · blakeblackshear/frigate-hass-integration

1 Like

@starob
i have that but the only think that appears there is “Last Recognized Plate” and stays with the last one till detests a different one so i cant do an automation with this (i think when i close my garage after get the car in it will detect again cuz this stays at the same state)
But thanks for the suggestion.

Not sure I understand what you exactly mean. Do you know MQTT Explorer? MQTT Explorer | An all-round MQTT client that provides a structured topic overview

It allows you to see all MQTT messages that are sent to your MQTT broker. You can then identify what frigate is sending when a license plate is detected.

@starob
hmm my MQTT explorer dont show anything about license plates on frigate (i only install this now maybe i dont know how to work with it)

You will see this only after an object has been detected and the mqtt message has been sent. Try to trigger it and see what happens.

1 Like

Will try to do it later today then. thanks

Surely just trigger on state of Last Recognized Plate changing and from nothing to the characters in the number plate

My Last Recognized Plate say it was Seat, which I set up in the config file.

Not tried it so can’t say it works or not.

1 Like

So i tried to trigger the camera with only person motion and got this:

i can see that is a ““recognized_license_plate”: null,” i think when the car shows up on camera this change to the license plate right?
with this how can i do the automation then?

First off have you got the frigate integration installed, if not do it.

I have added this but not tried it yet as I have not been out in the car.

alias: Car arriving home
description: ""
triggers:
  - trigger: state
    entity_id:
      - sensor.a_drivecam_last_recognized_plate
    to: Seat
conditions: []
actions:
  - action: notify.mobile_app_xxxxxxxx_mobile
    metadata: {}
    data:
      message: Your car has come home
mode: single
1 Like

Just reading the comments again, and I see you want it detected again when it goes in the garage, is it the same camera doing the detection?

But I would then just trigger on recognising a number plate, then condition if it matches the required car. It should then trigger every time it sees a plate. Just guessing again :slight_smile:

1 Like

Still thinking out load, you could maybe change the state of the lpr sensor to unknown at the end of the automation, it will then detect the car again next time it sees it. just throwing in some ideas, no idea if it will work.

1 Like

I assume that every time the license plate is recognized the “last_recognized_plate” sensor will change it’s state. So the code snipped from @Arh above should work.

1 Like

Yeah that what i thought it would do but take a look of what happened yesterday to Last recognized plate state:

Dont think if was a bug but i will test it again, yesterday it stays has “Sarah Volvo” from 5pm till 9h22AM from today. but today at 9h22 it detecxts again the car and after 4 minutes it turns into unknown :thinking:
Will test this later today and see the behavior.

For exemple if i had an automation with the conditions of latest recognize plate has Sarah Volvo + garage closed, when i closed the garage i think it will open again cuz it will detect the same conditions again and again.

Lets see, i will give you update later today

Edit:
Ohha sry yes i only use 1 camera to detect all on my backyard/garageway, its a Reolink duo with 180Âş view