eXntrc
Member
Last one. Sorry again for hijacking the thread. I just really wanted to share this work with those who would understand and appreciate it.
Auto Nav
About
This time we'll use Tasker to route the Tesla navigation and Waze on the phone to the same destination at the same time. Even better, we can do the routing automatically just by getting in the car at a certain time of day.
For this to work you'll need:
This is all accomplished using a single script, which you can download here:
An example of how to call this script can be downloaded here:
IMPORTANT 1: The address must be fully qualified including City, State and Zip (in the US). Favorite names do not work due to a limitation of the Tesla navigation API.
IMPORTANT 2: The 'Auto Nav' script uses several variables. Those variables are described below and you must create these variables before the script will work. This video shows you how:
How to set Tasker Vars
Installation
Below is a photo of what the variables look like after they've been configured. %NavConfirm and %NavAddress may change each time, but the other variables are usually only set once.
Code Walk Through
The main guts of the automation are in the Tesla - Auto Nav script, but something needs to tell Auto Nav where to route. That's where the %NavConfirm and %NavAddress variables come into play.
In fact, here's a picture of the Nav Home script, which basically just sets these variables.
Here we're setting %NavAddress to another variable %HomeAddress. But %NavAddress can be set to any fully formed address (including City, State and Zip). Unfortunately Tesla favorite names do not work due to a limitation of their API.
After the variables are set, we simply call Tesla - Auto Nav to do the work. Let's take a look at that script:
This is a little long, but basically what we do is speak the confirmation prompt and show the user a Yes / No menu.
If the user selects Yes, we send the address on to Tesla using the Tesla plugin and send the same address to Waze using an Intent that Waze is listening for.
If the user selects No, we just speak the words "Navigation canceled".
Finally, we set a variable %AutoNavResult to either true or false in case some other script wants to know what the user chose.
This last part is optional but it's super powerful. As we showed in the Drive Mode automation, we can have tasks run automatically whenever the user gets in the car. We can also add conditions like "but only on these days" and "only during these times". With this in place you can set the car to automatically navigate to common destinations simply by getting in the car.
Here's an example:
Auto Nav
About
This time we'll use Tasker to route the Tesla navigation and Waze on the phone to the same destination at the same time. Even better, we can do the routing automatically just by getting in the car at a certain time of day.
For this to work you'll need:
This is all accomplished using a single script, which you can download here:
An example of how to call this script can be downloaded here:
IMPORTANT 1: The address must be fully qualified including City, State and Zip (in the US). Favorite names do not work due to a limitation of the Tesla navigation API.
IMPORTANT 2: The 'Auto Nav' script uses several variables. Those variables are described below and you must create these variables before the script will work. This video shows you how:
How to set Tasker Vars
Installation
- Install the software listed above including Tasker
- Import the Tesla - Auto Nav Task linked above
- (Recommended) Import the Nav Home Task linked above
- Set your vehicle name in the %TeslaName variable (see video above)
- Set your home address in the %HomeAddress variable (see video above)
- Set the %NavPromptTimeout variable to the number of seconds you'd like to wait for the user to confirm navigation before it's automatically cancelled
- Set the %NavPromptWait variable to the number of seconds you'd like to wait after the car is started before the user is prompted for navigation (this can be zero seconds)
- (Optional) Add the Nav Home Task to your notification center using Tasker -> Preferences -> Notification Action Buttons
Below is a photo of what the variables look like after they've been configured. %NavConfirm and %NavAddress may change each time, but the other variables are usually only set once.
Code Walk Through
The main guts of the automation are in the Tesla - Auto Nav script, but something needs to tell Auto Nav where to route. That's where the %NavConfirm and %NavAddress variables come into play.
In fact, here's a picture of the Nav Home script, which basically just sets these variables.
Here we're setting %NavAddress to another variable %HomeAddress. But %NavAddress can be set to any fully formed address (including City, State and Zip). Unfortunately Tesla favorite names do not work due to a limitation of their API.
After the variables are set, we simply call Tesla - Auto Nav to do the work. Let's take a look at that script:
This is a little long, but basically what we do is speak the confirmation prompt and show the user a Yes / No menu.
If the user selects Yes, we send the address on to Tesla using the Tesla plugin and send the same address to Waze using an Intent that Waze is listening for.
If the user selects No, we just speak the words "Navigation canceled".
Finally, we set a variable %AutoNavResult to either true or false in case some other script wants to know what the user chose.
This last part is optional but it's super powerful. As we showed in the Drive Mode automation, we can have tasks run automatically whenever the user gets in the car. We can also add conditions like "but only on these days" and "only during these times". With this in place you can set the car to automatically navigate to common destinations simply by getting in the car.
Here's an example: