Skip to content

MagicMirror² module - PEKA Wirtualny Monitor (Poznań public transport monitor)

License

Notifications You must be signed in to change notification settings

ytmytm/MMM-pekavm

Repository files navigation

MMM-pekavm

Station monitor for Poznań public transport bus and tram system.

This module is an extension of the amazing MagicMirror2 project by MichMich.

It is heavily based upon excellent MMM-KVV module by yo-less. Even this README is 80% coming from there.

Screenshots

Polish version

Languages

The basis language is Polish (pl) but due to almost identical code to MMM-KVV language support for German (de) and English (en) locales was already possible.

Prerequisite

A working installation of MagicMirror2

You need to add following line on top of ~/MagicMirror/js/app.js and ~/MagicMirror/js/electron.js:

process.binding('http_parser').HTTPParser = require('http-parser-js').HTTPParser;

This needed because PEKA server returns malformed responses that can't be handled by default node.js http parser.

Dependencies

Installation

  1. Navigate into your MagicMirror's modules folder.
  2. Execute git clone https://github.com/ytmytm/MMM-pekavm.git.
  3. Execute cd MMM-pekavm.
  4. Execute npm install.

Module behavior

Please note that this module auto-creates a module header which displays the name of the chosen stop. It is therefore recommended not to add a 'header' entry to your config.js for this module.

This module automatically disappears from your mirror as soon as a station has stopped offering connections at night. It reappears as soon as your chosen station is scheduled to be served again.

This module has been programmed to allow for multiple instances. Simply add more MMM-pekavm config entries to your config.js file to display multiple stations and configure them according to your needs.

Configuration

Sample minimum configuration entry for your ~/MagicMirror/config/config.js:

    {
	module: 'MMM-pekavm',
	position: 'top_left',
	config: {
		stopID: 'RKAP46',		// Which stop would you like to have displayed?
	}
    }						// If this isn't your last module, add a comma after the bracket

Sample configuration entry for your ~/MagicMirror/config/config.js with optional parameters:

    {
        module: 'MMM-pekavm',
        position: 'top_left',
        config: {
			stopID: 'RKAP46',	// Which stop would you like to have displayed?
			maxConn: 6,		// How many connections would you like to see?
			lines: ["1","5","238"],	// Which lines to show
			alwaysShowTime: true,	// Always show time of departure? (as HH:MM)
			showMessages: true,	// Show ZTM notifications about canceled lines, reroutes etc.?
			labelRow: true,		// Show or hide column headers
			minTime: 180000,	// Filter out departures earlier than this (in milliseconds)
			reload: 60000		// How often should the information be updated? (in milliseconds)
	}
    }						// If this isn't your last module, add a comma after the bracket

Figuring out the correct stopID

  1. Open your web browser and navigate to PEKA Wirtualny monitor.
  2. Use the search field to find the stop you are interested in.
  3. Once you can see the list of connections in your browser, click on the little text "Bezposredni link do przystanku" on the top right.
  4. You will see something like www.peka.poznan.pl/vm/?przystanek=RKAP71
  5. This string RKAP71 is the stopID you are looking for.

Or you can just write down this symbol from the physical departures table on your stop.

Or you can search ZTM website and check virtual image of a departures table with stop symbol this link leads to RSTA41.

Config Options

Option Default Description
stopID RKAP46
Which stop would you like to have displayed?
Default: Rondo Kaponiera (level 0 tram stop)

maxConn
optional
8
How many connections would you like to see?

lines
optional
[]
Which lines would you like to see?
Default: all

alwaysShowTime
optional
true
Show time of departure also as wall clock time (HH:MM)
Possible values: true, false

showMessages
optional
true
Show special ZTM notifications about canceled and rerouted lines, etc.
Possible values: true, false

labelRow
optional
true
Show or hide column headers
Possible values: true, false

minTime
optional
0
Filter out departures earlier than this (in milliseconds) because you need this time to get to the stop anyway.
Default: 0 (show all departures)

reload
optional
30000
How often should the information be updated? (in milliseconds)
Default: Every half minute

Licence

MIT License

Copyright (c) 2017-2020 Maciej Witkowiak (https://github.com/ytmytm/)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

MagicMirror² module - PEKA Wirtualny Monitor (Poznań public transport monitor)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published