mosesyong/MMM-SG-Transport-V2
Magic Mirror Module for SG Buses. Uses LTA Datamall V2 to get the bus information.
MMM-SG-Transport-V2
MagicMirror² Module - Local Transport in Singapore
This module displays data about bus arrivals. More than one bus stop can be specified.
This module aims to provide the most compact display possible with multiple bus stops.
Data is sourced from LTA DataMall v2, you need to get your own API key here.
This module works with MagicMirror2 project by MichMich
Screenshots
Legend
The number of stickman refers to the crowd level on the bus.
1 stickman - Seating available
2 stickman - Standing available
3 stickman - Limited standing
Prerequisite
A working installation of MagicMirror2
Dependencies
- npm
- unirest
Installation
- Navigate into your MagicMirror's
modulesfolder. - Execute
git clone https://github.com/mosesyong/MMM-SG-Transport-V2. - Execute
cd MMM-SG-Transport-V2. - Execute
npm install. - Edit the
config.js.
Configuration
Sample configuration entry for your ~/MagicMirror/config/config.js:
{
module: 'MMM-SG-Transport-V2',
position: 'top_left',
config: {
lta_api_key: "...",
refresh_interval: 30 * 1000,
bus_stops: [
{
BusStopCode: 43191,
name: "Opp St Mary's",
BusNumbers: [
"157",
"61",
"852"
]
},
{
BusStopCode: 43619,
name: "Opp Caltex"
}
]
}
},
| Option | Description |
|---|---|
lta_api_key |
REQUIRED API Key from LTA DataMall. Type: string |
refresh_interval |
OPTIONAL Optional integer value representing how often the data should be refreshed in ms. Type: integer |
BusStopCode |
REQUIRED Bus stop number. Type: integer |
name |
REQUIRED Custom bus stop name for the display. Type: string |
BusNumbers |
OPTIONAL Optional array of string containing bus numbers you wish to display. Invalid bus numbers will be ignored. In string format as bus numbers can contain alphabets.
Type: Array[string] |
Changelog
1.0.0 - First version of MMM-SG-Transport-V2 with bus prediction functionality
1.0.1 - Added change to display "No more buses" when no buses are expected to arrive
1.0.2 - Added display icon to show crowd levels based on number of stickman
Acknowledgements
- MMM-HK-Transport by winstonma
- MMM-SG-Transport by xuanyou (Depreciated)
License
MIT License
Copyright (c) 2020 Moses Yong (https://github.com/mosesyong/)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
