DriveTime is a lightweight device driver that, upon the press of a momentary button or performance of a custom command, provides the travel time and the best route from an origin address/coordinates to a destination address/coordinates, taking into account current traffic conditions (if driving). Traffic information is provided by Google Traffic.
Example: when pushed, the device updates its attributes indicating how long your commute to work is and the best route to take, e.g., for dashboard display or for Rule Machine rules.
- The duration attribute indicates how long (in seconds) the trip will take given current traffic conditions.
- The durationStr attribute is a human-friendly readable version of the duration attribute, expressed in hours, minutes, and/or seconds, as appropriate.
- The distance attribute indicates how far the trip is (in meters or miles, depending on the units selected)
- The route attribute indicates the best route to take, given current traffic conditions.
- The trafficDelay attribute indicates the delay attributable to current traffic conditions, above and beyond how long the trip would take without taking traffic conditions into account.
- The map attribute shows a map of the route
- The "navigateURL" attribute has the URL to use for autostarting navigation in the Google Maps mobile app
- The "navigateStartLink" attribute has a clickable link for the navigateURL, so that upon click of the link navigation is autostarted in the Google Maps mobile app
Installation:
- Install the device driver
- Add a new virtual device of the type DriveTime
- Get a Google Directions API key here. . Enable the Google Directions API. To enable the map attribute to display a graphical map with the directions, enable the Google Embed Maps API and make sure the same API key is allowed to make calls to that API also.
- Enter the Google API key into the preferences of the device
- Specify mode of transportation and units in the preferences of the device
Usage:
Option 1: Add the origin address and the destination address into the preferences of the device. Any "push" of the device will update the device's attributes. The device uses the Momentary capability for the button push, not the Pushable button capability.
Option 2: enter the origin and destination into the fields of the "Go" command, and perform the go command to update the device attributes
Supports various modes of transportation, including driving, walking, biking, and public transit (e.g., rail, tram, subway, bus)
Note: this device will remain lightweight. If you desire additional features, such as recurring trips, biasing of preferred routes, heads up on when to leave, push notification to specified devices upon arrival, advanced notice that will be late, scheduled checks of traffic, and more, check out the full-feature Multi-Place app.