This is a departure board made for MagicMirror² using the Entur API. The board can show the next departures for all public transport in Norway including any mode of transportation.
Enter your MagicMirror² module folder, e.g.:
cd ~/MagicMirror/modules
Clone the repository
git clone https://github.com/Arve/MMM-Entur-tavle.git
Add the departure board to your configuration file, for instance:
{
module: "MMM-Entur-tavle",
position: "top_right",
config: {
stopId: '58366',
stopType: 'StopPlace',
numResults: 5,
showName: true,
highlightRealtime: true
}
},
Currently available configuration options are as follows:
| Option | Description | Default value |
|---|---|---|
| stopId | String. A valid ID for a stop or quay (platform) from Entur's directory of stopPlaces. You can either query for this through their GraphQL IDE, or extract the stopId from the query string generated when searching for a departure-board on https://en-tur.no. See documentation below | "12345" |
| stopType | Chooses whether the place you are querying in stopId is a StopPlace or a quay.,A quay can for instance be a specific platform on a stopPlace - such as buses departing in a specific direction. Valid values are "StopPlace" and "Quay" (case sensitive). See separate documentation on stopType below. | "StopPlace" |
| numResults | Integer. The maximum number of results of to be returned from the query. | 5 |
| showHeader | Boolean. Whether to show the name of the stop or quay above the list of departures from the stop. | true |
| highlightRealtime | Boolean. If set to true, departures that are updated with realtime info will be slightly bolded. |
false |
| updateSpeed | Integer. The transition speed when updating the display | 1000 |
| size | String. One of "xsmall", "small", "medium", "large" or "xlarge" | "medium" |
| refresh | Integer. Seconds between board refresh | 30 |
| showTransportMode | Boolean. Show the transporte mode as an icon. | false |
The simplest way to locate your stopPlace is to extract it from a query on the Entur web interface:
- Click on "Avgangstavle"
- Search for your stop and select it from the dropdown
- Inspect the browser's address bar. Look for the
idquery parameter - Look for the numeric ID following
StopPlace%3A-
and extract it.
In the Entur/Journeyplanner API, a stopPlace can be an area where there are multiple platforms and modes of transporation within a limited geographical area (or it could simply be different platforms on the same stop). In the case where you want to query a specific quay/platform instead of an entire stopPlace, set the value of stopType to Quay.
To get the specific quay, you will probably want to extract it from the GraphQL IDE. You can use this query.
Replace the numeric part of the stopPlace ID ( NSR:StopPlace:56338 ) with your own stopPlace's numeric id and run the query. In the right-hand window, you will have a number of departures from that stopPlace, and each of the results will have sections similar to the following:
"quay": {
"id": "NSR:Quay:7184"
},
"destinationDisplay": {
"frontText": "Vestli via Majorstuen"
},
… look for the quay number that corresponds to the frontText of the quay/platform you wish to display travels from.
This plugin fully supports multiple instances on the same MagicMirror² instance. If you wish to display different platforms separately, use the stopType configuration option with separate quays as suggested above.
This module fetches data licensed under the Norwegian License for open Government Data (NLOD) delivered by Entur, but the application/module itself is not developed, maintained or endorsed by Entur.
- Localization
- Inclusion of transport mode (Bus, plane, train, etc.) in display
- If other travel authorities offer access to the same GraphQL-based API: Add support for these as well. If you know of any such, please file an issue.