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
  2. Request your API Key here: Data Hub API. Select GraphQL (not GTFS) in the form.

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

  4. Add the module configuration into the 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:``

Update

To update the module, navigate to the module directory and pull the latest changes:

cd ~/MagicMirror/modules/MMM-RNV
git pull

Contribution and Development

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

Contribution for this module is welcome!

Available Scripts

Script Purpose
node --run build Production build (minified, optimized)
node --run dev Development build with inline sourcemaps
node --run dev:watch Watch mode for active development
node --run test Full quality check (TypeScript + ESLint + Prettier)
node --run type-check TypeScript type validation only
node --run lint Check code style (ESLint + Prettier)
node --run lint:fix Auto-fix code style issues
node --run release Create release (bumps version, rebuilds, creates git tag)

Development Workflow

# Start development with watch mode
node --run dev:watch

# Before committing, run full quality check
node --run test

# Auto-fix any linting/formatting issues
node --run lint:fix

# When ready for release
node --run release

Git Hooks

Following Git hooks are automatically activated (via simple-git-hooks):

  • pre-commit: runs npm run test
  • pre-push: runs npm run build

Release

Releases are handled with node --run release (commit-and-tag-version). The script bumps the version, creates a git tag, rebuilds the bundled files (MMM-RNV.js, node_helper.js), and stages them via the configured postbump step.

Thanks to

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •