Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

Automating your Tesla from your phone using Automate

This site may earn commission on affiliate links.
I send a wake up command, but I'm not sure it's necessary.

Wake-Up.png


I add a 10 second delay before sending the HVAC On command.

HVAC-On.png


Next we check the output and if it fails, we loop back to the 10 second delay block and try again.

Results.png
 
This looks great! It also looks like a ton of data to enter when getting started. Would you be willing to export and share the .flo (sanitized of your specifics) so others can import it as a starting point?
 
Further on this after about an hour of experimenting (and reminding myself JSON syntax.) I have just successfully turned on the A/C from an iOS Shortcut.

(And to answer my own question re. IFTTT: yes, with Webhooks, but it doesn't seem to support the necessary ability to include the Authorization token in the header.)

Can you provide some insight into how you got this setup in Shortcuts app? Would love to be able to unlock charge port and/or open frunk with a command.
 
Can you provide some insight into how you got this setup in Shortcuts app? Would love to be able to unlock charge port and/or open frunk with a command.

Sure -- these are very crude, but:

This one will get the access token (obviously, substitute your own email and password):

uALoPU8.png


You'll also need to get the vehicle ID, which I didn't happen to make a workflow for, and then use the token and the ID in this:

j66Kaox.png


Obviously, getting the right ID should be coded, and this should all be rolled into one, or a set that call each other, etc. -- but the principles are here, and known to work.
 
GPinzone... first of all, thank you so much for sharing this, I have been looking for just such a feature since Tesla seem to have left it out of the App for model 3 users. It must have taken you a great amount of time to build and test each step.

I have installed Automate and imported the .flo
I have updated the username and password and lat/long coordinates.
Is there anything else I need to do to get it working? I'm assuming the tesla.txt file gets created after running the process the first time?

When I run it, i get the following:

2018-11-29 16:04:49.924 INFO 5@1: Flow beginning
2018-11-29 16:04:49.925 INFO 5@59: File exists?
2018-11-29 16:04:49.947 INFO 5@48: Time await

and nothing happens after that..any ideas?
 
I tried Dashboard for Tesla. It didn't really work. Half the time it lost contact with the car and the widgets were grayed out.

I understand that sometimes the car is going to be out of contact and unreachable, but I expect that to be fairly rare. And even when the car is out of contact, I want the widget to still be active and when I press it I want the app to go off in the background and do what it needs to to re-establish contact with the car.

The Nissan LEAF app acted like the Tesla app does (and Dashboard for Tesla) in that it would appear to be out of contact with the car. The only way to get it back in contact was to force stop it and re-run, and then magically it would connect right away (just like the Tesla app, and just like, I presume, Dashboard for Tesla). But somebody wrote a nice app that not only automated that basic procedure in the background, but added some very useful widgets (and individual widgets too, not just a 4x1 row of them that I'm stuck with, even if I only need 2).
Is your app going to keep the car from sleeping? Might contribute to battery range loss. The few seconds it takes for your Tesla app to wake the car seems a good trade off. I’m always concerned about third party apps security protocols.
 
Is your app going to keep the car from sleeping? Might contribute to battery range loss. The few seconds it takes for your Tesla app to wake the car seems a good trade off. I’m always concerned about third party apps security protocols.

See I just don't get the whole car sleeping/range loss things with Teslas. If my cell phone with its 2000mAh (~8Wh) or so battery can last a day or so and receive notifications instantly, why can't there be a small telematics component in the car that stays awake and wakes up the rest of the car's systems when it needs to? 8 friggin' watt hours is like 0.03 miles, not 3! If the entire car has to be kept awake and burning through 3-5 miles a day so that I can expect a reasonable response time when I go to check my car's status or pre-condition, then there is a serious architectural problem.

I WISH it were a few seconds to take the car up. Now that we are getting into heating season and pre-warming the car becomes more of a thing, half the time I am simply not even able to wake it up. Many times it's in the 1-2 minute time frame, with having to kill the app in between. But regardless, my point is that if I had an app that would reliably keep attempting to contact the car and then perform the requested action, I wouldn't have to sit there with my app out and my eyes on the phone waiting for it to wake up so the pre-condition button lights up. I should be able to just hit the button and let the app worry about waking up the car in the background.

As for security, yes, another complaint about Tesla.

With Nissan, yeah, their system is brain dead and you have to provide the password to the app, and you never know for sure whether they are going to use it nefariously. Of course there is very little you can do with the Nissan telematics, so really, who cares.

Not really so with Tesla. You could honk the horn, unlock doors and do all kinds of other stuff which might ruin your day. But my complaint with Tesla is that they use an authentication scheme that 100% supports having third party apps access limited functions without having to ever give that app your password....BUT THEY DON'T USE THIS FUNCTIONALITY! Why, Tesla? One of the reasons Facebook took off is that they provided an API for third party apps to use securely. Tesla could do the same for their vehicles if they simply turned this functionality on.
 
GPinzone... first of all, thank you so much for sharing this, I have been looking for just such a feature since Tesla seem to have left it out of the App for model 3 users. It must have taken you a great amount of time to build and test each step.

I have installed Automate and imported the .flo
I have updated the username and password and lat/long coordinates.
Is there anything else I need to do to get it working? I'm assuming the tesla.txt file gets created after running the process the first time?

When I run it, i get the following:

2018-11-29 16:04:49.924 INFO 5@1: Flow beginning
2018-11-29 16:04:49.925 INFO 5@59: File exists?
2018-11-29 16:04:49.947 INFO 5@48: Time await

and nothing happens after that..any ideas?

That's what's supposed to happen. The script waits there for the right time to be reached. I believe it's 4pm M-F. You can change that, too.
 
That's what's supposed to happen. The script waits there for the right time to be reached. I believe it's 4pm M-F. You can change that, too.

Yes I figured that but you can see that it is already past 4pm (This ran at 16:04) and nothing is happening:

2018-11-29 16:04:49.924 INFO 5@1: Flow beginning
2018-11-29 16:04:49.925 INFO 5@59: File exists?
2018-11-29 16:04:49.947 INFO 5@48: Time await
 
Hi lairdb, thanks for your posts of the "easy" iOS shortcut programming, but it's still a bit over my head. Is it possible to share that shortcut in the iOS gallery?

Also have you been able to program it for time of day and or location? with IFTTT?
 
Hi lairdb, thanks for your posts of the "easy" iOS shortcut programming, but it's still a bit over my head. Is it possible to share that shortcut in the iOS gallery?

Eeeeh -- I don't want to publish what I have, because it's not nearly production quality code. If I clean it up and make it robust, I'll share it -- but right now there's no error handling, wake up should be handled better, there should be a way to select from multiple vehicles.... (First I'd have to get my car back from service, though -- day 21 in my loaner.)

Also have you been able to program it for time of day and or location? with IFTTT?

I'm not entirely sure what you're saying. What would the desired behavior be?

Oh, do you mean to call the API from IFTTT? Haven't worked on that, but from what I can see, IFTTT Webhook Action does not support a custom header, so it would not be able to call the Tesla API directly. Apple Shortcuts can clearly call IFTTT though, if that's what you meant.
 
Last edited: