Hello community,
I have a markdown that gives me useful info on automation triggered.
I want to limit it to automation triggered during past 24 hours only.
Can someone help as I cannot figure this from what i searched.
|D|H|M||Name|
|----:|----:|----:|:--:|:----|
{% for state in states.automation
|selectattr('attributes.last_triggered')
|sort(attribute='attributes.last_triggered', reverse=true) -%}
{%- set t = now() - state.attributes.last_triggered -%}
{%- set days = t.days if t.days > 0 else ' ' -%}
{%- set hrs = t.seconds//3600 %}
{%- set hrs = hrs if hrs > 0 else ' ' -%}
|{{days}}|{{hrs}}|{{(t.seconds//60)%60}}||_{{state.name}}_|
{% endfor %}