Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 103194

Use a condition if the state of an attribute is empty

$
0
0

I’m using an automation to trigger image_processing.scan when my camera (frigate) sees a car in the driveway. that triggers my plate recognizer to find and read a license plate. The challenge is getting the timing correct so the vehicle is close enough to the camera but not too far that the plate is out of view.

My solution is an automation that will check for a plate 2 times. I want to use a condition in the automation that continues checking the plate if the attribute vehicles: is blank. I can’t find out how to do it.

Here’s my automation

- id: '1651295257276'
  alias: License Plate Trigger
  description: ''
  trigger:
  - platform: state
    entity_id: binary_sensor.driveway_south_car_motion
    to: 'on'
  condition: []
  action:
  - delay:
      hours: 0
      minutes: 0
      seconds: 3
      milliseconds: 0
  - service: image_processing.scan
    data: {}
    target:
      entity_id: image_processing.platerecognizer_driveway_west
  - condition: state
    entity_id: image_processing.platerecognizer_driveway_west
    attribute: vehicles
    state:
  - service: image_processing.scan
    data: {}
    target:
      entity_id: image_processing.platerecognizer_driveway_west
  mode: single

This is what the attribute looks like when it has found a plate

And when it hasn’t.

When it finds a plate the attribute vehicles: has several lines of info below it. Including the plate it found.

Does anyone know how I can get the automation condition to work?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 103194

Trending Articles