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

Model S REST API

This site may earn commission on affiliate links.
We can speculate, but we'll never know for sure. Well, wk057 might know, but he's not talking.

BTW, to access the live supercharge info, it was just a simple HTTP GET call, but it was over the in-car Tesla VPN and not accessible elsewhere.
Yes, I saw traffic over OpenVPN, but such traffic is not visible by anyone (encrypted), so I'm not sure how wk057 could have accessed it. Oh well. Let's just see if Tesla makes it available.
 
Yes, I saw traffic over OpenVPN, but such traffic is not visible by anyone (encrypted), so I'm not sure how wk057 could have accessed it. Oh well. Let's just see if Tesla makes it available.

wk057 (and a few other people) have root access to the car, so they can reverse engineer the calls, as well as make their own calls through the VPN and retrieve and export the data.
 
Had to stop fiddling with this because of work so now just picking this back up. Does anyone know if AWS is still blocked? I messed with my code so much before I found the forum and saw others were having trouble that I'm not sure if my code timing out is my fault or it's just an AWS problem. Thanks!
 
Had to stop fiddling with this because of work so now just picking this back up. Does anyone know if AWS is still blocked? I messed with my code so much before I found the forum and saw others were having trouble that I'm not sure if my code timing out is my fault or it's just an AWS problem. Thanks!
AWS is still blocking or blocked (not sure which end). Use a proxy or relocate the code.
 
Have you noticed that the API often reports incorrect heading? It's typically off by either 90 or 180 degrees. I noticed that Tesla app also initially shows the incorrect heading for the car (the same one that the API reports) and then corrects the heading. All 3rd party apps that I have tried are affected by this.

response = {

"gps_as_of" = 14906975;

heading = 191;

latitude = "xx.981397";

longitude = "-xx.238153";

power = 1;

"shift_state" = "<null>";

speed = "<null>";

timestamp = 1490056976311;

};
 
  • Like
Reactions: SG57
I actually tend to find the heading to be correct most of the time. It's usually the heading of the direction, and not where the front of the car is facing. I have a parking spot that I have to back into, and the heading is always correctly pointing towards the back of the car after I park, because that is the last known direction I was heading.
 
  • Like
Reactions: SG57
If speed is zero, that's what I'd expect. It needs velocity before it can calculate heading. Even with accurate GPS, you can get an accurate fixed location, but no heading without movement.

That's true if the car doesn't have a magnetometer (as most phones do these days).
The fact that Tesla app gets the heading right every time, leads me to believe that Tesla computes the heading using a magnetometer sensor whose output is not available through the API.
It is still strange that the heading reported by the API when the car is stationary, is off by 90 or 180 degrees (when it's reported incorrectly) not by a random offset.
 
  • Like
Reactions: SG57
Yep, it was originally some MITM proxy watching. Then I just decompiled the Android APK. In the new React Native version, they actually have a JSON file with all the endpoints listed: Tesla API Endpoints · GitHub

BTW, that shows a new /data endpoint. That gets a combination of all the *_state endpoints so you can get all that info in one call instead of 5 :)

Handy Gist - but it looks to me like /oauth/revoke does not work. Has anyone successfully used it?
 
  • Love
Reactions: bmah
Oh good. I'll try my Alexa skill tonight. BTW, is anyone else seeing this in climate_state:

is_front_defroster_on: 3

I see
"is_front_defroster_on":null

I don't think I've seen
"is_front_defroster_on":3

But I don't think I've tried it with the front defroster on. My car is currently in service, but when I get it back I check with different settings. I'm still hoping for a way to control the rear seat heat from the API. Having to ask the driver to adjust your seat heat is silly.
 
Last edited: