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.
Are you guessing or do you know something?

I tried toggling range mode, no dice. There is no way to turn off 3G in the API specs we know of so far.
Educated guessing. Everyone piece of software on the planet has intended and unintended interrelationships of features. Sometimes you get lucky and find an interesting one with some simple probing.

My comment about 3G was hinting that I expect you'll lose your contact with the car if you turn off the 3G.
 
This is really weird, because I used to be able to resume charging by setting to max range from the app. I've done it several times while at public chargers, and I'm pretty sure I've done it while connected to my 14-50. But I can't do it now at home. It could be different because I'm now connected to a HPWC.

Edit: Actually, it's possible that I haven't done this since 1.19.39 or whatever the last one was.
 
Last edited:
This is really weird, because I used to be able to resume charging by setting to max range from the app. I've done it several times while at public chargers, and I'm pretty sure I've done it while connected to my 14-50. But I can't do it now at home. It could be different because I'm now connected to a HPWC.

Edit: Actually, it's possible that I haven't done this since 1.19.39 or whatever the last one was.

Just this weekend I mucked around with the app itself, when the car had fully charged. The standard charge completed, and overnight discharged to 230 or so miles.
In the app, moved from standard charge->Full charge;
Car started charging on its own (or at least the status moved to charging - the car was 100 miles away).
In the app, moved from Full Charge to Standard Charge
Charging continued until it was back up to 240 miles.

I have not updated the Model S app since it was released - is there a new version that doesn't allow this?
 
Just this weekend I mucked around with the app itself, when the car had fully charged. The standard charge completed, and overnight discharged to 230 or so miles.
In the app, moved from standard charge->Full charge;
Car started charging on its own (or at least the status moved to charging - the car was 100 miles away).
In the app, moved from Full Charge to Standard Charge
Charging continued until it was back up to 240 miles.

I have not updated the Model S app since it was released - is there a new version that doesn't allow this?


That is not the behavior I am seeing when calling the same commands via the REST API. It could be a bug or a race condition in my app. I will experiment some more with comparing the Android App and the REST API.
 
That is not the behavior I am seeing when calling the same commands via the REST API. It could be a bug or a race condition in my app. I will experiment some more with comparing the Android App and the REST API.

Hans, I am seeing the same as you using the app *and* my own s/w. I can no longer get it to charge anymore. As I stated in my post, it is more likely a car firmware issue.

finout, what firmware is in your car?
 
Hans, I am seeing the same as you using the app *and* my own s/w. I can no longer get it to charge anymore. As I stated in my post, it is more likely a car firmware issue.

finout, what firmware is in your car?

I will double check and let you know. Also, note that my car charged on Friday afternoon, and it wasn't until Saturday night that I started fiddling with it, well over 24 hours later; maybe that makes a difference?

UPDATE: I am indeed running 1.19.42. And I confirmed the test at 6 AM this morning: Car had fully charged; app said "charge complete". Moved slider to "Full Charge". Car started charging, indicating some number of hours remaining. Moved slider to "standard charge" and car continued charging, but indicated 6 minutes remaining (the 5 miles that had burned off since the charge completed).
 
Last edited:
I just posted a major rework to the JavaScript/Node.js library I put on GitHub (hjespers/teslams). It now includes a separate library, much better README, and points user to this forum thread for more info. I think I have included every known REST API call as well as all known values for the streaming API. Let me know if there are some more that I missed.
 
Has anyone figured out the timeout on the tokens for the streaming API?

Currently I am long polling until my initial token expires (HTTP 401: Unauthorized), then call "/wake_up", then call "/vehicles" to get a new token, then repeat.

This seems wasteful since I notice that the first token rolls over to become the second token long before it expires. I could just hop from one token to the next without ever having one expire and without ever having to pause and call /wake_up.
 
Last edited:
I guess with all the features you guys found, it must be possible to make an app that shows chargingpoints in range of your car!
Maybe showing it on the browser of your model s
unless the browser does not allow cookies or other workaround

openchargemap.org charginglocations is open and free for anyone to use!

Open Charge Map : The open, global database of electric vehicle charging locations

The car's browser is fine with cookie's but unfortunately it will not allow access to GPS location data :-(

It's very possible to write an app that will check your cars location via the REST API and compare it to the Open Charge Map. Each user would have to trust the person who hosts this app with their teslamotors login and password or they would have to run the app themselves somehow.

Tesla really needs to put up a cross site authentication system for third party web sites and apps (kind of like what facebook does). Add that to the long list of things for them to do I guess.
 
I guess with all the features you guys found, it must be possible to make an app that shows chargingpoints in range of your car!
Maybe showing it on the browser of your model s
unless the browser does not allow cookies or other workaround

openchargemap.org charginglocations is open and free for anyone to use!

Open Charge Map : The open, global database of electric vehicle charging locations

Yes, I have done this, and it works perfectly in my car, in the browser using the Plugshare API (which seems to be down at the moment :-(). I have it set to show all of the charging stations within around 50 miles.
 
The car's browser is fine with cookie's but unfortunately it will not allow access to GPS location data :-(

It's very possible to write an app that will check your cars location via the REST API and compare it to the Open Charge Map. Each user would have to trust the person who hosts this app with their teslamotors login and password or they would have to run the app themselves somehow.

Tesla really needs to put up a cross site authentication system for third party web sites and apps (kind of like what facebook does). Add that to the long list of things for them to do I guess.

can you not acces the Gps location via the rest api instead of the one in the browser?