List of Automations sorted according their "triggered last" timestamp

In the Automation Overview (Setup - Automation) I want to have the option, to sort the list of automations, according their timestamp, when they heve been triggered last.

Albert,
Phil came up with a Template Editor solution That ‘should’ get you what you need (it did me)

As a short cut : -

{% for state in states.automation | selectattr('attributes.last_triggered') | sort(attribute='attributes.last_triggered', reverse=true) -%}
{{ state.attributes.last_triggered }} : {{ state.name }}
{% endfor %}

Paste this into the editor and it’ll give you a list (reverse sorted, so the newest at the top)
Please go give him a like if you found this useful

1 Like

Great Script - thanks!

FWIW, if you want it displayed using your local time (as opposed to UTC) you can do it like this:

{% for state in states.automation | selectattr('attributes.last_triggered') | sort(attribute='attributes.last_triggered', reverse=true) -%}
  {{ state.attributes.last_triggered.timestamp() | timestamp_local }} : {{ state.name }}
{% endfor %}
4 Likes

That does make it a bit more user friendly for people across the world.
I’m so used to juggling utc and local it’s virtually transparent, but virtually is not the same as.
And this way you can look at the time you actually noticed the issue.
A worthy improvement.
:+1:

1 Like

+1 was about to post a topic for this