I’m trying to solve a more complex templating issue. I have a sensor which contains bus timetable information. The state is the amount of journeys, the journeys themselves are in an attribute:
schedule:
- line: 60U
destination: Tampere
departure: '03:45:00'
days:
- Mo
- Tu
- We
So far, my template looks like this:
{% for schedule in states.sensor.nysse_valkeakoski_schedule.attributes.schedule %}
<div style="display:grid; grid-template-columns: 2fr 0.5fr; font-size: 20px">
<div><ha-icon style="padding: 0px 10px" icon=mdi:bus></ha-icon> {{ schedule.line }} - {{ schedule.destination }}</div> <div style="text-align:
right">{{schedule.departure}}</div>
</div>
{% endfor %}
That gives me a pretty huge list so I would like to seperate weekend and weekday schedules in different cards.
Is it possible to create an IF clause which checks the days list? Something like {%if schedule.days in "Mo","Tu","We","Th","Fr" %}
?