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.
Most likely this is Tesla throttling the requests for charge data via the REST API. The streaming data doesn't get throttled but the REST data does, hence the difference you see when comparing the two data sources.

Have you seen this happen at this throttling rate? It used to be very, very reliable and now it seems I'm not getting any data at all from REST - over the past 2 days I haven't gotten any information from rated mileage.
 
Have you seen this happen at this throttling rate? It used to be very, very reliable and now it seems I'm not getting any data at all from REST - over the past 2 days I haven't gotten any information from rated mileage.

Can you check with command line and see if that works? "teslacmd -c" should print out charge data. Also check which version you are running "teslacmd --version". It could be that the old API is finally retired. I am on vacation so its hard for me to check against my car for another week.
 
Can you check with command line and see if that works? "teslacmd -c" should print out charge data. Also check which version you are running "teslacmd --version". It could be that the old API is finally retired. I am on vacation so its hard for me to check against my car for another week.

Version I have is the NPM version, 1.0.0.

The command line works:

[...]
{ charging_state: 'Charging',
charge_limit_soc: 100,
charge_limit_soc_std: 90,
charge_limit_soc_min: 50,
charge_limit_soc_max: 100,
charge_to_max_range: true,
battery_heater_on: false,
[...]

...and there's nothing that seems odd in the output:

20 Apr 12:39:26 - getting charge state Aux data
20 Apr 12:39:26 - getting climate state Aux data
20 Apr 12:40:26 - getting charge state Aux data
20 Apr 12:40:26 - getting climate state Aux data

Where do I start looking?
 
Seems empty data is getting pushed into the database:

> db.tesla_aux.find({'ts':{$gte:new Date(2015,3,20,0,0,0).getTime()}});
{ "_id" : ObjectId("553487fbd16b0394054928f8"), "ts" : 1429506043525, "chargeState" : { } }
{ "_id" : ObjectId("55348837d16b039405492911"), "ts" : 1429506103417, "chargeState" : { } }
{ "_id" : ObjectId("55348873d16b039405492932"), "ts" : 1429506163310, "chargeState" : { } }

...yet the streaming server is getting it... a ulog(JSON.stringify(doc)) in the aux data function reveals the data coming back:

20 Apr 13:15:40 - charge state DEBUG {"charging_state":"Charging","charge_limit_soc":100,"charge_limit_soc_std":90,"charge_limit_soc_min":50,"charge_limit_soc_max":100,"charge_to_max_range":true,"battery_heater_on":false,"not_enough_power_to_heat":false,"max_range_charge_counter":0,"fast_charger_present":false,"fast_charger_type":"<invalid>","battery_range":265.75,"est_battery_range":289.09,"ideal_battery_range":307.43,"battery_level":100,"usable_battery_level":100,"battery_current":5.3,"charge_energy_added":13.13,"charge_miles_added_rated":44.5,"charge_miles_added_ideal":51.5,"charger_voltage":248,"charger_pilot_current":80,"charger_actual_current":9,"charger_power":2,"time_to_full_charge":0,"trip_charging":false,"charge_rate":30.3,"charge_port_door_open":true,"motorized_charge_port":false,"scheduled_charging_start_time":null,"scheduled_charging_pending":false,"user_charge_enable_request":null,"charge_enable_request":true,"eu_vehicle":false,"charger_phases":null}

So apparently something's not happening right in the insert, which is immediately beneath this troubleshoot??

Mongo is 2.6.9. Nodejs is 0.10.37 (from Chris Lea PPA). Ubuntu Linux host.

EDIT: Some days I really *hate* the way Ubuntu handles repositories. Turns out post-2.6, the repositories changed and I did not get upgrades to mongo. I updated those repositories, restarted all the stuff, and now it's working again. *spit*

Mongo is now 3.0.2. Same other stuff.
 
Last edited:
Seems the old REST API is no longer working so I just updated the teslams nodes for node-red to use the new REST API.

Code:
npm install -g node-red-contrib-teslams

This only applies if you are using teslams inside of the node-red IoT visual designer.
 
(Apologies if this is covered somewhere already)

I'm starting to play a little with the teslams toolset, specifically the streaming / mongoDB parts. What's the story on how often/frequently/constantly the streaming API can be used without upsetting Tesla? Is this something that people just start up on a machine somewhere, fire off to a database, and let it run forever?

Or are there written or unwritten rules on how to be a good citizen with this stuff? It's incredibly awesome that Tesla makes this available, and I have no desire to color outside the lines here so to speak...
 
(Apologies if this is covered somewhere already)

I'm starting to play a little with the teslams toolset, specifically the streaming / mongoDB parts. What's the story on how often/frequently/constantly the streaming API can be used without upsetting Tesla? Is this something that people just start up on a machine somewhere, fire off to a database, and let it run forever?

Or are there written or unwritten rules on how to be a good citizen with this stuff? It's incredibly awesome that Tesla makes this available, and I have no desire to color outside the lines here so to speak...

I run mine constantly. The streaming api is actually less load on the severs and the code has throttling built in to avoid too many requests.
 
Very cool. And this may be an incredibly stupid question, but I can't seem to figure it out... in streaming.js, the -v argument takes a list of possible "values to collect", but I can't figure out where that set of possible values is enumerated. The default value set doesn't include things like the battery current, etc.

I took a guess based on some of the names described in the apiary docs:

timeout 86400 streaming -s -d tesla -v "odometer,speed,soc,elevation,est_lat,est_lng,power,range,battery_current,charger_voltage"

but when I run in the db records have only null values after "range"....
 
Last edited:
Ah, ok - then I asked the wrong question. What I guess I was actually asking is whether or not there is the ability to add additional values into the streaming data set (for example, the battery current)

You can add values to the list and I did find some through experimentation and guesses but battery_current is not one of the valid values I know of. You can't just plug in the name that the rest api uses into the streaming api and expect it to work.
 
I got a problem where my Daily and Weekly screen are coming up just blank.

I have tried with reinstalling everything (ubuntu, nodejs, npm, teslams). I reimported the db but it still fails. Any hints ?

Screen Shot 2015-12-10 at 15.27.06.png
 
I got a problem where my Daily and Weekly screen are coming up just blank.

I have tried with reinstalling everything (ubuntu, nodejs, npm, teslams). I reimported the db but it still fails. Any hints ?

View attachment 103946
I wrote that code about two years ago and after a rather scary exchange with Tesla walked away from it. I believe the code is at this point unmaintained.
 
I do my best to fix any obvious bugs but as dirkhh points out, I didnt write the visualize code. Is this something that just started recently? Do you have any other error messages?
My apologies - this came across as a snipe at your work, hans, and that's entirely unfair. I wasn't trying to imply that you are doing a bad job maintaining it - I was trying to express that this doesn't have an active maintainer who is working on it as a goal on itself. I walked away and you ended up holding the pieces.
 
My apologies - this came across as a snipe at your work, hans, and that's entirely unfair. I wasn't trying to imply that you are doing a bad job maintaining it - I was trying to express that this doesn't have an active maintainer who is working on it as a goal on itself. I walked away and you ended up holding the pieces.

I didn't take it as a snipe at all and I am very appreciative for all your work on this.
 
I do my best to fix any obvious bugs but as dirkhh points out, I didnt write the visualize code. Is this something that just started recently? Do you have any other error messages?

I don't see any other error messages. It did work before. I used it many times before.

I have changed to verbose logging and get this:

Using MongoDB URI: mongodb://127.0.0.1:27017/teslams
Teslamotors.com logon information loaded from /home/teslams/.teslams/config.json
Using MongoDB URI: mongodb://127.0.0.1:27017/teslams
Server running on port 8766
[ { ts: 1449723555171,
vehicles:
{ color: null,
display_name: 'Marco Kuendig P85',
id: '3824582768133353935',
option_codes: 'MS02,REEU,TM02,DRLH,PF01,BT85,PPSW,RFPO,WTSP,IZMB,IDCF,TR00,SU01,SC01,PX00,TP01,PK01,CW01,AU01,CH01,HP00,PA00,LP01,SP01,PS01,AD02,X001,X003,X007,X009,X011,X027,X031,X013,X024,X019,BS00,COCH',
vehicle_id: 82621370,
vin: '5YJSA2DP2DFS14231',
tokens: [Object],
state: 'online',
id_s: '3824582768133353935',
remote_start_enabled: true,
calendar_enabled: true,
notifications_enabled: true,
backseat_token: null,
backseat_token_updated_at: null },
_id: 566906a3e99bd79f0109b777 } ]
European Signature P 85
<ul><li> pearl white</li><li> panorama roof</li><li> gray 21" wheels</li><li> air suspension</li><li> super charger enabled</li><li> tech package</li><li> parking sensors</li><li> cold weather package</li><li> audio upgrade</li><li> dual charger</li><li> premium lighting package</li><li> security package</li></ul>
battery capacity 85
GET /shared.css 304 2.002 ms - -
GET /favicon.ico 304 0.595 ms - -
find user marco
GET /jquery-1.9.1.js 304 0.364 ms - -
GET /jquery-ui-timepicker-addon.js 304 0.812 ms - -
GET /jquery-ui-1.10.3.custom.min.js 304 0.439 ms - -
GET /jquery-ui-timepicker-addon.css 304 0.340 ms - -
GET /shared.css 304 2.013 ms - -
GET /url.min.js 304 0.898 ms - -
GET /lib.js 304 0.424 ms - -
GET /jquery-ui.css 304 0.478 ms - -
GET /images/ui-bg_flat_75_ffffff_40x100.png 304 0.472 ms - -
starting DB request after 12 ms
processing data after 422 ms
total processing time 451 ms
GET /jquery.flot.time.min.js 304 1.907 ms - -
GET /jquery.flot.js 304 1.606 ms - -
GET /jquery-1.9.1.js 304 1.109 ms - -
GET /jquery.flot.threshold.min.js 304 0.935 ms - -
GET /jquery.flot.orderBars.js 304 0.433 ms - -
GET /jquery-ui-timepicker-addon.css 304 0.320 ms - -
GET /jquery-ui.css 304 2.268 ms - -
GET /shared.css 304 1.859 ms - -
GET /jquery-ui-timepicker-addon.js 304 1.120 ms - -
GET /jquery.flot.stack.js 304 0.521 ms - -
GET /jquery-ui-1.10.3.custom.min.js 304 0.569 ms - -
GET /lib.js 304 0.323 ms - -
GET /url.min.js 304 0.683 ms - -
GET /images/ui-bg_highlight-soft_75_cccccc_1x100.png 304 0.396 ms - -
GET /images/ui-bg_glass_55_fbf9ee_1x400.png 304 0.311 ms - -
GET /images/ui-icons_222222_256x240.png 304 0.922 ms - -
GET /images/ui-bg_glass_75_e6e6e6_1x400.png 304 0.724 ms - -
GET /images/ui-bg_glass_75_dadada_1x400.png 304 0.410 ms - -
GET /images/ui-bg_glass_65_ffffff_1x400.png 304 0.321 ms - -
starting DB request after 11 ms
processing data after 1176 ms
total processing time 1414 ms
GET /jquery.flot.js 304 1.259 ms - -
GET /jquery.flot.time.min.js 304 1.026 ms - -
GET /jquery.flot.orderBars.js 304 0.898 ms - -
GET /jquery.flot.threshold.min.js 304 0.282 ms - -
GET /jquery-ui-timepicker-addon.css 304 1.809 ms - -
GET /jquery-ui.css 304 1.168 ms - -
GET /jquery.flot.stack.js 304 1.127 ms - -
GET /shared.css 304 0.644 ms - -
GET /jquery-ui-1.10.3.custom.min.js 304 0.373 ms - -
GET /jquery-1.9.1.js 304 0.815 ms - -
GET /jquery-ui-timepicker-addon.js 304 0.805 ms - -
GET /lib.js 304 0.925 ms - -
GET /url.min.js 304 0.308 ms - -
 
I don't see any other error messages. It did work before. I used it many times before.

QUOTE]

Interesting discovery with trial and error....It works up to a certain second and than it stops to work if that particular second is included. So it seems there is some sort of data corruption happening.

It works if I choose any date up to 2015-12-05 16-18-40 but if I include 2015-12-05 16-18-41 in the range it stops working. I try to look now at the exported data taken with mongodump.
 
I don't see any other error messages. It did work before. I used it many times before.

QUOTE]

Interesting discovery with trial and error....It works up to a certain second and than it stops to work if that particular second is included. So it seems there is some sort of data corruption happening.

It works if I choose any date up to 2015-12-05 16-18-40 but if I include 2015-12-05 16-18-41 in the range it stops working. I try to look now at the exported data taken with mongodump.

I think I found the culprit:

{"ts":1.449328720713e+12,"vehicleState":{"api_version":3,"calendar_supported":true,"car_type":"s","car_version":"2.9.12","center_display_state":0,"dark_rims":false,"df":0,"dr":0,"exterior_color":"Pearl","ft":0,"has_spoiler":true,"locked":true,"notifications_supported":true,"odometer":36793.333593,"parsed_calendar_supported":true,"perf_config":"P2","pf":0,"pr":0,"rear_seat_heaters":1,"remote_start":false,"remote_start_supported":true,"rhd":false,"roof_color":"None","rt":0,"seat_type":0,"sun_roof_installed":1,"sun_roof_percent_open":0,"sun_roof_state":"unknown","third_row_seats":"None","valet_mode":false,"vehicle_name":"Marco Kuendig P85","wheel_type":"Charcoal21"},"_id":{"$oid":"56630050e3a00a9e016cb01e"}}


There was a software update coming in exactly at the point where it stopped working. Could that be ?

Before the SW-update it looked like this:

{"ts":1.447675789254e+12,"vehicleState":{"api_version":3,"calendar_supported":true,"car_version":"2.7.106","center_display_state":0,"dark_rims":false,"df":0,"dr":0,"exterior_color":"Pearl","ft":0,"has_spoiler":true,"locked":true,"notifications_supported":true,"odometer":35602.082972,"parsed_calendar_supported":true,"perf_config":"P2","pf":0,"pr":0,"rear_seat_heaters":1,"remote_start":false,"remote_start_supported":true,"rhd":false,"roof_color":"None","rt":0,"seat_type":0,"sun_roof_installed":1,"sun_roof_percent_open":0,"sun_roof_state":"unknown","valet_mode":false,"vehicle_name":"Marco Kuendig P85","wheel_type":"Charcoal21"},"_id":{"$oid":"5649c78d72b643a001708994"}}
{"ts":1.447675848181e+12,"climateState":{"inside_temp":null,"outside_temp":null,"driver_temp_setting":25,"passenger_temp_setting":25,"is_auto_conditioning_on":null,"is_front_defroster_on":null,"is_rear_defroster_on":false,"fan_status":null,"seat_heater_left":0,"seat_heater_right":0,"seat_heater_rear_left":0,"seat_heater_rear_right":0,"seat_heater_rear_center":0,"seat_heater_rear_right_back":0,"seat_heater_rear_left_back":0,"smart_preconditioning":false},"_id":{"$oid":"5649c7c872b643a001708998"}}



So there is a new field: "car_type":"s"

Could that mess up the daily display ?
 
That a very good lead to go on. I will have to look through the code and see how the software update or the new field might have broken things. Unfortunately I'm travel for business right now so it might take a while for me to get some time to dedicate to this.