Home Assistant integration to fetch public transport data for Tampere, Finland
Copy the files to your custom_components
folder or install as a HACS custom repository. More info on HACS here.
The integration can be set up from the frontend by searching for Nysse
.
Each station creates a sensor which contains data for departures from that station. Explanations for non self-explanatory attributes are listed below.
realtime
- Indicates if the data is pulled from realtime vehicle monitoring or timetable data
Simple frontend example using custom:html-template-card
type: custom:html-template-card
title: Hervanan kampus A
ignore_line_breaks: true
content: >
<div style="font-size:24px"><br>Hervannan kampus A</div>
{% set departures = state_attr('sensor.hervannan_kampus_a_0835','departures') %}
{% for i in range(0, departures | count, 1) %}
<div style="display:grid; grid-template-columns: 2fr 1fr; font-size: 20px;
padding: 10px 0px 0px 0px"> <div><ha-icon style="padding: 0px 10px 10px 0px;
color:#da2128" icon="mdi:numeric-3-box"></ha-icon> {{ departures[i].destination
}}</div><div style="text-align: right">{% if departures[i].realtime %}<ha-icon
style="color:green; padding: 0px 10px 0px 0px"
icon="mdi:signal-variant"></ha-icon>{% endif %} {% if
departures[i].time_to_station | int < 21 %} {{departures[i].time_to_station}} min {%
else %}{{departures[i].departure}}{% endif %}</div></div>
{% endfor %}