Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build sensor last found plate (attributes not working?) #67

Open
koburg opened this issue Aug 14, 2022 · 2 comments
Open

build sensor last found plate (attributes not working?) #67

koburg opened this issue Aug 14, 2022 · 2 comments

Comments

@koburg
Copy link

koburg commented Aug 14, 2022

I want to make an sensor where I can se the last plate found
NOT known.

here is what I have been trying.

in developer tools:

{{ state_attr('image_processing.platerecognizer_garage_2' , 'vehicles') }}

output

[{'plate': 'nkeXXXX', 'confidence': 0.683, 'region_code': 'pl', 'vehicle_type': 'Big Truck', 'box_y_centre': 116.0, 'box_x_centre': 1563.0}]

so I want to show attribute 'plate'

{{ state_attr('image_processing.platerecognizer_garage_2' , 'vehicles').plate }}

output

none

expected output

nkeXXXX

is there something I am missing ?

@reesion
Copy link

reesion commented Jan 10, 2023

Hi,

I am having the same issue too. Have tried the following but not working.
value_template: "{{ state_attr('image_processing.platerecognizer_front_driveway_cam', 'vehicles')['plate'] }}"
value_template: "{{ state_attr('image_processing.platerecognizer_front_driveway_cam', 'vehicles').plate }}"
value_template: '{{ states.image_processing.platerecognizer_front_driveway_cam.attributes.vehicles_plate }}'

Any input is appreciated.

@goedh452
Copy link

This is because the vehicles is an array. I solved it this way:
{%- for i in range(0, (state_attr('image_processing.platerecognizer_camera', 'vehicles') |count) )%} {{- state_attr('image_processing.platerecognizer_camera', 'vehicles')[i].plate | upper}} {% endfor %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants