Git Product home page Git Product logo

mmm-publictransportdb's Introduction


(!) This module is outdated and no longer recommended for use. I recommend https://github.com/raywo/MMM-PublicTransportHafas instead - it provides all the same functionality and more.

MMM-PublicTransportDB

MMM-PublicTransportDB is a module for the MagicMirror project by Michael Teeuw.

It shows live public transport information for Germany based on DB-Hafas data. MMM-PublicTransportDB uses the db-hafas library by derhuerst. It primarily displays data from the Deutsche Bahn, but also includes local networks that integrate their data into the DB network. Most, if not all, local transport networks in Germany should work. Following ones are tested:

  • RMV (Rhein-Main/Hessen): missing delays for buses, trams and subway

Notes:

  • The module is working fine. But I think some value combinations could still lead to strange behaviour. I'd appreciate any error report.
  • Fading for departures with delay = 0 is not yet implemented

You can enter a delay time for "How long does it take to get to my station?". Then the module calculates the next reachable departures and draws a line between reachable and unreachable departures.

Screenshot

The module looks like this:

Example for Alexanderplatz with time delay

Installation

Just clone the module into your MagicMirror modules folder and execute npm install in the module directory:

git clone https://github.com/olexs/MMM-PublicTransportDB.git
cd MMM-PublicTransportDB
npm install

How to get the stationId

You will need a stationId for your module from the DB network. TODO Link full list or query target to get station IDs.

Configuration

The module quite configurable. These are the possible options:

Option Description
name The name of the module instance (if you want multiple modules).

Type: string
stationId The ID of the station. How to get the ID for your station is described below.

Type: integer This value is Required.
ignoredStations To allow appearance of multiple transportation methods, vbb-hafas returns departures of multiple stations in the area of the main station (including bus and tram stations for example). You can exclude those stations by adding them to this array. Usually, this can be empty.

Type: integer array (comma separated integers in the array).
Default value: <empty>
excludedTransportationTypes Transportation types to be excluded from appearing on a module instance can be listed here.

Type: string, comma-separated list
Default vaule: <empty>
Possible values: bus, tram, suburban, subway, regional, ferry
marqueeLongDirections Makes a marquee/ticker text out of all direction descriptions with more than 25 characters. If this value is false, the descriptions are trimmed to the station names. You can see a video of it here (rendered by a regular computer).

Note: The rendering on the mirror is not perfect, but it is OK in my opinion. If the movement is not fluent enough for you, you should turn it off.

Type: boolean
Default vaule: true
interval How often the module should be updated. The value is given in milliseconds.

Type: integer
Default value: 120000 // 2 minutes
hidden Visibility of the module.

Type: boolean
Default vaule: false
delay How long does it take you to get from the mirror to the station? The value is given in minutes.

Type: integer
Default vaule: 10 // 10 minutes
departureMinutes For how many minutes in the future should departures be fetched? If delay is set > 0, then this time will be added to now() + delay. (This could be obsolete in future versions but is needed for now.)

Type: integer
Default vaule: 10
showColoredLineSymbols If you want the line colored and shaped or text only.

Type: boolean
Default vaule: true
useColorForRealtimeInfo Set colors for realtime information

Type: boolean
Default vaule: true
showTableHeadersAsSymbols Show the table headers as text or symbols.

Type: boolean
Default vaule: true
maxUnreachableDepartures How many unreachable departures should be shown. Only necessary, of you set delay > 0

Type: integer
Default vaule: 3
maxReachableDepartures How many reachable departures should be shown. If your delay = 0, this is the value for the number of departures you want to see.

Type: integer
Default vaule: 7
fadeUnreachableDepartures Activates/deactivates fading for unreachable departures.

Type: boolean
Default vaule: true
fadeReachableDepartures Activates/deactivates fading for reachable departures.

Type: boolean
Default vaule: true
fadePointForReachableDepartures Fading point for reachable departures.

Type: float
Default vaule: 0.5
Possible values: 0.0 - 1.0

TODO: Add new configuration values

Here is an example of an entry in config.js:

{
    module: 'MMM-PublicTransportBerlin',
    position: 'top_right',
    config: {
        name: "Alexanderplatz",
        stationId: 9160003,
        hidden: false,
        ignoredStations: [9100003,2342,1337], 
        excludedTransportationTypes: 'bus,suburban,subway',   
        delay: 10,
        interval: 120000,
        departureMinutes: 10,          
        maxDepartures: 15,
        marqueeLongDirections: true,
        showColoredLineSymbols: true,  
        useColorForRealtimeInfo: true,
        showTableHeadersAsSymbols: true,
        maxUnreachableDepartures: 3,    
        maxReachableDepartures: 7,
        fadeUnreachableDepartures: true,
        fadeReachableDepartures: true,
        fadePointForReachableDepartures: 0.25
    }
},

Multiple Modules

Multiple instances of this module are possible. Just add another entry of the MMM-PublicTransportBerlin module to the config.js of your mirror.

Special Thanks

Issues

If you find any problems, bugs or have questions, please open a GitHub issue in this repository.

mmm-publictransportdb's People

Contributors

deg0nz avatar olexs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.