NOTE: I deprecated this module. Please feel free to take a look at MMM-HK-Transport-ETA.
Station monitor for the Hong Kong KMB.
This module is an extension of the amazing MagicMirror2 project by MichMich which has inspired me to share my coding skills with others as well. Check it out, you know you want to :).
It's always nice to see mirrors using my work, so feel free to send me some screenshots of your implementations.
Lastly, why not join in on our discussions at the official MagicMirror2 Forum?
I wrote an article on Medium about the reverse engineering process. Hope you could enjoy it.
Here are the screenshots with different language settings:
en |
zh-tw or zh-hk |
zh-cn |
---|---|---|
v1.6.0
As of version 1.4.2, MMM-HK-KMB features language support for Traditional Chinese (zh-tw and zh-hk)
, Simplified Chinese (zh-cn)
and English (en)
.
A working installation of MagicMirror2
To add this module, go to MagicMirror folder and run the following command
cd modules
git clone https://github.com/winstonma/MMM-HK-KMB.git
cd MMM-HK-KMB
npm install
Please note that this module auto-creates a module header that displays the name of the chosen Hong Kong local transport stop. It is therefore recommended not to add a 'header' entry to your config.js for this module.
This module automatically disappears from your mirror as soon as a station has stopped offering connections at night. It reappears as soon as your chosen station is scheduled to be served again.
This module has been programmed to allow for multiple instances. Simply add more MMM-HK-KMB config entries to your config.js file to display multiple stations and configure them according to your needs.
Sample minimum configuration entry for your ~/MagicMirror/config/config.js
:
...
{
module: 'MMM-HK-KMB',
position: 'top_left',
config: {
stopID: 'HO06-S-1250-0', // Which stop would you like to have displayed?
}
} // If this isn't your last module, add a comma after the bracket
...
Sample configuration entry for your ~/MagicMirror/config/config.js
with optional parameters:
...
{
module: 'MMM-HK-KMB',
position: 'top_left',
config: {
stopID: 'HO06-S-1250-0',
hideInactiveRoute: false,
showLabelRow: false,
reloadInterval: 60000
}
} // If this isn't your last module, add a comma after the bracket
...
- Open your web browser and navigate to the kmb_eta page, developed by miklcct.
- In the
Enter the route number:
box, enter the KMB Bus route number that passes the stop. Then press the submit button. The destination and the home would be displayed. - After the submit of the bus route, the route origin and destination would be displayed. Choose the right direction by clicking the
Switch direction
button. - In the
Choose a route variant:
infobox, select the variant. - In the
Choose a stop in the list:
infobox, there is a list of stops with thestopID
displayed in the bracket. Fill thestopID
in theconfig.js
.
Option | Default | Description |
---|---|---|
stopID | HO06-S-1250-0 | Which stop would you like to have displayed? Default: HO06-S-1250-0 |
showLabelRowoptional |
true | Show or hide column headers Possible values: true, false |
hideInactiveRouteoptional |
true | Show or hide inactive routes Possible values: true, false |
reloadIntervaloptional |
60000 | How often should the information be updated? (In milliseconds) Default: Every minute |
This project is possible only when given the code js-kmb-api, which is developed by miklcct. Last but not least, I would like to dedicate my thanks to AlvinHKH, who implement working Android implementation BusETA.