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: >
{% for departure in
states.sensor.nysse_hervannan_kampus_a_0835.attributes.departures %}
<div style="display:grid; grid-template-columns: 2fr 0.5fr; font-size: 20px">
<div><ha-icon style="padding: 10px 10px 10px 10px" icon={{ departure.icon
}}></ha-icon> {{ departure.line }} - {{ departure.destination }}</div><div
style="text-align: right"> {% if departure.time_to_station | int < 26 %}
{{departure.time_to_station }} min {% else %} {{departure.departure}} {% endif
%}</div></div>
{% endfor %}