A MagicMirror module that displays when Sydney trains depart from a selected station, using raw GTFS data provided by the NSW Transport API.
- A MagicMirror2 installation
- Clone this repository into your MagicMirror/modules directory.
sudo apt-get install libsqlite3-dev
- cd into MagicMirror/modules/NextTrains directory folder
npm install sqlite3 --build-from-source --sqlite=/usr
sudo apt-get install sqlite3
- Create an account on Transport NSW OpenData
- Create an application and obtain an API key from Transport NSW OpenData Applications
- Make a copy of the sample server config file
cp ./server.conf.sample ./server.conf
- Replace <YOUR_API_KEY_HERE> in
server.conf
with your api key - Insert the example configurations into your MagicMirror config file
- No Windows version available yet
{
module: 'NextTrains',
position: 'bottom_right',
config: {
station: "Central Station",
maxTrains: 10
}
}
Option | Description |
---|---|
station |
The name of the Sydney train station to monitor e.g. "Central Station" or "North Sydney Station" |
staticInterval |
How often the widget should refresh it's static data (in seconds), default is 1800 . |
realTimeInterval |
How often the widget should refresh it's realtime data (in seconds), default is 10 . |
maxTrains |
The maximum number of trains to display at a time, default is 10 |
delaysFormat |
Either m , s or m:s Determines what format to display delays in, default is m |
lateCriticalLimit |
After how many seconds to highlight a delay as critically late (red text), default is 600 |
etd |
Estimated time of departure - show departure time in time format, default is false |