Skip to content

Home Assistant integration to fetch public transport data for Tampere, Finland

License

Notifications You must be signed in to change notification settings

warrior25/HA-Nysse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HA-Nysse

hacs_badge

Introduction

Home Assistant integration to fetch public transport data for Tampere, Finland

Installation

Copy the files to your custom_components folder or install as a HACS custom repository. More info on HACS here.

Setup

Open your Home Assistant instance and start setting up a new integration.

The integration can be set up from the frontend by searching for Nysse.

Usage

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

Frontend example

Simple frontend example using custom:html-template-card Example

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 %}