fuffenz / ha-sensor-sl

Home Assistant sensor for sl.se departures
Apache License 2.0
16 stars 8 forks source link

SL sensor for Home Assistant

This is a simple component for Home Assistant that can be used to create a "Departure board" for buses and trains in Stockholm, Sweden. You have to install it as a custom component and you need to get your own API key from SL / Trafiklab.

# Example configuration.yaml entry
- platform: sl
  name: gullmarsplan
  ri4key: YOUR-API-KEY-HERE
  siteid: 9189
  lines: 17, 18, 19
  direction: 1

Configuration variables

sensor value

The sensor value is the number of minutes to the next departure. There are also a number of attributes:

next_departure: 1 min
next_line: 17
next_destination: Åkeshov
upcoming_departure: 4 min
upcoming_line: 18
upcoming_destination: Hässelby strand
unit_of_measurement: min
icon: fa-subway
friendly_name: sl gullmarsplan
attribution: Data from sl.se / trafiklab.se