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

TeslaMS tools for telemetry data visualization

This site may earn commission on affiliate links.
Dirk,

maybe it's just me but I downloaded node.js, was able to find the config change (proxy settings) necessary to run the npm command to download the teslams package, but when running the tesla command, I see that the machine (apparently ?) ignores the npm proxy settings and tries a DIRECT HTTPS connection to the tesla servers. Did I miss something ?

Oh, and now that we are on the subject, please tell me what 'soc' stands for...
I tried this
SOC - What does SOC stand for? Acronyms and abbreviations by the Free Online Dictionary.
but that didn't help much

Thanks for helping out...

Npm is only used to download and install all the necessary software modules. If you need the node.js runtime environment to use a proxy then there may need to be more or different configuration. I may even have to modify the code, let me check on this.

SOC stands for State Of Charge, which indicates how "full" the battery is.

---update---

The code would need to be updated to get it to work with an SSL tunneling proxy. This is not a trivial thing to add or I would just bang it out right away. I will put this on the TODO list. For now, you will need to run streaming.js on a host which can reach the Tesla URL without a proxy.
 
Last edited:
Got a speeding ticket today. Figured I could check the logs in mongodb and fight it in court. Instead I confirmed to myself that he wrote me up for the exact highest speed I was going at the time. Bummer. I was hoping for a "man gets out of speeding ticket by hacking into Tesla" story.
That sucks. Sorry to hear that... Just out of idle curiosity... how fast where you going? And how fast were you supposed to go?
Published version 0.7.0 to npm repository. It's now the default install using "npm install teslams" or "sudo npm install -g teslams"
The image doesn't show the latest changes that I made... did I forget to push those to you? (I added code to allow you to stop centering the map). I'll need to check.
Also, I have noticed the odd GPS issue with visualize.js where I think a lat/long of null/null is being interpreted at lat/log of 0/0, See the map below.
Yes, I have been fighting this bug from day one and I was certain that I had it finally beaten... back to the drawing board.
Is there a chance you could give me access to the corresponding data in your database? I will try to reproduce it here with the old data where this used to happen - but I thought I tested them all.
I'll contact you via email if I need this...
 
Npm is only used to download and install all the necessary software modules. If you need the node.js runtime environment to use a proxy then there may need to be more or different configuration. I may even have to modify the code, let me check on this.

SOC stands for State Of Charge, which indicates how "full" the battery is.

this is what I used to get npm to work

npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

as described in How to setup Node.js and Npm behind a corporate web proxy - JJasonClark.com
and then the download/install of the teslams package when without a hitch.

But you're right, this is for npm and NOT for node...although the title of the url suggests otherwise ?!

this article suggests to me that you have to explicitly 'embed' the proxy parameters in your http/https calls ?

Using Node.JS behind a proxy Luke Berndt
 
this is what I used to get npm to work

npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

as described in How to setup Node.js and Npm behind a corporate web proxy - JJasonClark.com
and then the download/install of the teslams package when without a hitch.

But you're right, this is for npm and NOT for node...although the title of the url suggests otherwise ?!

this article suggests to me that you have to explicitly 'embed' the proxy parameters in your http/https calls ?

Using Node.JS behind a proxy Luke Berndt

Yup. Setting up a proxy for HTTP would be very easy. I would just add the proxy parameter to the code and add a command line option to let you specify it.
HTTPS is another thing because of all the security, certificate authorities, etc. I'm still looking for a simple way to add HTTPS proxy support in.
 
That on the other hand is my part. It's already there. Just add '&metric=true' to the URL

Dirk,

nice, very nice.

the car data indicates if this is a European car; could you default to 'metric' in this case ??
IsEUVehicle = True

A (new) parameter indicates the number of phases during charging; for the moment my 'real ' charging level is 3 times too low, because you don't take into account that parameter..
ChargerPhases = 3

Can you confirm this ?
 
Dirk,

nice, very nice.

the car data indicates if this is a European car; could you default to 'metric' in this case ??
IsEUVehicle = True

A (new) parameter indicates the number of phases during charging; for the moment my 'real ' charging level is 3 times too low, because you don't take into account that parameter..
ChargerPhases = 3

Can you confirm this ?
Well, but 'IsEUVehicle' isn't at all equivalent to the user wanting metric. But I saw that I can check the UI preference in the car - and I can simply match that in the tool. Something to look into.

And yes, I don't take the ChargerPhases information into account at all - don't have that and only have access to my own sample data. Would you send me a database dump of a few charge entries? Ideally from before the charge, start of charge, end of charge, after charge?
 
Well, but 'IsEUVehicle' isn't at all equivalent to the user wanting metric. But I saw that I can check the UI preference in the car - and I can simply match that in the tool. Something to look into.

Excellent (as you said, not all Europeans drive in km's, but that tends to divert into a political debate).

And yes, I don't take the ChargerPhases information into account at all - don't have that and only have access to my own sample data. Would you send me a database dump of a few charge entries? Ideally from before the charge, start of charge, end of charge, after charge?
I will get back to you on that one, but I guess that's not an issue (have to figure out how to dump mongodb...)
 
Well, but 'IsEUVehicle' isn't at all equivalent to the user wanting metric. But I saw that I can check the UI preference in the car - and I can simply match that in the tool. Something to look into.

fyi, this is the output in Europe for the 'GUI' command:

DistanceUnits = km/hr
TemperatureUnits = CELSIUS
ChargeRateUnits = km/hr
Is24HourTime = True
RangeDisplay = Ideal
 
I had 'errors' this afternoon when sending the 'wake up' command to the car ?
Errorcode 401, timeout... as if, once the car asleep, you cannot wake it any more ?
Any similar experiences ?

HTTP error code 401 means "unauthorized" which you would expect to happen every 30 minutes when the tokens expire. In 7.0 and higher I added in a flag (-z) to check if the car is asleep and avoid waking the car up. However, the default should be to wake the car.

I am still on 4.5 so I have been unable to test how long it takes to wakeup a sleeping 5.x car (or even if you can wake it up via the REST "wake_up" command).

If the car isn't waking up you should see "Info: calling wake_up" every second for no more than 6 times and then it should print "Warn: throttling due to too many REST API" and pause for 60 seconds before trying again.

I expected that after 1 minute the car would be awake and it would be safe to try again. If this repeats more than once or twice then there is either a bug in my code, or the car cannot wake up with the REST "wake_up" command.
 
HTTP error code 401 means "unauthorized" which you would expect to happen every 30 minutes when the tokens expire. In 7.0 and higher I added in a flag (-z) to check if the car is asleep and avoid waking the car up. However, the default should be to wake the car.

I am still on 4.5 so I have been unable to test how long it takes to wakeup a sleeping 5.x car (or even if you can wake it up via the REST "wake_up" command).

If the car isn't waking up you should see "Info: calling wake_up" every second for no more than 6 times and then it should print "Warn: throttling due to too many REST API" and pause for 60 seconds before trying again.

I expected that after 1 minute the car would be awake and it would be safe to try again. If this repeats more than once or twice then there is either a bug in my code, or the car cannot wake up with the REST "wake_up" command.

hmm, to tired now to try to understand this. Will try tomorrow.

But,

I have 'your' node version running -> wake command failed
I have 'my' c# version running -> wake command failed
I tried iPhone app -> wake command failed (unable to reach car)

That's why I suspected something else...
 
I believe all of these are adjustable under "Units & Format" in the car UI.
Please give the new version (0.7.1) that Hans pushed a few hours ago a try. It should automatically use the system that is used in your car's GUI. You do have to restart the streaming.js client for it to add the necessary data to the database - but once you've done that (and restarted visualize.js as well) you should get metric by default if your car shows distances in km.
 
Please give the new version (0.7.1) that Hans pushed a few hours ago a try. It should automatically use the system that is used in your car's GUI. You do have to restart the streaming.js client for it to add the necessary data to the database - but once you've done that (and restarted visualize.js as well) you should get metric by default if your car shows distances in km.

Dirk,
Hans,

thanks for the update. Energy chart looks fine now.
Marker in map chart still displays data in non-metric format while replaying...(sorry to spoil the party)
 
Restla

I added a new tool called "restla" to the TeslaMS project. It's a simple REST proxy that hides all the Tesla Motors authentication and allows all the functions to be exposed as HTTP GET URLs with no parameters. It also has the side benefit of being a simple HTML browser interface for all the REST calls. Most of what you could do from the command line using "teslacmd" you can now do in a browser or REST calls from any client application.

restla.JPG
10700838103_8c37dd0046_z.jpg




I built this so I could create automation tasks on my Android phone (using the Locale HTTP plug-in) and Pebble SmartWatch (using javascript).

Screenshot_2013-11-06-13-08-09.png


To start the proxy run "restla" (if you have installed using the -g option of npm) or cd into ~/teslams/examples and run "node restla.js"
It takes username and password as arguments or it will check and read these parameters from your ~/.teslams/config.json configuration file, just like the other teslams tools. Default HTTP port is 8888 but you can also provide another with the -P (or --port) flag.
 
I added a new tool called "restla" to the TeslaMS project. It's a simple REST proxy that hides all the Tesla Motors authentication and allows all the functions to be exposed as HTTP GET URLs with no parameters. It also has the side benefit of being a simple HTML browser interface for all the REST calls. Most of what you could do from the command line using "teslacmd" you can now do in a browser or REST calls from any client application.

View attachment 34890

View attachment 34889



I built this so I could create automation tasks on my Android phone (using the Locale HTTP plug-in) and Pebble SmartWatch (using javascript).

View attachment 34891

To start the proxy run "restla" (if you have installed using the -g option of npm) or cd into ~/teslams/examples and run "node restla.js"
It takes username and password as arguments or it will check and read these parameters from your ~/.teslams/config.json configuration file, just like the other teslams tools. Default HTTP port is 8888 but you can also provide another with the -P (or --port) flag.

Can you give an example of what one could do with Pebble?