Unifi License Plate Detection... Again

I’m using a G6 Turret Ultra with LPR functionality. It is mounted a little high, but for testing it works great in the daytime. In all the posts I’ve read, getting the license plate data into HA seems to be the issue.

That isn’t my problem at all. The data comes over fine when detected. Sometime the “M” is detected as a “W”, but I can live with that until I relocate the camera.

Here is the log for the entity.

When I click the gear icon in the upper right, I get this to confirm the entity ID.
sensor.driveway_license_plate_detected

My problem is, my automation never fires. I’ve tried an empty From: field, along with “clear” and “Clear.” I’m pretty new to HA, maybe I’m messing something simple up? Here is the YAML from my WHEN condition for this automation.

trigger: state
entity_id:
  - sensor.driveway_license_plate_detected
to: UMX
from: Clear

Does it actually “from: clear”

Have you checked trace to see what is preventing trigger?

Is the to: correct ?

It won’t trigger on part of a string, it looks like you blanked out something ?

Try checking for the full state as shown in dev tools>states

You could check for part of a string and 2 different strings if you use a template trigger

EDIT: just checked my unifi licence plate sensors and they only have states of clear and detected, I have had to use a webhook to get the plate info over to HA. Do yours already have the licence plate info in them ?

I’d trigger on any change to the plate, then examine its contents in the condition block:

triggers:
  - trigger: state
    entity_id: sensor.driveway_license_plate_detected
conditions:
  - condition: template
    value_template: >
      {{ trigger.to_state.state[:3] in ('UMX','UWX') }}
actions:

That will at least trigger and generate a trace that you can use to see what the states are.

1 Like