Giter Site home page Giter Site logo

deg0nz / mmm-publictransportberlin Goto Github PK

View Code? Open in Web Editor NEW
40.0 7.0 20.0 1 MB

MagicMirror module to display public transport in Berlin and Brandenburg with BVG Hafas data.

License: MIT License

JavaScript 92.85% CSS 7.15%
magicmirror vbb-hafas station departure berlin vbb bvg bvg-hafas public-transport

mmm-publictransportberlin's People

Contributors

danielhabenicht avatar deg0nz avatar dependabot[bot] avatar fry0815 avatar greenkeeper[bot] avatar jargendas avatar kibotu avatar kristjanesperanto avatar marclandis avatar rejas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mmm-publictransportberlin's Issues

The module is not working

Hi, I have some troubles with this module.

I installed it correctly with the given commands and I can also see the Folder.
Then I copied the example (alexander Platz) into the Magic mirror config where all the other modules are.
When I start MM nothing happens, all other modules load smoothly, but not the transportation module, not even an error message. It’s just like the code of this module isn’t there but I double checked everything.
Did I something wrong?

thank already for the replys!

transport.rest is deprecated

Hey! This is the author of vbb-rest, deployed at transport.rest. Nice to see that you (seem to) use my service!

I'm here to let you know that The API & format deployed at transport.rest is deprecated. Please use the new API, deployed at vbb.transport.rest. You can find docs for the new format in the vbb-rest repo.

ignored stations problems

Hey again, i don't really know if i am too stupid or if it don't really work.

so i am living on the edge of fisherinsel. Around the corner I've got "Märkisches Museum"

so i wanted to ignore the busses which drive in the direction "Märkisches Museum" / "Ostbahnhof"
name: "Fischerinsel",
stationId: 900000100526,
hidden: false,
is working fine!
But when i try ignoredStations i still see the busses which drive in direction Märkisches Museum / Ostbahnhof.
i tried
ignoredStations: [900000100014, 900000100516, 900000120005, 900000120010, 900000261491],

and also this format:
ignoredStations: ['900000100014', '900000100516', '900000120005', '900000120010', '900000261491'],

BUT: If i combine both:
ignoredStations: [900000100014, 900000100516, 900000120005, 900000120010, 900000261491, '900000100014', '900000100516', '900000120005', '900000120010', '900000261491'],

at least every bus in direction Märkisches Museum disappears!

Change module design to look like VBBNow

Change the module Design to look like the VBBNow macOS widget.
(For the departure entries)

Maybe leave the current design as fallback option or so.. (for people who don't like the new design..)

Module is not showing anymore

Hey there,

after I installed my MM-config completly new, the MMM-PublicTransportBerlin won't load anymore.
Before all was fine...can everybody help me or have the same problem?

thx

Neues Format für Abfahrtzeit

Kann die Abfahrtzeit wahlweise auch als 'in x Minuten' angezeigt werden?
Bei Zeiten => einer Stunde (Ja, auf dem Lande gibt es sowas...) dann als Uhrzeit.
Also so wie bei DAISY ...

Config file error after update

Hi deng0nz,

great module, great work. I have updated to the new version and also your new entry for the config.js, but I always get the "config file error". Even when I take a blank config.js with just MMM-PublicTransportBerlin and your "Alexanderplatz" entry as a single module. Tried everything, like js-linter and so on, nothing worked out.

Any idea?

Thanks in advance
wominator

Error: station ID must be a valid IBNR.

I found in the logs an error regarding a missing INBR:

[01.10.2021 15:58.44.520] [ERROR] Error: station ID must be a valid IBNR. at Object.formatStation (/home/pi/MagicMirror/modules/MMM-PublicTransportBerlin/node_modules/hafas-client/p/bvg/$ at Object.stop (/home/pi/MagicMirror/modules/MMM-PublicTransportBerlin/node_modules/hafas-client/index.js:285:53) at BvgFetcher.getDirectionDescriptor (/home/pi/MagicMirror/modules/MMM-PublicTransportBerlin/BvgFetcher.js:35:39) at Class.sendInit (/home/pi/MagicMirror/modules/MMM-PublicTransportBerlin/node_helper.js:47:47) at processTicksAndRejections (internal/process/task_queues.js:97:5)
I've got the right stationId by the BVG-API.

Can't get the new stationId! Please help.

Hi, when I start the script by typing node ./convenience/query_stations.mjs, then I get the following:
import { createClient } from "hafas-client";
^^^^^^^^^^^^
SyntaxError: Named export 'createClient' not found. The requested module 'hafas-client' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'hafas-client';
const { createClient } = pkg;

at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
at async loadESM (node:internal/process/esm_loader:91:5)
at async handleMainPromise (node:internal/modules/run_main:65:12)

Any ideas for help?

Update error

I have a issue on update. Any idea to fixes it ?

npm-install

On fetch failure the previous result is discarted

I keep seeing fetch failures (400), while the data from the previous fetch would still be current enough to display something ..

Maybe keeping the last result until the next successful fetch would make sense?

"Fehler bei Daten abrufen" - Problems to fetch Data

I get the following error Message display at the Mirror:

"Fehler bei Daten abrufen: {"isHafasError":true,"message":"Internal Server Error","statusCode":500}
Das könnte heißen, dass VBB-Daten gerade nicht verfügbar sind."

I used the sample config, and also reinstalled everything. But even after waiting a few days I get this message. So I think it is not a due to unavailability of the VBB Backend as the error message is intimating. Can you help me here?

Multiple Modules for the same `stationId` with different config, show the same data regardless of different `directionStationId`configuration

TLDR:

When having two modules for the same stationID but with different directionStationIDs, it shows the same result for both modules.

Expected behavior:

Each module uses its own config from the MM config file

Actual behavior:

Modules seem to be using a random(or the last occurrence) config from the MM config file based on the same StationID

Description

First of all, thank you for your work on this module, the stuff that works is really great.

I'm trying to achieve to separate the departures of the different directions, into different modules on the screen (so you can see at a glance when your S-Bahnhof is leaving, without checking the Destination (e.g. direction North, on the right widget, direction South the left widget). (The given example does it a little differently, but its about the DirectionStationId)

So I have two modules, one named BornholmerSuedwhich should show all departures from Bonrholmer Str. going to Gesundbrunnen, and one module showing Departures from Bornholmer Str. going to Schoenhauser Allee.

But what I'm getting is that it shows departures to Schoenhauser Allee only on both widgets. I already tried to switch the order of the modules in the config, even inserted some other modules in between the configs for both modules, but still the same result. Most of the time it seems to be using the LAST config for the station for both modules, but sometimes I think it used the second config, but both modules always show the same data.

I tried the same thing with some Tram stations, and got the same result.
If I have 4 modules, 2 for StationA and 2 for StationB, both StationAmodules show the same data and both StationBmodules show the same data. SO I CAN. have multiple modules but only if they are about different Stations.
It feels like it only fetches the data ONCE per StationIDand then uses that data for all modules requesting the same StationID, but without taking into account the different other parameters/filters

Example

Version: 6cfcbea

Config:

{
            module: "MMM-PublicTransportBerlin",
            position: "right",
            config: {
                name: "BornholmerRing",
                stationId: "900000110011",
                hidden: false,
                //Schoenhauser Allee
                directionStationId: "900000110001",
                ignoredLines: [],
                excludedTransportationTypes: "bus, tram",   
                travelTimeToStation: 10,
                interval: 120001,
                departureMinutes: 25,          
                maxDepartures: 15,
                marqueeLongDirections: true,
                showColoredLineSymbols: true,  
                useColorForRealtimeInfo: true,
                showTableHeaders: true,
                showTableHeadersAsSymbols: true,
                maxUnreachableDepartures: 3,    
                maxReachableDepartures: 6,
                fadeUnreachableDepartures: true,
                fadeReachableDepartures: true,
                fadePointForReachableDepartures: 0.25,
                excludeDelayFromTimeLabel: true
            }
        },
        {
            module: "MMM-PublicTransportBerlin",
            position: "left",
            config: {
                name: "BornholmerSued",
                stationId: "900000110011",
                hidden: false,
                //Gesundbrunnen
                directionStationId: "900000007102",
                ignoredLines: [],
                excludedTransportationTypes: "bus, tram",   
                travelTimeToStation: 10,
                interval: 120000,
                departureMinutes: 25,          
                maxDepartures: 15,
                marqueeLongDirections: true,
                showColoredLineSymbols: true,  
                useColorForRealtimeInfo: true,
                showTableHeaders: true,
                showTableHeadersAsSymbols: true,
                maxUnreachableDepartures: 3,    
                maxReachableDepartures: 6,
                fadeUnreachableDepartures: true,
                fadeReachableDepartures: true,
                fadePointForReachableDepartures: 0.25,
                excludeDelayFromTimeLabel: true
            }
        },

Bildschirmfoto 2020-09-27 um 17 50 41

MagicMirror - How to change the font?

We are beginners in Raspberry and Magic Mirror.
How can we change the font on modules in general? Is something like this possible?

Thx for every help we get.

Vincent

Display error

There is a display error, if the type of the train is e.g. "ICE, IC, LOC, EC".
They are displayed as "undefined" or "LOCOMORE" with yellow background.
Look at this example of ICE|EC
ice ec
or this example of LOC (what ever this is o.O)
loc

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

directionStationId not working

First of all thank you again for your hard work in cooperation with @derhuerst and making this module usable again.
Unfortunately I can't get the directionStationId to work like it did with vbb-rest. The IDs are the same with bvg-rest, but it isn't working as I can still see the lines in the other direction.
Is this an issue in bvg-rest?

TypeError: depArray[(i + 1)] is undefined

Sometimes the following error is shown in the user interface:

TypeError: depArray[(i + 1)] is undefined

I assume this appears when there is just 1 entry, in which case depArray[1], if i = 0, does not exist.

Module display only Loading on the Mirror

I have installed the module MMM-PublicTransportDB and adjusted the Config.
After a reboot this mirror appears at the module position only Loading …
What do I have to adjust to make the module work?
Here is my config
{
module: 'MMM-PublicTransportDB',
position: 'top_right',
config: {
name: "Bahnhof",
stationId: 8000139,
hidden: false,
ignoredStations: [],
excludedTransportationTypes: '',
delay: 10,
interval: 120000,
departureMinutes: 300,
maxDepartures: 15,
marqueeLongDirections: true,
showColoredLineSymbols: true,
useColorForRealtimeInfo: true,
showTableHeadersAsSymbols: true,
maxUnreachableDepartures: 3,
maxReachableDepartures: 7,
fadeUnreachableDepartures: true,
fadeReachableDepartures: true,
fadePointForReachableDepartures: 0.25
}
},`

`

Implement relative time label

Implement an optional function that shows relative times instead of absolute times for departures.

Idea:

2 update intervals:

  • 1 for updating time labels
  • 1 for updating actual data (which is already there)

"There are currently no departures at this station"

Hi,

I've been getting this message on my MM for fairly busy station, so far the only one I could get to work is Alexanderplatz as in your example.
Any idea what I'm doing wrong?

This is my configured module:


   {
                        module: "MMM-PublicTransportBerlin",
                        position: "top_center",
                        config: {
                                name: "U Mehringdamm",
                                stationId: "900000017101",
                                hidden: false,
                                ignoredStations:[] ,
                                ignoredLines:[] ,
                                excludedTransportationTypes: "bus,suburban,subway",
                                travelTimeToStation: 10,
                                interval: 120000,
                                departureMinutes: 10,
                                maxDepartures: 15,
                                marqueeLongDirections: true,
                                showColoredLineSymbols: true,
                                useColorForRealtimeInfo: true,
                                showTableHeaders: true,
                                showTableHeadersAsSymbols: true,
                                maxUnreachableDepartures: 3,
                                maxReachableDepartures: 7,
                                fadeUnreachableDepartures: true,
                                fadeReachableDepartures: true,
                                fadePointForReachableDepartures: 0.25,
                                excludeDelayFromTimeLabel: false
                        }
                },

Thank you in advance, big fan of the idea of this module!

GOTO: Async world

Change all the functions marked with //TODO: Make this function async to work with async/await to get rid of all the .then()s (Edit: Currently in develop branch)

List to check:

  • VbbFetcher.js
  • node_helper.js

Add informations prognosisType and occupancy from API

Hi there,

It would be great to add the information prognosisType and occupancy that are both provided from the v6.bvg api on which the hafas-client is deployed on.

prognosisType has different states, depending on whether real-time information is given or not. Most of the time trips that are cancelled are not officially cancelled in the systems, but you could still point them out because there is obviously no real-time data available, so prognosisType would be null. If we could get that information, we could mark those departures as different from those that are fitted with real-time data.
It would be great to make that an option in the configuration.
E.g., the well-known navigator app for iOS makes use of that information and displays departures with prognosisType: "calculated" (real-time information given) in italic and those without real-time information given (prognosisType: "null") in normal font.

image

occupancy is of course self-explanatory and it would be great to have the possibility to get another column with the information for each departure, including how full the train is expected to be.

e.g. output from https://v6.bvg.transport.rest/stops/900140518/departures?duration=120:

{
            "tripId": "1|42447|8|86|9022024",
            "stop": {
                "type": "stop",
                "id": "900140518",
                "name": "Sulzfelder Str. (Berlin)",
                "location": {
                    "type": "location",
                    "id": "900140518",
                    "latitude": 52.553312,
                    "longitude": 13.475765
                },
                "products": {
                    "suburban": false,
                    "subway": false,
                    "tram": true,
                    "bus": true,
                    "ferry": false,
                    "express": false,
                    "regional": false
                },
                "stationDHID": "de:11000:900140518"
            },
            "when": "2024-02-09T23:36:00+01:00",
            "plannedWhen": "2024-02-09T23:36:00+01:00",
            "delay": 0,
            "platform": null,
            "plannedPlatform": null,
            **"prognosisType": "calculated",**
            "direction": "Krankenhaus Köpenick",
            "provenance": null,
            "line": {
                "type": "line",
                "id": "27",
                "fahrtNr": "2100",
                "name": "27",
                "public": true,
                "adminCode": "BVT---",
                "productName": "Tram",
                "mode": "train",
                "product": "tram",
                "operator": {
                    "type": "operator",
                    "id": "berliner-verkehrsbetriebe",
                    "name": "Berliner Verkehrsbetriebe"
                }
            },
            "remarks": [
                {
                    "type": "hint",
                    "code": "FK",
                    "text": "Bicycle conveyance"
                }
            ],
            "origin": null,
            "destination": {
                "type": "stop",
                "id": "900180022",
                "name": "Krankenhaus Köpenick/Südseite (Berlin)",
                "location": {
                    "type": "location",
                    "id": "900180022",
                    "latitude": 52.438718,
                    "longitude": 13.592445
                },
                "products": {
                    "suburban": false,
                    "subway": false,
                    "tram": true,
                    "bus": true,
                    "ferry": false,
                    "express": false,
                    "regional": false
                },
                "stationDHID": "de:11000:900180022"
            },
            **"occupancy": "low"**
        },
        {
            "tripId": "1|59904|6|86|9022024",
            "stop": {
                "type": "stop",
                "id": "900140518",
                "name": "Sulzfelder Str. (Berlin)",
                "location": {
                    "type": "location",
                    "id": "900140518",
                    "latitude": 52.553312,
                    "longitude": 13.475765
                },
                "products": {
                    "suburban": false,
                    "subway": false,
                    "tram": true,
                    "bus": true,
                    "ferry": false,
                    "express": false,
                    "regional": false
                },
                "stationDHID": "de:11000:900140518"
            },
            "when": "2024-02-09T23:37:00+01:00",
            "plannedWhen": "2024-02-09T23:37:00+01:00",
            "delay": null,
            "platform": null,
            "plannedPlatform": null,
            **"prognosisType": null,**
            "direction": "Hohenschönhausen, Zingster Str.",
            "provenance": null,
            "line": {
                "type": "line",
                "id": "m4",
                "fahrtNr": "5846",
                "name": "M4",
                "public": true,
                "adminCode": "BVT---",
                "productName": "Tram",
                "mode": "train",
                "product": "tram",
                "operator": {
                    "type": "operator",
                    "id": "berliner-verkehrsbetriebe",
                    "name": "Berliner Verkehrsbetriebe"
                }
            },
            "remarks": [
                {
                    "type": "hint",
                    "code": "FK",
                    "text": "Bicycle conveyance"
                }
            ],
            "origin": null,
            "destination": {
                "type": "stop",
                "id": "900151003",
                "name": "Zingster Str. (Berlin)",
                "location": {
                    "type": "location",
                    "id": "900151003",
                    "latitude": 52.57236,
                    "longitude": 13.495164
                },
                "products": {
                    "suburban": false,
                    "subway": false,
                    "tram": true,
                    "bus": false,
                    "ferry": false,
                    "express": false,
                    "regional": false
                },
                "stationDHID": "de:11000:900151003"
            },
            "occupancy": "medium"
        },
        {
            "tripId": "1|44270|7|86|9022024",
            "stop": {
                "type": "stop",
                "id": "900140518",
                "name": "Sulzfelder Str. (Berlin)",
                "location": {
                    "type": "location",
                    "id": "900140518",
                    "latitude": 52.553312,
                    "longitude": 13.475765
                },
                "products": {
                    "suburban": false,
                    "subway": false,
                    "tram": true,
                    "bus": true,
                    "ferry": false,
                    "express": false,
                    "regional": false
                },
                "stationDHID": "de:11000:900140518"
            },
            "when": "2024-02-09T23:41:00+01:00",
            "plannedWhen": "2024-02-09T23:41:00+01:00",
            "delay": 0,
            "platform": null,
            "plannedPlatform": null,
            "prognosisType": "calculated",
            "direction": "S Hackescher Markt",
            "provenance": null,
            "line": {
                "type": "line",
                "id": "m4",
                "fahrtNr": "5242",
                "name": "M4",
                "public": true,
                "adminCode": "BVT---",
                "productName": "Tram",
                "mode": "train",
                "product": "tram",
                "operator": {
                    "type": "operator",
                    "id": "berliner-verkehrsbetriebe",
                    "name": "Berliner Verkehrsbetriebe"
                }
            },
            "remarks": [
                {
                    "type": "hint",
                    "code": "FK",
                    "text": "Bicycle conveyance"
                }
            ],
            "origin": null,
            "destination": {
                "type": "stop",
                "id": "900100002",
                "name": "S Hackescher Markt (Berlin)",
                "location": {
                    "type": "location",
                    "id": "900100002",
                    "latitude": 52.522605,
                    "longitude": 13.402359
                },
                "products": {
                    "suburban": true,
                    "subway": false,
                    "tram": true,
                    "bus": true,
                    "ferry": false,
                    "express": false,
                    "regional": false
                },
                "stationDHID": "de:11000:900100002"
            },
            "occupancy": "low"
        },
        {
            "tripId": "1|44377|5|86|9022024",
            "stop": {
                "type": "stop",
                "id": "900140518",
                "name": "Sulzfelder Str. (Berlin)",
                "location": {
                    "type": "location",
                    "id": "900140518",
                    "latitude": 52.553312,
                    "longitude": 13.475765
                },
                "products": {
                    "suburban": false,
                    "subway": false,
                    "tram": true,
                    "bus": true,
                    "ferry": false,
                    "express": false,
                    "regional": false
                },
                "stationDHID": "de:11000:900140518"
            },
            "when": "2024-02-09T23:43:00+01:00",
            "plannedWhen": "2024-02-09T23:43:00+01:00",
            "delay": 0,
            "platform": null,
            "plannedPlatform": null,
            "prognosisType": "calculated",
            "direction": "Falkenberg",
            "provenance": null,
            "line": {
                "type": "line",
                "id": "m4",
                "fahrtNr": "5438",
                "name": "M4",
                "public": true,
                "adminCode": "BVT---",
                "productName": "Tram",
                "mode": "train",
                "product": "tram",
                "operator": {
                    "type": "operator",
                    "id": "berliner-verkehrsbetriebe",
                    "name": "Berliner Verkehrsbetriebe"
                }
            },
            "remarks": [
                {
                    "type": "hint",
                    "code": "FK",
                    "text": "Bicycle conveyance"
                }
            ],
            "origin": null,
            "destination": {
                "type": "stop",
                "id": "900152007",
                "name": "Falkenberg (Berlin)",
                "location": {
                    "type": "location",
                    "id": "900152007",
                    "latitude": 52.570212,
                    "longitude": 13.526815
                },
                "products": {
                    "suburban": false,
                    "subway": false,
                    "tram": true,
                    "bus": true,
                    "ferry": false,
                    "express": false,
                    "regional": false
                },
                "stationDHID": "de:11000:900152007"
            },
            "occupancy": "medium"
        },

fetcher errors (TypeError, invalid-json)

After pulling the December changes, I'm seeing the following error multiple times right after MM2 startup:

[ERROR] Error initializing fetcher: TypeError: Cannot read property 'getStationName' of undefined

When the UI is loaded, the following errors appear:

[ERROR] FetchError: invalid json response body at https://bvg-apps-ext.hafas.de/bin/mgate.exe? reason: Unexpected end of JSON input
    at /home/magicmirror/MagicMirror/modules/MMM-PublicTransportBerlin/node_modules/node-fetch/lib/index.js:273:32
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async BvgFetcher.getStationName (/home/magicmirror/MagicMirror/modules/MMM-PublicTransportBerlin/BvgFetcher.js:27:19)
    at async Class.createFetcher (/home/magicmirror/MagicMirror/modules/MMM-PublicTransportBerlin/node_helper.js:22:27) {
  type: 'invalid-json'
}

module is not showing after fresh install

I have a fresh installed raspi running raspbian buster on it and a fresh installation of MagicMirror.
I tried to add the MMM-PublicTransportBerlin - module but it doesn't appear on the screen. The example config isn't running as well.

Running the former installation of my MagicMirror the module worked without any problems but it wasn't up to date anymore.

Limit number of cancellations shown?

Hello,

First off, allow me to say I love the app, it really looks great on my mirror :)

With all the strikes lately, I have been noticing that the app prioritizes showing cancelled departures first before anything else.

As a result of this, in joint S/bus stations, I am not able to see the bus departures because cancellations (even later ones) are shown before regular departures (I limit to showing 10 lines)

Is there a way to limit the number of cancellations shown? I have played with the options to no avail, so I don’t think the functionality exists but I figured I would ask if this could possibly be a future enhancement because I don’t see the strikes lessening any time soon :)

Departures not shown in order

Hey, thank you for the great module!

However I just setup a new instance and have some problems with the order of the departures shown (picture was taken at 12:10):
bildschirmfoto vom 2018-09-12 12-09-56

As you can see the U5 at 12:20 is shown as unreachable, although I set 5 minutes as travelTimeToStation and then there is the U5 at 12:10 shown as reachable, which would require running at the speed of light.
Last but not least one departure at 12:10 managed to get down between the departures at 12:15 and 12:20.

It's a bit hard to describe in words, but should be clear once you see the picture. Any idea what I can do to debug? Or give you more information?

$ node -v
v8.11.4
$ cat config/config.js
...
		{
		    module: "MMM-PublicTransportBerlin",
		    position: "top_right",
		    config: {
		        name: "Strausberger Platz",
		        stationId: "900000120006",
		        hidden: false, 
		        travelTimeToStation: 5,
		        //interval: 120000,
		        departureMinutes: 20,          
		        //maxDepartures: 15,
		        marqueeLongDirections: false,
		        //showColoredLineSymbols: true,  
		        //useColorForRealtimeInfo: true,
		        showTableHeaders: false,
		        //showTableHeadersAsSymbols: true,
		        maxUnreachableDepartures: 1,    
		        maxReachableDepartures: 12,
		        fadeUnreachableDepartures: false,
		        fadeReachableDepartures: false,
		        excludeDelayFromTimeLabel: false
		    }
		},
...

Startup crash with example config

Widget crashes, even with the default configuration.
node_modules were installed.

Transportation fetcher created. (Station ID: 9160003)
Whoops! There was an uncaught exception...
TypeError: dbClient.departures is not a function
at DbFetcher.fetchDepartures (/home/pi/MagicMirror/modules/MMM-PublicTransportDB/DbFetcher.js:56:21)
at Class.getDepartures (/home/pi/MagicMirror/modules/MMM-PublicTransportDB/node_helper.js:39:44)
at Class.createFetcher (/home/pi/MagicMirror/modules/MMM-PublicTransportDB/node_helper.js:28:14)
at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/MMM-PublicTransportDB/node_helper.js:117:18)
at Socket. (/home/pi/MagicMirror/modules/node_modules/node_helper/index.js:113:11)
at Socket.emit (events.js:182:13)
at /home/pi/MagicMirror/node_modules/socket.io/lib/socket.js:528:12
at process._tickCallback (internal/process/next_tick.js:61:11)

Hide single lines on a station

It would be cool if you can hide special lines on a station instead of the whole station. It could be useful when you only need one line of e.g. four lines on this station.

Odd fetcher crash

    {
      module: 'MMM-PublicTransportBerlin',
      position: 'top_left',
      config: {
        name: "U Pankstrasse",
        stationId: "900000009203",
        travelTimeToStation: 5,
        interval: 120000,
        departureMinutes: 30, 
        maxDepartures: 15,
        marqueeLongDirections: true,
        showColoredLineSymbols: true,
        useColorForRealtimeInfo: true,
        showTableHeadersAsSymbols: true,
        maxUnreachableDepartures: 2,
        maxReachableDepartures: 4,
        fadeUnreachableDepartures: true,
        fadeReachableDepartures: false,
        fadePointForReachableDepartures: 0.25
      },
      classes: 'default'
    },
    {
      module: 'MMM-PublicTransportBerlin',
      position: 'top_left',
      config: {
        name: "S+U Gesundbrunnen",
        stationId: "900000007102",
        travelTimeToStation: 12,
        interval: 120000,
        departureMinutes: 30,
        maxDepartures: 15,
        marqueeLongDirections: true,
        showColoredLineSymbols: true,
        useColorForRealtimeInfo: true,
        showTableHeadersAsSymbols: true,
        maxUnreachableDepartures: 2,
        maxReachableDepartures: 8,
        fadeUnreachableDepartures: true,
        fadeReachableDepartures: false,
        fadePointForReachableDepartures: 0.25
      },
      classes: 'default'
    },

gets me Error while fetching departures (for module Instance S+U Gesundbrunnen): TypeError: Cannot use 'in' operator to search for 'bg' in undefined, preventing rendering of this instance. The other one works.

Provide possibility to display time "app-like"

Currently, the times in the module are shown with the delay included, becausevbb-rest provides them like this.

Provide a config switch to show the delay times like they are shown in the BVG app.
(The originally scheduled time without the delay time)

Ignore stations close to the original station

If a station is close to the original station, the module displays lines which stop at both stations multiple times. Is it possible with the underlying vbb-hafas to ignore nearby stations and show departures from the original station only? I.e. if I want to show Departures from Potsdam Hauptbahnhof, ignore departures from Lange Brücke, since many trams stop at both stations, but showing it once is enough.

stuck at "Loading ..."

Hi,

I just tried out the MagicMirror² (current master 8010e6220d4cc68e9f9e3c1029998cc47df0f193) and your this module (current master, too). Run the npm install, but sadly it does not load the departure times, and got stuck at Loading ...

OS: Debian 8
Node: v5.12.0

my config:

{
	module: 'MMM-PublicTransportBerlin',
	position: 'top_right',
	config: {
		name: 'Kniprodestr./Danziger',
		stationId: 900000110021,
		hidden: false,
		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
	}
},

node serveronly output after loading the page:

Starting MagicMirror: v2.1.0
Loading config ...
Loading module helpers ...
Initializing new module helper ...
No helper found for module: clock.
Initializing new module helper ...
Initializing new module helper ...
Initializing new module helper ...
No helper found for module: compliments.
No helper found for module: currentweather.
No helper found for module: weatherforecast.
Initializing new module helper ...
All module helpers loaded.
Starting server op port 8080 ... 
Server started ...
Connecting socket for: updatenotification
Connecting socket for: MMM-FRITZ-Box-Callmonitor
Starting module: MMM-FRITZ-Box-Callmonitor
Connecting socket for: calendar
Starting node helper for: calendar
Connecting socket for: MMM-PublicTransportBerlin
Connecting socket for: newsfeed
Starting module: newsfeed
Sockets connected & modules started ...

Ready to go! Please point your browser to: http://localhost:8080
Received config for MMM-FRITZ-Box-Callmonitor
MMM-FRITZ-Box-Callmonitor is waiting for incoming calls.
Create new calendar fetcher for url: https://calendar.google.com/calendar/ical/*******/basic.ics - Interval: 300000
Create new news fetcher for url: https://www.heise.de/newsticker/heise-top-atom.xml - Interval: 300000
Create new news fetcher for url: http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml - Interval: 300000
Transportation fetcher for station Kniprodestr./Danziger Str. created. (Station ID: 900000110021)

I have tried different stations and the one from your example, same result. Is there a way to get more debug output?

Kind regards,
André

Allow configuring timezone

The timezone of my host system is configured as UTC (Europe/Reykjavík comes close) without daylight saving, and while I can configure the display TZ for the clock (via it's timezone configuration option), I can't for MMM-PublicTransportBerlin, resulting in always wrong times :-/

Bus logo shown as undefined with new server host

After @juliuste 's selfless help regarding the server problem of the last days, I'm encountering the following problem now:
I use the module to see when certain busses and a certain train are departuring. Bus and train have a separate entry in my config. The logo for the U-Bahn is shown as usual but the busses just show a purple background with "undefined" written on it. I still can see the departure time and the destination.
Does anybody else have the same problem with our new host?

Cannot read properties of undefined

Hi I am running this great module on my magic mirror but recently it stopped working spamming this error in the logs
Error while fetching departures (for module Instance MY_STATION): TypeError: Cannot read properties of undefined (reading 'fetchDepartures')
where I replaced my station name with MY_STATION.

Is this a known error? Otherwise please let me know how I can provide additional info if needed

can't run MM when your module is activ....

Hi, i just installed your module on my Raspberry Pi 1 (Model B) with Midori Browser.
unfortunately whenever i put your example in my config.js i can't run Magic Mirror anymore , i just get an error that the server can't be loaded.
When i remove your example everything works like normal. Any way i can provide more info, so you can see why it doesn't work? (Or Tips what i should do?)

S-Bahn departures in Region Hannover not displayed

Hi,

it seems that the S-Bahn departures in REgion Hannover are loaded by the backend but not displayed ín the list on MagicMirror.

I've checked this for Barsinghausen (station ID 8000812) and Egestorf(Deister) (station ID 8001675). Bus departures are correcly displayed (both stations handle bus and S-Bahn; not more)

After enabling lines 69+70 in DbFetcher.js the console shows this
Parsing: Bus 501 nach Sporthotel um Wed Mar 22 2017 16:31:00 GMT+0100 (CET)
Parsing: Bus 502 nach Worthstraße um Wed Mar 22 2017 16:31:00 GMT+0100 (CET)

Parsing: S 2 nach Haste um Wed Mar 22 2017 16:42:00 GMT+0100 (CET)
(node:2333) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): TypeError: Cannot read property 'type' of undefined

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.