A MagicMirror module that displays the estimated transit time from a specified origin to a destination, with detailed transit information.
Before you begin, ensure you have access to the following:
- Google Maps Directions API Key: The module uses the Google Maps Directions API to fetch transit times. You can obtain your API key here.
- Navigate to your MagicMirror's
modules
folder withcd ~/MagicMirror/modules/
. - Clone this module by running git clone https://github.com/YourGithubUsername/MMM-MyTransitTime.git
- Navigate to the MMM-MyTransitTime folder and npm install
Option | Description |
---|---|
apiKey |
Your Google Maps API key. Required |
origin |
The starting address for your route. Example: "YOUR_ORIGIN_ADDRESS" . Required |
destination |
The destination address for your route. Example: "YOUR_DESTINATION_ADDRESS" . Required |
mode |
Mode of transportation. Default: "transit" . |
interval |
How often the module should update its data, in milliseconds. Default: 60000 (1 minute). |
showTransitDetails |
If set to true , the module will display step-by-step transit details. Default: true . |
customLabel |
Custom label for the module. Default: "Estimated Time to Get to Work" . |
debounceDelay |
Debounce delay in milliseconds. Default: 10000 (10 seconds). |
{
module: "MMM-MyTransitTime",
position: "top_right",
config: {
apiKey: "YOUR_API_KEY",
origin: "123 Main St, SomeCity, SomeCountry",
destination: "456 Elm St, AnotherCity, AnotherCountry",
mode: "transit",
interval: 60000,
showTransitDetails: true,
customLabel: "Time to Work",
debounceDelay: 10000
}
}
After adding the module to your config.js file, simply run the MagicMirror application. The module will display the estimated transit time and, if showTransitDetails is enabled, detailed transit steps.
Contributions are always welcome! If you'd like to contribute, please fork the repository and make your changes, then open a pull request.