Skip to content

MagicMirror² module that displays public transport departure boards from stops integrated into the PID (Prague Integrated Transport) system using the free Golemio API.

License

Notifications You must be signed in to change notification settings

lucasbotka/MMM-PID

Repository files navigation

MMM-PID

MMM-PID is a module for MagicMirror² that displays real-time departure boards for public transport stops within the PID system. Using the free Golemio API, it shows departure times, including any current delays, for Prague and the surrounding region in the Czech Republic.

Screenshot

Example of MMM-PID

Installation

Just go to the modules directory and clone the repository and install the dependencies:

cd ~/MagicMirror/modules
git clone https://github.com/lucasbotka/MMM-PID.git
cd ~/MagicMirror/modules/MMM-PID
npm ci --omit=dev

Update

Just go to the MMM-PID directory and pull the update and install the dependencies:

cd ~/MagicMirror/modules/MMM-PID
git pull
npm ci --omit=dev

Configuration

MMM-PID using Golemio API. You can obtain your key for free here.

To use this module, you have to add a configuration object to the modules array in the config/config.js file.

In order to display departure boards for specific stops, you need to find their ID here in the section (PID stop list) in the XML or JSON file. To ensure you have correct direction and platform, you can use this map.

Example configuration

{
			module: 'MMM-PID',
			position: 'top_right',
			header: "Departure board",
			config: {
				apiKey: "YOUR_GOLEMIO_API_KEY", 
				stops: [
					{
						aswIds: '897/101', //Černý most - Metro
						allowed_routes: [ ], 
						maxDepartures: 3
					},
					{
						aswIds: '1827_2', // Brandýs nad Labem náměstí
						allowed_routes: [ '367' , '375' ],
						maxDepartures: 3
					},
					{
						aswIds: '474/3', // Nádraží Vysočany
						allowed_routes: [ ],
						maxDepartures: 3
					}
				],
				minutesAfter: 160,
				updateInterval: 60000, // 1 min
				showIcons: true
			}
		},

Configuration options

Option Description
apiKey Your golemio api key
aswIds Stop ID
allowed_routes Filter the lines to be displayed Eg. [ '375' , '367' ]
maxDepartures Limit the number of results displayed
minutesAfter How many minutes in advance should departures be displayed
updateInterval How often should the output be updated in ms
showIcons Show icons for the lines

Developer commands

  • npm install - Install all dependencies.
  • node --run lint - Run linting and formatter checks.
  • node --run lint:fix - Fix linting and formatter issues.
  • node --run test - Run linting and formatter checks + Run spelling check.
  • node --run test:spelling - Run spelling check.

Contributing

If you find any problems, bugs or have questions, please open a GitHub issue in this repository.

Pull requests are of course also very welcome 🙂

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

MagicMirror² module that displays public transport departure boards from stops integrated into the PID (Prague Integrated Transport) system using the free Golemio API.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •