Read the statement by Michael Teeuw here.
MMM-PublicTransportBerlin - Public transport for Berlin and Brandenburg (departures)
-
Hi,
I wrote a module that shows departures in Berlin and the surrounding state Brandenburg. The module uses a REST API that fetches data from the “Verkehrsverbund Berlin Brandenburg” (VBB). A guy named Jannis Redmann wrote it. So these credits go to him. It provides live data with departure delays. You can have a look at it here.
You can give a delay time for like “How long does it take to my next station?”. Delay times of the lines are considered and part of the calculation for the delay. A line is drawn at the time
now + delay, so the focus is on the departures you’re able to reach in the given delay time.It looks like this:

You can configure how many reachable and unreachable departures should be shown and turn the fading of both parts on and off. Some more options and multiple use of the module are available.
It’s working for now, but needs some more tests and UI tweaks.
Download :
[card:deg0nz/MMM-PublicTransportBerlin]
-
@Beh WOW, this is really cool! Unfortunately I don’t live in Berlin :( do you know if there’s such an api for other cities or even the DB?
-
Thanks :)
It seems that there exists data by DB, as they are mentioned on the HAFAS website as a costumer here.
I was able to find a REST API for Deutsche Bahn on programmableweb.com and GitHub.
Unfortunately it doesn’t seem to have a function to get just the departures. I’ll look into it. Maybe I can just switch the Fetcher for my module and make some tweaks to make it work.
EDIT:
OpenLok looks promising, btw.
-
@dbahn25 this works also for db https://forum.magicmirror.builders/topic/29/mmm-trainconnections
-
I added a marquee effect for direction descriptions which would be too long for the table width. Unfortunately it renders quite slow on the Pi. The transition of the text is not very fluid, but I think it’s ok if you need the long directions.
Here is a video of the marquee effect rendered by my computer connected to the mirror via wifi.
-
Thanks @Beh ! Great module!
Is there a chance to increase the radius of stations?
In my case, I can either check the bus or the underground since they have different IDs.
I would be perfect if I could get all possible departures from within 10 minutes walk.
Is there a chance to add multiple IDs?cheers
done -
Thank you @done :)
currently, you can’t look for multiple IDs, but:
Usually, the module gets data for all transportation systems and stations around a main station. For example, if you enter Alexanderplatz, it shows data for the s-bahn, underground, bus and tram stations as well, even if the station IDs for the real tram and bus stations are different than the ID for Alexanderplatz.
And I think, I don’t get your question right… Can you give me an example? Which stations would you like to have in the radius?
-
This post is deleted! -
(repost - too many spelling mistakes - couldn’t edit - don’t know which mistakes I’ve been missing now ;) )
I guess this is a “problem” of the rest api.
I live in an area where I have different stations to choose.
There is an underground station about 500 m away. A bus station also about 500 m and two other underground stations within 1 km.
I tried another module that uses the google api and it offered more than one station but only for a specific route/destination.
What I want is a module that shows all reachable stations in my area (let’s say within 1 km) with the next departure times without a specific destination.
If you want to check: I live in the area of Hohenstaufenstraße/Heilbronner Straße. Possible underground stations are Bayerischer Platz, Viktoria-Luise-Platz and Spichernstraße. Additionally there are 2-3 bus lines in that area I which use.
I think, there is no solution. :)
Cheers
done -
Hey @done,
I’ll look into this tomorrow night. maybe this issue can be solved… I’ve got some ideas… I’ll keep you updated!
-
Hey, @dbahn25
@olexs forked my module and added a fetcher for the whole DB transportation net to it. So you can use the whole DB net with the look of my module. ;)
Here it is:
https://github.com/olexs/MMM-PublicTransportDB -
First of all, I really appreciate these transport modules, great job.
With the new MMM-PublicTransportDB module, a nationwide transport checking is possible in theory, but I might have some problems with this.
After getting my station ID of interest from a csv-file of the Deutsche Bahn (http://download-data.deutschebahn.com/static/datasets/haltestellen/D_Bahnhof_2016_01_alle.csv), and implementing the module in the MagicMirror config file, either the module displays a loading string “lade…” or that no transport connection is found for this station…
I tried several stationIDs, the ones in the Github-example included, but none seem to work for me.
Any more ideas how to get it working?
Below my current config-file:{ module: 'MMM-PublicTransportDB', position: 'top_left', config: { stationId: 8079125, } },If I got this right only one parameter is necessary -> stationID, the rest is not required for now.
-
Hey @Jay, what Node.js version are you running?
-
Is it possible to add “express” to the TransportationTypes/excludedTransportationTypes? I just want to show IC/ICE/EC trains. The API from vbb-rest is supporting this feature.
-
@TobiasAlw could you please provide a link for me? Where can I find this feature in the
vbb-restdocumentation? -
@TobiasAlw Ahh, I see. Yeah, this should work. Just add all the transportation types you don’t want to see to the
excludedTransportationTypesstring in your configuration.All transportation types are listed here under “other parameters”.
-
Hi Beh, great module! Thanks!
It works on a standard browser (firefox, Win10) with node.js server side on a raspberry pi zero. But on midori installed on the pi zero it doesn’t appear on the screen.node -v : v7.7.1
npm -v : 4.1.2Do you have any idea?
-
@Photon2000 Yeah, the problem is, that midori doesn’t support ECMAScript 6 (ES6) features. But the module is using some of them.
Unfortunately I don’t have much time in the near future to convert the module to vanilla JavaScript in ES5 for you. You could try to convert the code with a compiler like Babel. Then it should work with midori.
-
@Beh Thanks for pointing me in the right direction! So I have two choices: finding a browser for th pi zero that supports ES6 or switch to PI2/3. Fair enough. I guess that other modules use ES6 too.
-
Hi all,
good news for Pi Zero users:
The new image “Raspbian Jessie with PIXEL” comes bundled with the chromium browser. I’ve installed it tonight and chromium works on the Pi Zero (W). If I connect to a serveronly installation of MagicMirror the “ES6-problematic” modules (im my case: compliments, MMM-PublicTransportBerlin) comes up.It’s not that fluently; CPU is 100% but it work’s.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login