Help needed with template (should be simple enough)

I am having a template show me results in results

{{ state_attr('image_processing.doods_indkoersel','summary')}}

gives me

{'car': 1, 'person': 1}

i have tried to do {{ state_attr('image_processing.doods_indkoersel','summary', 'person')}} but that gives me an error

I need to somehow put in a “if person result is > then 0” return true else false, but I have no idea on how to “catch” that person variable, as it already is a result of the summary result.

(complete yaml attribute result)

matches:
car:
- score: 67.96875
box:
- 0.5023111
- 0.57385033
- 0.8507763
- 0.8012679
person:
- score: 66.796875
box:
- 0.45125216
- 0.45778716
- 0.9691581
- 0.57283485
summary:
car: 1
person: 1
total_matches: 2
process_time: 0.3733653430008417
friendly_name: Doods indkoersel

Try this:
{{ states.image_processing.doods_indkoersel.attributes['summary']['person'] }}

1 Like

Or if you want to avoid errors during start up, this version:

{{ state_attr('image_processing.doods_indkoersel', 'summary')['person'] }}
2 Likes

Thanks guys :slight_smile: that solved my problem