Hi. I’m trying to get the latest script that triggered from a couple of scripts. All of them have the string “Vacuum zone clean” in the friendly name.
What I thought to do is to find all the scripts that contains that string, take the “last triggered” attribute and pull the largest number (using “| max”).
What I accomplished to do so far is that:
{% for clns in (states.script | list) if 'Vacuum zone clean' in clns.attributes.friendly_name %}
{%- set times = (as_timestamp(clns.attributes.last_triggered) ) %}
{{ times }}
{% endfor %}
But I can’t figure out to pull the largest number.
Thanks in advanced.