Shortcuts for Tesla

Update 2021-02-01: It looks like Tesla have deprecated their authentication endpoint so these shortcuts won’t work for new users. I’m working to update the shortcuts to support Tesla’s new authentication flow. Existing users who have already generated token information can continue to use them until their access token expires.


A collection of shortcuts to control and get information about your Tesla. These are especially useful when run from the home screen as widgets.

Setup and usage

These shortcuts use Tesla’s (unofficial) API to get information about your car and send commands to it. An access token is required for authentication when making these API requests, along with a specific car’s ID. This is initially generated using your Tesla login credentials.

I recommend creating a Tesla folder in Shortcuts to organize the Tesla shortcuts and show them on the home screen.

Configuration shortcuts

There are three “configuration” shortcuts required by each of the Tesla shortcuts. These shortcuts perform specific actions and are run within each of the Tesla shortcuts so they must be installed to work.

These configuration shortcuts are also used to set up Scriptable Widgets for Tesla. You only need to install them once to use these Tesla shortcuts or Scriptable widgets.

Tesla Settings

The Tesla Settings shortcut passes the access token needed by the shortcut in progress to perform requests. On its first run, the Tesla Settings shortcut prompts for your Tesla login credentials so it can generate required token information for your account. Your password is not saved at any point and is only used to create the token with Tesla’s API.

Once the token is generated, the access token information is saved to iCloud Drive for future use by these shortcuts. The Tesla Settings shortcut then only refers to the saved information and passes the token to the shortcut in progress so it can do so successfully. This keeps your token information safe as you don’t need to add it to the shortcut itself.

Access tokens expire after 45 days. Once it expires, the Tesla Settings shortcut automatically generates a new one using a refresh token—this was generated along with the access token. This avoids the need for you to enter your login credentials again. If there’s a problem with the access token and it doesn’t work, the shortcut falls back to generating new token information by prompting for your login credentials.

Tesla Car Select

Each shortcut needs the ID of the car to send the command to or get information about. The Tesla Car Select shortcut gets the ID of your Tesla and passes it to the shortcut in progress. If you have more than one Tesla associated with your account, the Tesla Car Select shortcut displays a list to select from.

Tesla Wake Car

Teslas go to sleep after a certain amount of time and need to be woken up before it can be interacted with. The Tesla Wake Car shortcut wakes the car before the chosen shortcut runs.


Tesla Battery Status

Get the charging status, battery level, and estimated range of your Tesla in miles and kilometers. Also gets the estimated charge time if the car is currently charging.

Tesla Security Status

Check if the doors are locked. Sentry Mode is armed or disarmed, and if either the frunk or trunk are open.

Tesla Flash Lights

Command your Tesla to flash its lights.

Tesla Honk Horn

Command your Tesla to honk its horn.

Tesla Frunk

Command your Tesla to open the frunk.

Tesla Actuate Trunk

Command your Tesla to open the trunk. If you have a car with a powered tailgate, this command also closes the trunk.

Tesla Sentry Mode

Command your Tesla to arm or disarm Sentry mode.

Tesla Charge Port

Command your Tesla to open or close its charge port.

Find My Tesla

Locate your Tesla and get directions to it.

Tesla Revoke Token

Revokes your access token and deletes the saved information from iCloud Drive. You will need to enter your username and password information the next time you run one of these shortcuts.

Credits

My thanks to Tim Dorr for his unofficial Tesla API documentation.

Want to buy me a coffee?

I enjoy creating shortcuts and sharing them for everyone to enjoy. If you’d like to show your appreciation and help keep me caffeinated, consider sending a few bucks my way.

$3.00
$5.00
$10.00

Any contribution is greatly appreciated.

Donate

Changelog

  • 2020-12-29
    • Resolved issue where some shortcuts couldn’t access token information on iCloud Drive
  • 2020-12-20
    • Updated all shortcuts to resolve an issue where the “Tesla Auth” shortcut was reportedly missing. This was originally a name of what became the Tesla Settings shortcut. Despite renaming it before release, there seems to be a bug in Shortcuts that was causing some of these shortcuts to ignore the newer name. I’ve manually updated every shortcut to resolve this. I recommend deleting the existing shortcuts and installing them again.

18 replies on “Shortcuts for Tesla”

Hi Jordan. The Tesla Car Select shortcut it sent to first run the “Tesla Auth” shortcut but I don’t see that one on your site. Am I missing something? Thanks for any assistance you can provide.

Like

Did you download the shortcuts recently or a while ago? I originally published one of them with an incorrect shortcut reference but that has since been fixed. Try deleting the shortcuts and downloading them again. The Car Select shortcut should run “Tesla Settings” (“Tesla Auth” was my work-in-progress name for it).

Like

Hi Jordan, thank you for these shortcuts! I keep getting a “conversion error: failed because Shortcuts couldn’t convert from Text to Dictionary” whenever I try to run Tesla Settings. Any idea on what that is? Thank you in advance!

Like

It looks like Tesla have deprecated their authentication endpoint so these shortcuts won’t work for new users. I’m working to update the shortcuts to support Tesla’s new authentication flow but it’ll take a bit of time.

Like

Hi. I downloaded the 3 shortcuts first, and changed “auth” to “settings”. The open frunk shortcut works until the prompt “open frunk?” And when I select OK I get an error message that says “shortcut not found”. Please help?

Like

When did you download the shortcuts? I updated them not long after release so they shouldn’t be trying to run “Tesla Auth”. Can you delete the shortcuts and try downloading them again? You shouldn’t need to enter your username and password again.

Like

Don’t mind my last comment, I had an Auth I hadn’t replaced in Car Select, it works now, thanks very much! Now how do I launch this shortcut with Siri?

Like

Thanks for confirming. With your help, I was able to dig into the problem and fix the underlying issue with all the shortcuts. I’ve updated them all so they don’t need tweaking like you had to do.

To run shortcuts with Siri, you can usually just say the name of the shortcut you want. So “Hey Siri, Tesla Flash Lights”. If you want something more natural, either rename the shortcut or create a new one that contains an action to run your desired shortcut. For example, create a shortcut named “Flash the lights” that contains the action “Run Shortcut” to run the Tesla Flash Lights shortcut.

Like

Hi Jordan, i tried a few shortcut, like the Sentry Mode one, is not working, returning with error message “The file “settings.json” couldn’t be opened because there is no such file.”

Some others are working fine

Like

I am getting an error of incorrect credentials
My email for the car (including .com) and password are entered in exactly as they are when I login do I still need to charge something in the script? I downloaded these again today

Like

It looks like Tesla have deprecated their authentication endpoint so these shortcuts won’t work for new users. I’m working to update the shortcuts to support Tesla’s new authentication flow but it’ll take a bit of time.

Like

Hi Jordan, I was wondering if you could post what the json file should look like so that I could just enter my auth code, car id and anything else. This will allow me to get the shortcuts to work for now. I’m not very knowledgeable in regards to coding but I could definitely edit the file and save it back to the right spot in iCloud. Thanks in advance for your help.

Like

I don’t have an old copy of the JSON file handy to provide structure, unfortunately. That said, the access tokens will eventually expire and can’t be refreshed using the old authentication method. So anyone who can use these shortcuts will be on borrowed time until it’s possible to find a way to support the new process.

Like

Post a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s