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.
There is a lot of useful information that you are displaying. Is it possible to download the data for further analysis to your computer, i.e. in csv format? What is the time interval between each of the measurements shown for the trip stats. You obviously have GPS coordinates, speed, elevation, instantaneous power, and temperatures. How does the car know wind direction and wind speed? How does it know the elevation (is it GPS elevation)? Why is there a min and max elevation? Is the power shown just the power to propel the car? Or does it include accessories, a/c, and the heater? Can the accessories (DC to DC convert), a/c, and heater be separately measured?

For the charging data, what is the time interval between measurements? Can you obtain the amount of energy in the battery, i.e. kWh of energy remaining?
 
For those who want a locally run data logger:

https://github.com/hjespers/teslams

Before installing 'teslams' itself, install the windows version of "node" from: Node.js For me, on two different computers, only the win32 package worked (even though I am running 64 bit windows 7).

Then use the "npm" command (which got installed with node, so you may have to re-boot) to install "teslams":

npm install -g teslams

After that, see the "streaming" command on the "teslams" web page (first link above, scroll down).



Disclaimer: I have nothing to do with this... it just works, on my 2015 car, and works quite well.
 
There is a lot of useful information that you are displaying. Is it possible to download the data for further analysis to your computer, i.e. in csv format? What is the time interval between each of the measurements shown for the trip stats. You obviously have GPS coordinates, speed, elevation, instantaneous power, and temperatures. How does the car know wind direction and wind speed? How does it know the elevation (is it GPS elevation)? Why is there a min and max elevation? Is the power shown just the power to propel the car? Or does it include accessories, a/c, and the heater? Can the accessories (DC to DC convert), a/c, and heater be separately measured?

For the charging data, what is the time interval between measurements? Can you obtain the amount of energy in the battery, i.e. kWh of energy remaining?

Ok lot of questions there...

Is it possible to download the data right now, not really, but you could if your handy even as is. Do I intend to make it easier to do so, I'm not sure as I just see it as more trouble than it worth it. There are other project that are made to be run locally like the one mentioned by Iphe on your end to get data that you have to parse yourself already...

The site I've made is to help people visualize information right away without having to deal with anything else.

I've also made the site so it work for long term usage... I try to query tesla api as little as I can to get as much useful information as possible.

The time interval between each gps mesurements are in general about 250millisecond.

The car doesn't know wind direction, I download this information for weather API at the moment the car is at that exact location.

The elevation is GPS elevation. The Min and Max elevation is because it is grouped by a few hundred meters, so it show how steap the hill was, but in true, might not be really useful and might be removed.

Tesla only provide general power usage sadly, so include EVERYTHING. No you can't seperatly mesure accessories.

I store car climate and charging data every minute. You can't get the actual kWh available in the battery, but you can extrapolate it from the Range and the Rated Wh/km(or mile). In the video I show a SuperCharge from a 0 battery to full and it show about 77kWh. So 77kWh / .185 (rated Wh/km) = 416KM which is pretty close to what I get when full.

The car show a % but actually it more precise to check for the Range since it goes from 0-400km rather than 0-100% :)
 
I'm not sure how comfortable I'd be with this much data hosted by someone else, but what you've put together here is very impressive.

I agree with you ! I probably wouldn't use it myself if it was made by someone I didn't know and trust.

I have a very hard time to trust people in general... And I know whatever someone say really mean nothing to build trust, so I won't say anything :)

I'm happy some of you think I could be trusted and I'll do my best to not to let you down !
 
I agree with you ! I probably wouldn't use it myself if it was made by someone I didn't know and trust.

I have a very hard time to trust people in general... And I know whatever someone say really mean nothing to build trust, so I won't say anything :)

I'm happy some of you think I could be trusted and I'll do my best to not to let you down !

According to the information in post 23, Tesla may block requests from your server if you make too many requests and put to high a load on Tesla's server. If too many people use your server, then your server could be blocked. Maybe you could provide the server to others to run themselves?

Thank you for replying to all my questions in my previous post.
 
According to the information in post 23, Tesla may block requests from your server if you make too many requests and put to high a load on Tesla's server. If too many people use your server, then your server could be blocked. Maybe you could provide the server to others to run themselves?

Thank you for replying to all my questions in my previous post.

I've already load balanced the query on multiple IP, so it should be fine, also ready to change the IP on the server if need be. I hope maybe to get to talk to someone at Tesla and know what their limit are and maybe even get a private client key that have less restriction.

I really don't want to deal with the copy of the codes !!! I might get request to change things in the UI right now which once I change are available to anyone, but I don't want to deal with every install issues and upgrade / migration or anything else related to software like that.

You can see already for visibletesla and other tool people made that most of their ticket issue are about supporting local installation. Having it hosted limit these problems and lost of time.

Maybe someday I might offer a standalone server, but there is too much changes done rightnow to it.
 
I've added an acceleration list for your trip. It not accurate, but still show interesting data. I currently take the speed the car provide. I might do another version based on the GPS data returned by the car instead. Even when driving and accelerate, you can see your dash speed is lagging behind.
Untitled.png

Here a sample of the current graph generated.

(Speed = KPH, Power kW, the scale at the bottom are millisecondes)
 
Are you sure the plot is correct? I would have expected power to be much more than about 30 kW at the beginning. It takes four seconds for the power to peak at 300 kW.

- - - Updated - - -

Doing a quick check. It looks like the final speed at about 8.3 seconds is 130 kph, or 36 mps. The mass of the car is around 2100 kg. The kinetic energy is thus 0.5*(2100)*(36)^2 = 1.37e6 J, or 0.38 kWh.

Looking at the power curve, it seems to increase linearly from about 0 to 300 kW from time 0 to 4.2 seconds. Then it is level until 8.3 seconds. The area under the curve is thus approximately 0.52 kWh.

So the efficiency is approximately 0.38 / 0.52 = 73%. That is not all that great. Fast acceleration wastes energy :wink:.
 
Well, a part from the lag I said that was there(should actually show lower kW level at the start), it what the car provide as power.

Here is some raw data from the DB in MPH :
Speed | Power
0 | 3
0 | 7
0 | 21
3 | 40
7 | 54
9 | 75
13 | 89
15 | 109

You can see it goes from 3kW to 21kW still with 0 Speed yet the car was moving but the Speed indicator lagging.

You will notice if you drive a Tesla with an empty battery that the initial acceleration is still pretty strong until it hit a certain speed where the acceleration stop.

The problem with the Tesla acceleration is not the lack of power, but the lack of traction.

Remember that the Tesla have NO TRANSMISSION... So there must be power left to continue acceleration at highway speed.

So this graph except for the lag might be pretty much accurate. Going to be interesting to compare with P85, 85D and P85D !!!!

- - - Updated - - -

So the efficiency is approximately 0.38 / 0.52 = 73%. That is not all that great. Fast acceleration wastes energy :wink:.
Starting with a 25% efficiency of a ICE in normal usage, I wonder how much it drop with those kind of acceleration :)

Also note that it snowing right now here, road are wet, about -1oC and I got the non performance winter tire (Nokian Hakka 8 with no studs)
 
How is speed being measured? Is this GPS speed or is it the speed measured by the car? I don't suppose can measure the output power of the motor, i.e. torque and rpm.

Actually, I have measured the efficiency of the ICE in my car to be around 37% going 65 mph on the freeway. I have a PHEV.
 
Here is an acceleration graph on a depleted battery at about 1% !
Untitled2.png


- - - Updated - - -

How is speed being measured? Is this GPS speed or is it the speed measured by the car? I don't suppose can measure the output power of the motor, i.e. torque and rpm.

Actually, I have measured the efficiency of the ICE in my car to be around 37% going 65 mph on the freeway. I have a PHEV.
I have no idea where tesla take their speed... I have have access to anything more than what you see.. I might make a modified version that use the GPS coordinate instead... Or I could maybe just offset the power usage a little bit... not sure yet what I'll do.

Well it not a 100% ICE :) Also that constant speed, I was talking about full power acceleration.
 
I looked at a similar plot for my PHEV in EV mode. It takes 1.5 seconds for the power from the HVB to peak. Yours peaked in 1.5 seconds in the previous post. The rated peak power output of my HVB is 65 kW (about the same as in the plot in the previous post). Your data is accurate.
 
Last edited:
I looked at a similar plot for my PHEV in EV mode. It takes 1.5 seconds for the power from the HVB to peak. Yours peaked in 1.5 seconds in the previous post. The rated peak power output of my HVB is 65 kW (about the same as in the plot in the previous post). Your data is accurate.

The ramping up of power to 300 kW makes sense. The power output of the battery should roughly be proportional to motor torque. The output power of the motor is proportional to torque x rpms, and motor rpms is proportional to the speed of the car. The torque appears to be approximately constant up to about 300 kW. Consequently, output power of the battery is proportional to speed up to the maximum 300 kW of power. You have to reach a certain speed before power can peak, which appears to be around 75 kph. After that, the output power of the motor appears to be limited by the power that can be supplied by the battery.

Note that P = mav, where P is power, m is the mass of the car, a is the acceleration, and v is the speed. Since power is proportional to speed, acceleration is going to be approximately constant up to 75 kph. After 75 kph, power no longer increases with speed and acceleration starts decreasing.
 
Last edited: