sebikolon / MMM-RVV

MagicMirror² module: Departure monitor for the RVV (Regensburger Verkehrsverbund) bus system (ÖPNV, public transport)
https://www.sbuechler.de/projekte/programmierung/135-mmm-rvv
MIT License
5 stars 1 forks source link
bayern bus departure-monitor magicmirror rvv transport

MMM-RVV

Departure monitor for the local public transport (ÖPNV) of Bavaria.

The data is fetched from bayern-fahrplan.de, the distributor for public transport data in Bavaria. The module scrapes the departure data without requiring any API key or special permission and offers a bunch of options you can play around with. Feel free to contribute!

The structure and layout of this MagicMirror module was inspired by MMM-KVV.

Screenshots

German (1):

German version (1)

German (2):

German version (2)

English:

English version

Languages

MMM-RVV features language support for German (de) and English (en) mirrors.

Prerequisite

A working installation of MagicMirror2.

Dependencies

Installation

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

Module behavior

Please note that this module auto-creates a module header which displays the text that was defined in the module settings. It is therefore recommended not to add a 'header' entry to your config.js for this module.

There is a progress loading bar displayed that runs from the left to the right side of the module border, indicating when the next data refresh is performed. You can adjust the color of this loading bar in the module config. In order to adjust the look-and-feel more granular, add an override to the CSS identifiers .MMM-RVV #divReload and .MMM-RVV #divReloadWrapper.

The delay of an upcoming trip is marked in red color (if there is any), otherwise in green color. If defined, additional trip information like Trip cancelled will be shown instead of the delay.

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

Configuration

You can show the MMM-RVV module without setting any configuration options.
In this case, the stop Regensburg University is set as default stop_from_ID.

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

...

{
    module: 'MMM-RVV',
    position: 'bottom_left',
    config: {
        updateInterval :    30 * 1000,
        stop_from_ID:       4014080,
        stop_to:            ["Klinikum", "Roter-Brach-Weg"],
        maximumTripsToShow: 10,
        titleText :         "Universität Regensburg"  
    }
}       // If this isn't your last module, add a comma after the bracket

...

How to get the correct stopID

  1. Open your web browser and navigate to the the txt version of bayern-fahrplan.de.
  2. Click on "Abfahrtsmonitor anfordern" to reveal a search field.
  3. Write the name of your stop (e.g. Regensburg Universität) and press enter
  4. Choose the right stop if more than one stop is found with your keywords (N.B. only choose actual stops, labeled with "[Haltestelle]").
  5. Click on "Abfahrtsmonitor anfordern" to show the next departures from that stop.
  6. Once the departures are shown, look at the source code of the page (e.g. in Firefox: right click -> View Page Source)
  7. Search the name of the stop in the source code. The stopID (7-digit number) is indicated e few characters after it, right after value=. For example, for "Regensburg Universität" (stopID 4014080) we'll have: <b>Regensburg Universität<span class="odvDesc"> [Haltestelle]</span><input type="hidden" name="name_dm" value="4014080"/>.

Config Options

Option Default Description
stop_from_ID 4014080
Which stop would you like to have displayed?
Default: University Regensburg

stop_to
optional
[]
Which directions do you want to include into your trip list?
Put the names of the stops into the array, separated by comma
Default: Show all directions

maximumTripsToShow
optional
5
How many trips to you want to show in total (including all directions)?
This is a maximum value. Probably there are less trips available then desired

logToConsole
optional
false
Turn on the log onto the console (for debugging purposes)

progressColor
optional
#6db64b
Default color name (or RGB code) of the progress bar
Default: RVV (Regensburger Verkehrsverbund) CI color (light green)

updateInterval
optional
30 * 1000
How often should the trip data be refreshed (in milliseconds)?
Default: Every 30 seconds