Skip to content

Timetable for Digitraffic data trains (Finland)

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.MIT
Notifications You must be signed in to change notification settings

kuosman/MMM-digitraffic-trains

Repository files navigation

Module for MagicMirror: Timetable for Digitraffic data (Finland)

The MMM-digitraffic-trains module fetches train timetable data from Digitraffic api (Finland) and shows the timetables for configured stations.

You will need to check the stationShortCode from https://rata.digitraffic.fi/api/v1/metadata/stations and add the code of the station you want to show in the config station string.

Screenshot

  • Digitransit trains screenshot

Digitransit trains screenshot

Using the module

  1. Clone this repository under MagicMirror/modules folder
  2. Run npm install in MagicMirror/modules/MMM-digitraffic-trains folder
  3. Add to the modules array in the MagicMirror/config/config.js file:
modules: [{
	module: "MMM-digitraffic-trains",
	position: "top_right",
	header: "Trains",
	config: {
		icon: "train", // See: https://fontawesome.com/icons?d=gallery
		showIcon: true,
		station : "KRS", // See: https://rata.digitraffic.fi/api/v1/metadata/stations
		updateInterval: 2500,
		trainCount: 6,
		showOnlyDestinations: ['Helsinki'] // If defined, shows only trains what destination is defined station(s). Increase also trainCount if defined.
	}
}]

Configuration options

The following properties can be configured:

Option Description
icon Showed icon style class, default train. See others: https://fontawesome.com/icons?d=gallery
showIcon Show icon or not, default true
station Station short code, default KRS. See others: https://rata.digitraffic.fi/api/v1/metadata/stations
updateInterval Update interval in milliseconds, default 2500
trainCount Showed departing trains count, default 6
showOnlyDestinations Show only trains what destination is defined stations(s)

About

Timetable for Digitraffic data trains (Finland)

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.MIT

Stars

Watchers

Forks

Packages

No packages published