Hi,
Needed some fiddling with my self created persistent notification messages, but below should fit the bill for the correct texts. Id like to show these in a markdown card.
However, Im a bit stuck with 2 things, probably too simple to see right now, so please help me if you would.
first of all, I need a newline after each set (below the See: line), and I’ve tried ‘\n’ etc but the template editor won’t show it correctly.
now, and this is where it gets a wee bit trickier, I only need to select the persistent_notifications that begin with ‘rss_feed_’ as in persistent_notification.rss_feed_etcetc
where would I fit in both in below template?
{% for state in states.persistent_notification -%}
{{state.attributes.message.split(',')[0][17:]}} notification:
{{state.attributes.title}}
See: {{state.attributes.message.split('see ')[1] }}
{%- endfor %}.
thanks for helping me out.
update
missed the ending -%} in the first template line, which caused the looped lines to concatenate. Took that out and the sets are shown fine. btw completely forgot the curly brackets around the ‘\n’ so that’s working to now.
added the state.entity_id for testing purposes, so you can see what I am looking for: only show the Pers. notifications beginning with rss_feed
{% for state in states.persistent_notification %}
{{state.entity_id}}
{{state.attributes.message.split(',')[0][17:]}} notification:
{{state.attributes.title}}
See: {{state.attributes.message.split('see ')[1] }}
{{'\n'}}
{%- endfor %}