/MMM-mvgmunich

MagicMirror² Module to monitor public transport (U-bahn, tram, bus, S-Bahn) in Munich

Primary LanguageJavaScriptMIT LicenseMIT

MMM-mvgmunich GitHub license Build Status Known Vulnerabiliries Code Climate

MagicMirror² Module to monitor public transport (U-bahn, tram, bus, S-Bahn) in Munich - Germany.

Example

Stations names with arrival time
config: {
    haltestelle: "Hauptbahnhof",
    maxEntries: 10,             // 10 items on screen
    updateInterval: 60000,      // 60 s
    showIcons: false,            // Show transport type icon
    transportTypesToShow: {
        "ubahn": true,            // show ubahn route
        "sbahn": false,            // show sbahn route
        "bus": false,              // show bus route
        "regional_bus": false,     // show regional bus route
        "tram": false              // show tram route
    },
    ignoreStations: [],         // destination not to be shown
    timeToWalk: 0,             // 10 min walking time to station. Default is 0
    showWalkingTime: false,     // if the walking time should be included and the starting time is displayed
    showTrainDepartureTime: true,     // show tran departure time
    trainDepartureTimeFormat: "relative",   // format of the train departure time
    walkingTimeFormat: "relative",    // format of the walking time
}
Stations names with icons and arrival time
config: {
    haltestelle: "Karlsplatz",
    maxEntries: 15,             // 10 items on screen
    updateInterval: 60000,      // 60 s
    showIcons: true,            // Show transport type icon
    transportTypesToShow: {
        "ubahn": true,            // show ubahn route
        "sbahn": true,            // show sbahn route
        "bus": false,              // show bus route
        "regional_bus": false,     // show regional bus route
        "tram": true              // show tram route
    },
    ignoreStations: [],         // destination not to be shown
    timeToWalk: 0,             // 10 min walking time to station. Default is 0
    showWalkingTime: true,     // if the walking time should be included and the starting time is displayed
    showTrainDepartureTime: true,     // show tran departure time
    trainDepartureTimeFormat: "relative",   // format of the train departure time
    walkingTimeFormat: "relative"    // format of the walking time
}
Stations names with icons, arrival time and walking time
config: {
    haltestelle: "Karlsplatz",
    maxEntries: 15,             // 10 items on screen
    updateInterval: 60000,      // 60 s
    showIcons: true,            // Show transport type icon
    transportTypesToShow: {
        "ubahn": true,            // show ubahn route
        "sbahn": true,            // show sbahn route
        "bus": true,              // show bus route
        "regional_bus": false,     // show regional bus route
        "tram": true              // show tram route
    },
    ignoreStations: [],         // destination not to be shown
    timeToWalk: 0,             // 10 min walking time to station. Default is 0
    showWalkingTime: true,     // if the walking time should be included and the starting time is displayed
    showTrainDepartureTime: true,     // show tran departure time
    trainDepartureTimeFormat: "absolute",   // format of the train departure time
    walkingTimeFormat: "relative"    // format of the walking time
}
Stations names with icons, arrival time and disruption marking
config: {
    haltestelle: "Harras",
    maxEntries: 10,             // 10 items on screen
    updateInterval: 60000,      // 60 s
    showIcons: true,            // Show transport type icon
    transportTypesToShow: {
        "ubahn": true,            // show ubahn route
        "sbahn": true,            // show sbahn route
        "bus": true,              // show bus route
        "regional_bus": false,     // show regional bus route
        "tram": false              // show tram route
    },
    ignoreStations: [],         // destination not to be shown
    timeToWalk: 0,             // 10 min walking time to station. Default is 0
    showWalkingTime: false,     // if the walking time should be included and the starting time is displayed
    showTrainDepartureTime: true,     // show tran departure time
    trainDepartureTimeFormat: "absolute",   // format of the train departure time
    walkingTimeFormat: "relative",    // format of the walking time
    showInterruptions: true,
    showInterruptionsDetails: false,
    countInterruptionsAsItemShown: false
Stations names with icons, arrival time, disruption marking and disruptions details (disruption details are not counted as new lines)
config: {
    haltestelle: "Harras",
    maxEntries: 10,             // 10 items on screen
    updateInterval: 60000,      // 60 s
    showIcons: true,            // Show transport type icon
    transportTypesToShow: {
        "ubahn": true,            // show ubahn route
        "sbahn": true,            // show sbahn route
        "bus": true,              // show bus route
        "regional_bus": false,     // show regional bus route
        "tram": false              // show tram route
    },
    ignoreStations: [],         // destination not to be shown
    timeToWalk: 0,             // 10 min walking time to station. Default is 0
    showWalkingTime: false,     // if the walking time should be included and the starting time is displayed
    showTrainDepartureTime: true,     // show tran departure time
    trainDepartureTimeFormat: "absolute",   // format of the train departure time
    walkingTimeFormat: "relative",    // format of the walking time
    showInterruptions: true,
    showInterruptionsDetails: true,
    countInterruptionsAsItemShown: false
Stations names with icons, arrival time, disruption marking and disruptions details (disruption details are counted as new lines)
config: {
    haltestelle: "Harras",
    maxEntries: 10,             // 10 items on screen
    updateInterval: 60000,      // 60 s
    showIcons: true,            // Show transport type icon
    transportTypesToShow: {
        "ubahn": true,            // show ubahn route
        "sbahn": true,            // show sbahn route
        "bus": true,              // show bus route
        "regional_bus": false,     // show regional bus route
        "tram": false              // show tram route
    },
    ignoreStations: [],         // destination not to be shown
    timeToWalk: 0,             // 10 min walking time to station. Default is 0
    showWalkingTime: false,     // if the walking time should be included and the starting time is displayed
    showTrainDepartureTime: true,     // show tran departure time
    trainDepartureTimeFormat: "absolute",   // format of the train departure time
    walkingTimeFormat: "relative",    // format of the walking time
    showInterruptions: true,
    showInterruptionsDetails: true,
    countInterruptionsAsItemShown: true

Dependencies

  • instance of MagicMirror²
  • urlencode (linux: npm install urlencode)

Installation

  1. Clone this repository in your MagicMirror installation into the folder modules.
  2. Rename plugin foler from 'MMM-mvgmunich' to 'mvgmunich'
  3. Install dependencies in main MagicMirror folder
  4. Add configuration block to your config.js:
{
    module: "mvgmunich",
    position: "bottom_left",
    header: "MVG",
    config: {
        haltestelle: "Hauptbahnhof",
        maxEntries: 10,             // 10 items on screen
        updateInterval: 60000,      // 60 s
        showIcons: true,            // Show transport type icon
        transportTypesToShow: {
            "ubahn": true,            // show ubahn route
            "sbahn": true,            // show sbahn route
            "bus": true,              // show bus route
            "regional_bus": true,     // show regional bus route
            "tram": true              // show tram route
        },
        ignoreStations: [],         // lines with destination to which should not be shown
        lineFiltering: {
            "active": true, 			// set this to active if filtering should be used
            "filterType": "whitelist", 	// whitelist = only specified lines will be displayed, blacklist = all lines except specified lines will be displayed
            "lineNumbers": ["U1", "U3", "X50"] // lines that should be on the white-/blacklist
        },
        timeToWalk: 10,             // 10 min walking time to station. Default is 0
        showWalkingTime: false,     // if the walking time should be included and the starting time is displayed
        showTrainDepartureTime: true,             // show tran departure time
        trainDepartureTimeFormat: "relative",     // format of the train departure time
        walkingTimeFormat: "relative",            // format of the walking time
        showInterruptions: true,				    // show interruptions as gray-out rows
        showInterruptionsDetails: false,		    // show details of interruptions in next line
        countInterruptionsAsItemShown: false,	    // count interruptions details lines as a line shown
    }
},

Config Options

Option Description
haltestelle Station for which you want to display data.
Default: Hauptbahnhof
Source: http://www.mvg-live.de/MvgLive/MvgLive.jsp
maxEntries Number of items shown in table.
Default: 8
updateInterval Update interval
Default: 60000
ubahn Show data for U-Bahn.
Possible values: true or false
Default: true
bus Show data for Bus.
Possible values: true or false
Default: true
regional_bus Show data for regional Bus.
Possible values: true or false
Default: true
tram Show data for Tram.
Possible values: true or false
Default: true
sbahn Show data for S-Bahn.
Possible values: true or false
Default: true
ignoreStations Ignore destinations based on a array list.
Possible values e.g.: ["Feldmoching", "Hauptbahnhof"]
Default []
timeToWalk Time to walk to the station from your current location
Default: 0 minutes
showWalkingTime If the time to leave should be displayed which includes the walking time.
Possible values: true or false
Default: false
showTrainDepartureTime If the time of train departure should be displayed.
Possible values: true or false
Default: true
trainDepartureTimeFormat Train departure time format. Absolute: 21:10; Relative: in 8 min;
Possible values: relative or absolute
Default relative
walkingTimeFormat Walking time format. Absolute: 21:08; Relative in 6 min;
Possible values: relative or absolute
Default relative
showInterruptions Gray-out lines with interruptions;
Possible values: true or false
Default false
showInterruptionsDetails Show interruptions details in a new line after the item with interruptions;
Possible values: true or false
Default false
countInterruptionsAsItemShown Count interruption detail lines as line of a transport (number of lines will not explode in case of many interruptions;
Possible values: true or false
Default false
lineFiltering.active Flag to activate or deactivate line filtering
Possible values: true or false
Default false
lineFiltering.filterType Whitelist or blacklist option lines from lineFiltering.lineNumbers
Possible values: whitelist or blacklist
Default blacklist
lineFiltering.lineNumbers lines that should be on the white-/blacklist
Possible values ["U1, U3, X50"]
Default value []