License Plate Recognition API with platerecognizer.com

Release 0.3.0 includes stats on your remaining calls available from the 2500 free per month:

Adds saving annotated images:

Rob, you’re on a roll. It works great. In testing this, I’m realizing numbers consistently work better than letters. Especially when the plate is viewed from an angle like in this shot. That is gets it at all shows just how good this service really is.

The recognition spits out this:

Which had a partial match. The automation triggers are exact match only. There’s no “LIKE” operator like in MySQL when evaluating expressions. How would I match a partial plate that just has the numbers in an automation? I’m thinking template, but those are elusive and coding them is way above my pay grade.

Any ideas welcome!!
Jeff

This would probably need to be regex, either in the integration or in your automation. I have a proposal for this in https://github.com/robmarkcole/HASS-Sighthound/issues/22

New release, adding support for regions

For anyone who wants a simple notification if new cars are scanned.
You will need to create an input_text which holds last state with plates, I’ve named it: “current_cars_in_driveway”. You will also need to change the push service :slight_smile:
If you want to ignore some plates you can add it inside the [] in the variable ignored_plates

- id: '1613380190443'
  alias: New cars in driveway
  description: ''
  trigger:
  - platform: event
    event_type: platerecognizer.vehicle_detected
  condition: []
  action:
  - service: input_text.set_value
    data:
      value: '{{ updated_plates | join('','') }}'
    entity_id: input_text.current_cars_in_driveway
  - choose:
    - conditions:
      - condition: 'template'
        value_template: '{{ new_plates|length > 0 }}'
      sequence:
        - service: notify.push
          data:
            message: '{{ ''A new car on driveway! Plate: '' + (new_plates | join('', '')) }}'
  mode: single
  variables:
    ignored_plates: '{{ [] }}'
    old_plates: '{{ states(''input_text.current_cars_in_driveway'').split('','') | list }}'
    updated_plates: '{{ state_attr(trigger.event.data.entity_id, ''vehicles'') | map(attribute=''plate'') | list }}'
    new_plates: '{{ updated_plates | reject(''in'', old_plates) | reject(''in'', ignored_plates) | list }}'
3 Likes

Done release 1.0 which adds watched_plates, making it easy to create a boolean sensor for specific number plates

Is were any way to get list of plates readed?

Hi, how can i create a template for my notification? I tried this but it wont work. for some reason i can get it to say true or false for my watched plates though.

message: {{ state_attr(‘image_processing.platerecognizer_gate_camera_2’, ‘vehicles’).vehicle_type }} detected at the gate. License Plate
{{ state_attr(‘image_processing.platerecognizer_gate_camera_2’, ‘vehicles’).plate }}

Hi!

Can someone please tell me, hogy can I fire up image_processing.platerecognizer automation only if the “camera.doods” recognizes a car? I hope, it is understandable. English isn’t my native language. So, I have many false uploads to platerecognizer.com, as walking people, dog, cat, etc… and then the free 2500 processing is running out very fast… I would like to upload the taken picture, if it contains a car.

Thanks!

Hi @robmarkcole
I’ve tried to create a binary sensor for each watched plate. I got two cars, so it’s them I want to keep track on. But I only get one of the cars right - so I only get 1 entity/binary sensor. Can you (or someone else) show me an example with more than one binary sensor (the yaml code)?
I did like this in my sensor.yaml (I don’t get whats wrong):

- platform: template
  sensors:
    plate_recognizer:
      friendly_name: "abc111"
      value_template: "{{ state_attr('image_processing.platerecognizer_1', 'watched_plates').abc111 }}"
- platform: template
  sensors:
    plate_recognizer:
      friendly_name: "abc123"
      value_template: "{{ state_attr('image_processing.platerecognizer_1', 'watched_plates').abc123 }}"

looks fine to me

Do you know why I only get one entity/binary sensor - always the first one? If I switch places, it’s always just the first that shows up as an entity. What do I do wrong?

@robmarkcole this is my code in sensors.yaml - which only create one entity (TYT992):

- platform: template
  sensors:
      plate_recognizer:
        friendly_name: "TYT992"
        value_template: "{{ state_attr('image_processing.platerecognizer_blueiris_garageuppfarten', 'watched_plates').tyt992 }}"

- platform: template
  sensors:
      plate_recognizer:
        friendly_name: "GXP457"
        value_template: "{{ state_attr('image_processing.platerecognizer_blueiris_garageuppfarten', 'watched_plates').gxp457 }}"

- platform: template
  sensors:
      plate_recognizer:
        friendly_name: "UHC989"
        value_template: "{{ state_attr('image_processing.platerecognizer_blueiris_garageuppfarten', 'watched_plates').uhc989 }}"

Do you understand why I don’t get a “GXP457” enity? Or a “UHC989” entity?
Sorry to bother you with these questions…

Is it fine to run the free trial in the long-term?
I’m quite scare das in their T&C platerecognizer.com states that PoC/Demo Applications are also subject to paying the subscription fee, and that you have to pay it retroactively when they notice. Any experiences so far?

I’ve never heard of retrospective billing

How do I make the binary sensor reset after x seconds?

Hi, when you say:

How is this done? In an automation, triggered by motion on a camera?
thanks!

Yes you can use automations, or trigger from the UI

So, this integration is not actively watching a camera feed for license plates but rather only does so when called by an automation? I think that this is good so that there is not an undue load on the cpu or the number of calls to the platerecognizer service. Sorry, but I do not see an example of an automation action that calls this service? Am I missing something?
thanks for the help!