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

Beta of a Hosted Data Logger via the Tesla API

This site may earn commission on affiliate links.
I've made a data recorder that is hosted, which mean you do not have to run any application on your computer.

I have 6 Tesla Model S being monitored and it seem to be working well so far (1 in USA right now and 5 in Canada).

I've just finished adding imperial unit for the result being display (was metric only before), so It time to get a few more tester on board.

Just send me a private message on the forum and I'll send you a link so you can register.

Currently it will store every minute your climate information and charging (It will group charging by session). It also log your real time GPS data grouped by trip.

You can see your Wh/miles for every trip you made.

I've added the head wind estimator also which give much better gps coordinate than the one from the browser only. So if Tesla tomorrow announcement doesn't include a better way to estimate Wh/mile usage by checking weather information, then with more data on different route, I'll be able to do it :)

You can set geo location where your car climate remain on even when you get out of the car. Great for when you are leaving or picking up the kid at the kindergarder and you don't want your car to get cold (or warm) on short stop.

There is a bunch of other feature that will be added, and I'm open to suggestions. I'm hoping to have enough user at some point to do some 'competition' of who have the lowest Wh/miles for example... But for the moment I'm focusing more getting interesting data for the car owner to monitor.

The UI is not pretty but does the job... Lot of things to improve, but what is important is the logged data, everything else can be done latter on.

So like I said, just PM me that your interested and I'll msg you the link.

PS... It useless if you don't have a Tesla Model S of course !
 
Last edited:
Yes ! Sadly Tesla API server doesn't allow direct query from the web browser, so I made it so you enter your Tesla login/password into a form that query a simple proxy web service on my server that doesn't store anything locally and forward it to Tesla. But if that still worry you, you can generate your own key and send it to me and I'll save it to your account.
 
I'm monitoring 6 car from the SAME IP and haven't seen any issues so far, though, I've already added support for multiple server and put car monitoring on different IP. I also only do about 2 or 3 query to the API per minute per car.

Your phone app can do more than 1 query per second sometime when your switching between tab. Even during normal operation, it does query much often than I do so you can see thing like door being open or closed

So I haven't seen any conflict with my phone app so far even when I was looking at a restaurant while supercharging.
 
Last edited:
I don't think I will... I started with 1 other Model S owner running the code on his side and as changes occur on my end, thing doesn't sync up on his end and require lot more work to allow transition. The reason I've made this hosted version is because we were just so out of sync, that it was simpler for me to migrate his data on my end that go forward with keeping multiple different version... And that with just 1 other user ! People want to run thing on Mac, Windows, Linux... In a cloud, on a local computer with different version of the software installed locally... I just don't want to deal with all that crap.

It why I want to work with the tesla token only and not with your actual login/password (except for the initial token generation, but I do not store it).

This mean that when your key expire or get revoked, you will have to generate a new one and no login will occur during that time.

The day Tesla allow direct Browser API call to their web service, I won't even receive on my server your initial credential. But in the mean time, all I can do is say that I will not store your tesla password in anyway ! (I need to store the email though so I can login to the streaming data)
 
I am curious about your data logger. I don't have a Tesla so I can't try it out. What is the Tesla API? Is there some link to more information? Where is the Data Logger run? An app in the car? An app on your computer? If it runs on a computer, how does it acquire the data from the car?
 
I am curious about your data logger. I don't have a Tesla so I can't try it out. What is the Tesla API? Is there some link to more information? Where is the Data Logger run? An app in the car? An app on your computer? If it runs on a computer, how does it acquire the data from the car?
You can check this site (it describe the old API but it easy to understand) : Tesla Model S JSON API—by apiary.io
 
Thank you for the link. This appears to be an API for creating Android and iOS applications for you tablet PC or smart phone. The API allows you log in and talk to Tesla's server. Tesla's server then communicates with your car to acquire the requested information or perform the requested action.

Does Tesla have a web site that you can log into to access information on the car, i.e. a log of trips that you have made including times, distance, origin, destination, kWh of energy used, etc.?
 
Do you know of any way to log real-time info from the car to an Android or iOS device? With conventional cars, you can use a Bluetooth OBD II scanner connected to the car's OBD II port and run an application such as Torque Pro that will query the various PIDs. That allows me to record the speed, power output of battery, battery temperature, power output of motor, and hundreds of other measurements several times a second.
 
Not per say documented, but there is some post on this forum about it. But the old api is still working for now I think, so you might want to tinker with it first.

Mine is a recent Model S and, therefore, it doesn't work with the old API. I have tried (using CURL) and had no luck. In my application, I would like to be able to invoke select commands from the new API using CURL. Any pointers you can provide would be much appreciated.
 
This is not the thread to talk about this, you should look for other thread which contain the information you need... But here a few curl command that work with the new API :

To Generate your key :
curl -H "Content-Type: application/json" -d '{"grant_type" : "password", "client_id" : "YOU MUST FIND THIS ON YOUR OWN", "client_secret" : "YOU MUST FIND THIS ON YOUR OWN", "email" : "YOUR TESLA EMAIL", "password" : "YOUR TESLA PASSWORD"}' https://owner-api.teslamotors.com/oauth/token

you will get an output witch contain your key... Do not ask for a key on every request... you might get blocked.

To get car information :
curl -H "Authorization: Bearer YOURKEYHERE " \
-H "Content-Type: application/json" \
-i https://owner-api.teslamotors.com/api/1/vehicles
You will get your car id from this command used for other commands

Get Car GUI info
curl -H "Authorization: Bearer YOURKEYHERE " \
-H "Content-Type: application/json" \
-i https://owner-api.teslamotors.com/api/1/vehicles/YOURVEHICLEID_PROVIDED_BY_THE_CAR_LIST/data_request/gui_settings

You must find the client_id and client_secret on your own ! (This is what people said in the other thread post, so I'll say it too).