This an extension for the MagicMirror. It will display the minutes until arrival of a selected bus number to a selected stop. The bus number and stop code can be configured in the config file. To use this module you will need to create a free Auckland Transport Developer Portal account.
- Navigate into your MagicMirror's
modules
folder - Execute
git clone https://github.com/Estanz0/MMM-AT-Bus.git
- Navigate to newly created folder
MMM-AT-Bus
Using the module
Add the below to the modules array in the config/config.js
file:
modules: [
{
module: "MMM-AT-Bus",
position: "top_left",
config: {
provider: "AT", // One of ['AT']
routeShortNames: ["NX1", "82"], // The short name of the bus route
stopCode: "7036", // The bus stop code (Displayed on Google maps)
forwardLimitHours: 2, // Show trips which begin within the set number of hours
refreshIntervalSeconds: 20, // Refresh frequency
key: "api_key" // The API Key for the selected provider
}
}
];
The following properties can be configured:
Option | Description |
---|---|
provider |
API Provider
AT: Auckland Transport |
routeShortNames |
A list of bus routes
The route short name is generally 2 - 3 characters and numbers. |
stopCode |
The bus stop code.
This can be found using the AT app, website or Google maps. |
forwardLimitHours |
Hours.
Buses arriving further in the future than this limit will not be displayed. |
refreshIntervalSeconds |
Seconds.
How often the arrival times should be refreshed. |
key |
A developer API key for the provider APIs.
For AT this can be obtained by signing up for a developer account (subscription) through the AT developer portal product subscription. Note: it can take a few days for your developer account to be activated after signing up. |
AT app:
- Go to live departures and select a stop from the map.
- Bus route can be seen on the left hand side.
- Stop code can be found up the top.