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.
-
Navigate to the
MagicMirror/modulesdirectory and execute the following commandgit clone https://github.com/jalibu/MMM-RNV
-
Request your API Key here: Data Hub API. Select GraphQL (not GTFS) in the form.
-
Find the stationId of the station that should be displayed.
-
Add the module configuration into the
config.jsfile (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 } },
| 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) |
| 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:`` |
To update the module, navigate to the module directory and pull the latest changes:
cd ~/MagicMirror/modules/MMM-RNV
git pullThis 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!
| 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) |
# 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 releaseFollowing Git hooks are automatically activated (via simple-git-hooks):
- pre-commit: runs
npm run test - pre-push: runs
npm run build
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.