[go: up one dir, main page]

Skip to content
/ MMM-RNV Public

This module for the MagicMirror² platform monitors a given station in the RNV traffic network. It shows upcoming departures with their destination, type, delay and platform.

License

Notifications You must be signed in to change notification settings

jalibu/MMM-RNV

Repository files navigation

MMM-RNV

version Known Vulnerabilities

This is a departure monitor for the Rhein-Neckar-Verkehr (RNV) public transport network for the MagicMirror² platform.
It shows upcoming departures with their destination, type, delay and platform.

Contribution welcome.

Demo

screenshot

Installing the Module

  1. Navigate to the MagicMirror/modules directory and execute the following command

    git clone https://github.com/jalibu/MMM-RNV.git
  2. Change into the MMM-RNV module folder and install runtime dependencies with

    cd MMM-RNV
    npm install -->
  3. Request your API Key here.

  4. Find the stationId of the station that should be displayed.

  5. Add the module configuration into the MagicMirror/config/config.js file (sample configuration):

     {
         module: "MMM-RNV",
         position: "top_left",
         config: {
             animationSpeedMs: 2 * 1000, // 2 seconds
             credentials: {
                clientId: "",
                clientSecret: "",
                resourceId: "",
                tenantId: "",
             },
             excludeLines: [], // example ["N1", "5"]
             excludePlatforms: [], // example ["A"]
             highlightLines: [], // example ["1"]
             maxResults: 10,
             showLineColors: true,
             showPlatform: false,
             showTableHeadersAsSymbols: false,
             stationId: '2417',
             timeformat: 'HH:mm',
             updateIntervalMs: 1 * 60 * 1000, // every 1 minute
             walkingTimeMs: 3 * 60 * 1000 // 3 minutes footwalk
         }
     }

Options

Option Description
animationSpeedMs Duration of fade-in animation.

Type: int
Default value: 2000
credentials Your RNV API credentials.

Type: Credentials
Default value: empty object
excludeLines List of excluded lines.

Type: string array
Default value: []
excludePlatforms List of excluded platforms, e.g. if you only want to see one direction.

Type: string array
Default value: []
highlightLines List of highlighted lines.

Type: string array
Default value: []
maxResults Limits number of results.

Type: int
Default value: 10
showLineColors Set to true, to colorize the lines.

Type: boolean
Default value: true
showPlatform Set to true, to display platform.

Type: boolean
Default value: false
showTableHeadersAsSymbols Set to true, to show symbols instead of texts in header.

Type: boolean
Default value: false
stationId ID of the station that should be displayed.

Type: int
Default value: 2417 (Mannheim Hbf)
timeformat Time format for the departure time.

Type: string
Default value: HH:mm
updateIntervalMs Determines how often updates should be loaded from server.

Type: int
Default value: 60000 (every 1 minute)
walkingTimeMs Filter for departures that are reachable considering the walking time.

Type: int
Default value: 3 * 60 * 1000 (3 minutes)

Credentials Object

Option Description
clientId Your clientId.

Type: string
Default value: ``
resourceId Your resourceId.

Type: string
Default value:``
clientSecret Your clientSecret.

Type: string
Default value: ``
tenantId Your tenantId.

Type: string
Default value:``

Contribution and Development

This module is written in TypeScript and compiled with Rollup.
The source files are located in the /src folder. Compile target files with npm run build.

Contribution for this module is welcome!

Thanks to