please consider adding as per title to the options for use in automations/scripts, like:
- service: notify.notify
data_template:
title: 'Hassio Rpi4 system message: Critical Device offline!'
message: >
{{as_timestamp(now())|timestamp_custom('%X')}} :
{{trigger.to_state.name}} has gone offline and state is {{trigger.to_state.state_with_unit}}.
Check status to restore functionality.'
Since even the developer-tools/template shows this as example:
For loop example:
{% for state in states.sensor -%}
{%- if loop.first %}The {% elif loop.last %} and the {% else %}, the {% endif -%}
{{ state.name | lower }} is {{state.state_with_unit}}
{%- endfor %}.
it seems logical to add this as option for the trigger.states
Hope it can be realized, would simplify things even more.