Hello,
I would like to do a filter over the first 14 charakters of the attributes
{% if is_state_attr('sensor.ical_adler_gameday_event_7', 'summary', 'Adler Mannheim ') %}
in the attributes summary is for examble:
Adler Mannheim vs. Nürnberg Ice Tigers
The If query should only output the values if the first 14 characters are Adler Mannheim in the summary
I Don’t know how to change the code.
Hellis81
(Hellis81)
2
I think you need to do like this:
{% if state_attr('sensor.ical_adler_gameday_event_7', 'summary')[0:14] == 'Adler Mannheim' %}
I don´t know why, but now the code don´t work anymore.
In the summary stands for example:
summary: 'Adler Mannheim vs. Eisbären Berlin ’
and with this code:
{% if state_attr('sensor.ical_adler_gameday_event_0', 'summary')[0:14] ==
'Adler Mannheim' %}
It don´t show anything.
Have anyone an idea why it don´t work anymore?