That’s kind of a weird set of attributes. But maybe something like this will do what you’re looking for:
{% set targets_found =
state_attr('image_processing.deepstack_object_network_video_recorder_profilename010',
'targets_found') %}
{% set ns = namespace(person = 0) %}
{% for item in targets_found if (item.keys()|list)[0] == 'person' %}
{% set person = (item.values()|list)[0] %}
{% if person > ns.person %}
{% set ns.person = person %}
{% endif %}
{% endfor %}
{{ ns.person > 0 }}
Thanks Phil, that works great and returns a true or false letting me know if a person is detected in the image.
I have edited the number in the last line to only return true if the confidence level is over 70%.
{% set targets_found =
state_attr('image_processing.deepstack_object_network_video_recorder_profilename010',
'targets_found') %}
{% set ns = namespace(person = 0) %}
{% for item in targets_found if (item.keys()|list)[0] == 'person' %}
{% set person = (item.values()|list)[0] %}
{% if person > ns.person %}
{% set ns.person = person %}
{% endif %}
{% endfor %}
{{ ns.person > 70 }}
As a further step - how would I manipulate this to read the ‘summary’ attribute and return the number of persons? It seems to be formatted slightly differently to the other attributes.
First, when you reply, if you want the person you’re replying to to be notified, use the Reply button under their post, not the one at the bottom of the page.
That one is much simpler and you don’t need anything as complicated as above. It’s simply:
I wonder if someone could help with creating a value template to determine whether a target was detected within the previous 30s. I’m hoping to use this as a condition to throttle notifications when a target is detected. So far i have the following:
Sharing the link to a post which resolves my above issue. There’s some interesting stuff around utilising the Deepstack entity attributes and creating a value template. Worth a read.