All Projects → deg0nz → MMM-PublicTransportBerlin

deg0nz / MMM-PublicTransportBerlin

Licence: MIT License
MagicMirror module to display public transport in Berlin and Brandenburg with BVG Hafas data.

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to MMM-PublicTransportBerlin

VBBNow
A VBB NotificationCenter Widget. It shows the nearby transit information
Stars: ✭ 23 (-37.84%)
Mutual labels:  berlin, vbb, bvg, vbb-hafas
vbb-hafas
A JavaScript client for Berlin & Brandenburg public transport HAFAS API.
Stars: ✭ 28 (-24.32%)
Mutual labels:  berlin, vbb, bvg
bvg-topological-map
BVG transport map as a nice SVG.
Stars: ✭ 15 (-59.46%)
Mutual labels:  berlin, vbb, bvg
vbb-rest
An HTTP API for Berlin & Brandenburg public transport.
Stars: ✭ 104 (+181.08%)
Mutual labels:  berlin, vbb, bvg
django-berlin
🍀 Ever wondered who's doing Django... in Berlin?
Stars: ✭ 65 (+75.68%)
Mutual labels:  berlin
gtfs-utils
Utilities to process GTFS data sets.
Stars: ✭ 19 (-48.65%)
Mutual labels:  public-transport
erfrischungskarte-frontend
Interactive map of Berlin that shows 🕶 shade areas, 💨 wind and 🌡 temperature intensities across the day
Stars: ✭ 18 (-51.35%)
Mutual labels:  berlin
pt2matsim
Package to create a multi-modal MATSim network and schedule from public transit data (GTFS or HAFAS) and an OSM map of the area.
Stars: ✭ 29 (-21.62%)
Mutual labels:  public-transport
MMM-EARTH
A MagicMirror module to display real time pictures of Earth as it rotates - The sunlit side.
Stars: ✭ 48 (+29.73%)
Mutual labels:  magicmirror
MagicMirror-Module-Template
Template module for MagicMirror
Stars: ✭ 54 (+45.95%)
Mutual labels:  magicmirror
LuasataGlance
Android Wear and mobile app providing real-time tram stop information for Dublin's Luas light rail service.
Stars: ✭ 21 (-43.24%)
Mutual labels:  public-transport
awesome-expat
🌎 A curated list of resources for expats
Stars: ✭ 80 (+116.22%)
Mutual labels:  berlin
meetup-presentations berlin
R-Ladies Berlin - Collection of presentation and information
Stars: ✭ 24 (-35.14%)
Mutual labels:  berlin
MMM-Bring
A module for the MagicMirror that displays your Bring! shopping list.
Stars: ✭ 18 (-51.35%)
Mutual labels:  magicmirror
MMM-MagicMover
MagicMirror² module to avoid screen burn-in
Stars: ✭ 21 (-43.24%)
Mutual labels:  magicmirror
mmpm
MagicMirror Package Manager
Stars: ✭ 104 (+181.08%)
Mutual labels:  magicmirror
MMM-LocalTransport
A module for the MagicMirror to display informations about local tranportation.
Stars: ✭ 35 (-5.41%)
Mutual labels:  magicmirror
dm tomatrixled
Display (real-time) public transport departures using Raspberry Pi and LED matrices
Stars: ✭ 17 (-54.05%)
Mutual labels:  public-transport
MirrorMirrorOnTheWallSkill
Alexa skill for controlling a MagicMirror²
Stars: ✭ 37 (+0%)
Mutual labels:  magicmirror
berlin corona cases
Scraper for the official dashboard with current Corona case numbers, traffic light indicators ("Corona-Ampel") and vaccination situation for Berlin.
Stars: ✭ 19 (-48.65%)
Mutual labels:  berlin

MMM-PublicTransportBerlin

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

It shows live public transport information for Berlin and Brandenburg based on BVG-Hafas data. Public transport in Brandenburg should work as well.

MMM-PublicTransportBerlin uses the hafas-client with a BVG-specific profile by derhuerst.

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.

Status

The current development status of this module is: maintained This means: I'm open for feature requests, pull requests, bug reports, ...

Screenshot

The module looks like this:

Example for Alexanderplatz with time delay

Preconditions

  • MagicMirror² instance
  • Node.js version >= 12
  • npm

Installation

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

git clone https://github.com/deg0nz/MMM-PublicTransportBerlin.git
cd MMM-PublicTransportBerlin
npm install

Update

Just enter your MMM-PublicTransportBerlin folder in the MagicMirror's modules folder and execute the following commands in the module's directory:

git pull
npm install

How to get the stationId

You will need a stationId for your module. You can get it as described in the BVG-rest API documentation. This is a cURL example for getting all possible stations with the keyword "alexanderplatz":

curl 'https://v5.bvg.transport.rest/locations?query=alexanderplatz'

The answer should contain one or more possible stations with valid station IDs. More queries are possible, like searching via coordinates or autocompletion of stations. Please check the BVG-rest API documentation for more options. Please note, that you need to query 1.bvg.transport.rest.

You can prettify the JSON output with jq if you have it installed:

curl 'https://v5.bvg.transport.rest/locations?query=alexanderplatz' | jq

Configuration

The module quite configurable. These are the possible options:

Option Description
name The name of the module instance (if you want multiple modules). This value must be unique.

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

Type: string This value is Required.
directionStationId If you want the module to show departures only in a specific direction, you can enter the ID of the next station on your line to specify the direction.

Note: After some tests, the data delivery of this feature seems not to be as reliable as the normal version. Also, please make sure you actually have the right stationId for the direction station. Please check your MagicMirror log for errors before reporting them.
Additionally, more request results take more time for the request. So please make sure to keep your maxUnreachableDepartures and maxReachabledepartures low when using this feature.


Type: string
Default value: <empty>
ignoredLines You can exclude different lines of a station by adding them to this array. Usually, this can be empty.

Type: string array (comma separated strings in the array).
Default value: <empty>
Possible values: All valid line names like 'U5' (for subway) , 'M10' or '21' (for tram), 'S75' (for suburban) , 'Bus 200'(for bus), etc.
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
travelTimeToStation How long does it take you to get from the mirror to the station? The value is given in minutes. (this is the former delay option)

Type: integer
Default vaule: 10 // 10 minutes
departureMinutes For how many minutes in the future should departures be fetched? If travelTimeToStation is set > 0, then this time will be added to now() + travelTimeToStation. (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
showTableHeaders Show or hides the table headers.

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 travelTimeToSteation > 0

Type: integer
Default vaule: 3
maxReachableDepartures How many reachable departures should be shown. If your travelTimeToSteation = 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. Thìs value is also valid for travelTimeToSteation= 0

Type: float
Default vaule: 0.5
Possible values: 0.0 - 1.0
excludeDelayFromTimeLabel The API provides time labels which include the delay time of the departure. This flag removes the delay time to show times like they are shown in the BVG-App.

Type: boolean
Default vaule: false
animationSpeed Speed of the update animation. The value is given in milliseconds.

Type: integer
Default value: 3000 // 3 seconds
showDirection Shows the direction in the module instance's header if the module instance is directed.

Type: boolean
Default value: true
useBrightScheme Brightens the display table.

Type: boolean
Default value: false
timezone Configure timezone.

Type: string
Default value: Europe/Berlin
shortenStationNames Whether to use vbb-short-station-name to shorten Station names.

Type: boolean
Default value: true

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

{
    module: "MMM-PublicTransportBerlin",
    position: "top_right",
    config: {
        name: "Alexanderplatz",
        stationId: "900000100003",
        hidden: false,
        ignoredLines: ["U5", "U8", "S75", "Bus 100"],
        excludedTransportationTypes: "bus,suburban,subway",
        travelTimeToStation: 10,
        interval: 120000,
        departureMinutes: 10,
        marqueeLongDirections: true,
        showColoredLineSymbols: true,
        useColorForRealtimeInfo: true,
        showTableHeaders: true,
        showTableHeadersAsSymbols: true,
        maxUnreachableDepartures: 3,
        maxReachableDepartures: 7,
        fadeUnreachableDepartures: true,
        fadeReachableDepartures: true,
        fadePointForReachableDepartures: 0.25,
        excludeDelayFromTimeLabel: true,
        useBrightScheme: true
    }
},

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

  • Michael Teeuw for inspiring me and many others to build a MagicMirror.
  • Jannis Redmann for creating the hafas-client. You made my life a lot easier with this! Please consider supporting him on Patreon!
  • The community of magicmirror.builders for help in the development process and all contributors for finding and fixing errors in this module.

Issues

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].