TMC is an independent, primarily volunteer organization that relies on ad revenue to cover its operating costs. Please consider whitelisting TMC on your ad blocker and becoming a Supporting Member. For more info: Support TMC

Using API to gather individual battery cell voltage?

Discussion in 'Technical' started by Dameon, May 17, 2019.

  1. Dameon

    Dameon Titanium P90DL

    Joined:
    Aug 9, 2017
    Messages:
    263
    Location:
    Lafayette, Louisiana
    I thought I saw this information somewhere before, but it may have been a screen dump from one of the Tesla hackers rooting efforts and not an output from the API.

    I trouble-shooting a potential battery pack issue and would like to gather my own data in conjunction with Tesla Service running a diag on the battery. I can't say Tesla has ever done this to me, but other manufacturers run their diag and "don't find anything" and then 30 days out of warranty I have a problem with exactly what they couldn't find and I suspected all along. :roll:

    Anyway, if I could get a list of all known parameters, I'll be glad to wade through until I find what I need.

    I RTFM'd this forum, but either my search criteria was inadequate or there's nothing posted.

    Thanks.
     
  2. Saghost

    Saghost Well-Known Member

    Joined:
    Oct 9, 2013
    Messages:
    6,559
    Location:
    Delaware
    I've seen folks using OBDII type readers to get cell voltages (you have to get to the diagnostic port deep in the center console and then you need an adapter cable.) TMSpy is the app, I believe.
     
  3. Dameon

    Dameon Titanium P90DL

    Joined:
    Aug 9, 2017
    Messages:
    263
    Location:
    Lafayette, Louisiana
    That was going to be another direction. I have the "console cable" for my model, but I'd like to use the API if possible. Failing that, my next question will be what parameters need to be passed in the console connection to gather that data.
     
  4. willow_hiller

    willow_hiller Member

    Joined:
    Apr 3, 2019
    Messages:
    566
    Location:
    Maryland
    Here's some pretty good documentation for the online API: Data

    I've used it myself after generating an auth token using TeslaJS: teslajs

    Unfortunately, I think the parameters returned via the online API are pretty general; I don't see anything close to individual cell voltages, unless you may be able to calculate something like that from things like total kW and SOC.
     
    • Informative x 1
  5. BigD0g

    BigD0g Active Member

    Joined:
    Jan 12, 2017
    Messages:
    1,874
    Location:
    Somewhere
    You can get this data with sniffing the canbus or rooting your car.
     
    • Informative x 1
  6. Dameon

    Dameon Titanium P90DL

    Joined:
    Aug 9, 2017
    Messages:
    263
    Location:
    Lafayette, Louisiana
    Great! Care to share the method?
     
  7. Dameon

    Dameon Titanium P90DL

    Joined:
    Aug 9, 2017
    Messages:
    263
    Location:
    Lafayette, Louisiana
    Thanks for the response Willow. I have followed Tim Dorr and his posts on here and GitHub. I think I've seen this list, but I'm not sure it is comprehensive or there are some "hidden" values. I've read so much in the last couple of years, that it could have easily been another BMS output I'm thinking of as I also design and build EV conversations as a hobby.

    Good thought, but I'm trying justify consumption and capacity (kW and SOC) based on potential bad cells. I'm not getting the range I should be despite the consumer displays telling me I should be. Car says 260+ at 100% SOC and I'm pushing to get 210. The average kW usage seems out of whack based on projected-to-actual as well.
     
  8. willow_hiller

    willow_hiller Member

    Joined:
    Apr 3, 2019
    Messages:
    566
    Location:
    Maryland
    Just based upon the Model 3 option codes, there must be either some undocumented endpoints or an internal API only accessible by certain services. The Account page can query my car's options and correctly render an image of it, so they must be keeping all those details in a database somewhere!
     
  9. Dameon

    Dameon Titanium P90DL

    Joined:
    Aug 9, 2017
    Messages:
    263
    Location:
    Lafayette, Louisiana
    Interesting perspective. I always assumed the specs were in some back end Tesla database and they used the VIN as the SeqID field. I know they can't extract all the option codes solely from the VIN (not enough detail fields). Of course, the big options are there, but certainly not color, wheel choice, interior, etc.

    On a related note: I have seen references to wheel sizes in some parameters. That might be used for some kind of calibration on mileage, range, speed, whatever. Owners have noted that Service Centers have to change something in the car's systems to account for wheel changes, so that correlates with the references.
     
  10. willow_hiller

    willow_hiller Member

    Joined:
    Apr 3, 2019
    Messages:
    566
    Location:
    Maryland
    Judging by the Model S in your profile pic, I'm assuming you haven't tried looking up Model 3 option codes?

    They're all static, weirdly enough. Every single model 3 returns the following:

    AD15,MDL3,PBSB,RENA,BT37,ID3W,RF3G,S3PB,DRLH,DV2W,W39B,APF0,COUS,BC3B,CH07,PC30,FC3P,FG31,GLFR,HL31,HM31,IL31,LTPB,MR31,FM3B,RS3H,SA3P,STCP,SC04,SU3C,T3CA,TW00,TM00,UT3P,WR00,AU3P,APH3,AF00,ZCST,MI00,CDM0

    I checked with a LR owner, an MR owner, and myself with an SR+. The API doesn't even distinguish between battery sizes.

    After learning this fact, I can only assume that Tesla is keeping some endpoints hidden or inaccessible.
     
  11. BigD0g

    BigD0g Active Member

    Joined:
    Jan 12, 2017
    Messages:
    1,874
    Location:
    Somewhere
    What car? S/x or 3?
     
    • Helpful x 1
  12. Dameon

    Dameon Titanium P90DL

    Joined:
    Aug 9, 2017
    Messages:
    263
    Location:
    Lafayette, Louisiana
    Correct. All my efforts are around the Model S and occasionally the Model X (there are some similarities).

    That is very strange. Are the displays in the Model 3 consoles model specific like the S? I don't spent much time in the Model 3. They must be different in the more prominent options: like there wouldn't be sunroof opening options in the console if you didn't have a sunroof. Color, wheels, etc. might be generic across the displays though.
     
  13. willow_hiller

    willow_hiller Member

    Joined:
    Apr 3, 2019
    Messages:
    566
    Location:
    Maryland
    The car displays correctly on the infotainment screen and on the Tesla Account page; colors, wheels, etc. So for some reason Tesla is keeping an entirely separate API somewhere just for Model 3 options.
     
  14. Dameon

    Dameon Titanium P90DL

    Joined:
    Aug 9, 2017
    Messages:
    263
    Location:
    Lafayette, Louisiana
    Model S.

    Thanks.
     
  15. Dameon

    Dameon Titanium P90DL

    Joined:
    Aug 9, 2017
    Messages:
    263
    Location:
    Lafayette, Louisiana
    Good morning. Were you able to gather the information for the Model S? I'm still interested.

    Thanks.
     
  16. BigD0g

    BigD0g Active Member

    Joined:
    Jan 12, 2017
    Messages:
    1,874
    Location:
    Somewhere
    You can use a panda to sniff the canbus on an S: Tesla - comma wiki
     
  17. Dameon

    Dameon Titanium P90DL

    Joined:
    Aug 9, 2017
    Messages:
    263
    Location:
    Lafayette, Louisiana
    I'll do some research in the area you've indicated, but it doesn't look likely. The link you posted is for the Openpilot wiki and doesn't say anything about sniffing CANBUS for individual battery cell voltages.

    In that thought, it seems very likely that individual battery cell information is sent over CANBUS. Do you have a username or email address of someone who is getting this information via that method I can contact?
     

Share This Page

  • About Us

    Formed in 2006, Tesla Motors Club (TMC) was the first independent online Tesla community. Today it remains the largest and most dynamic community of Tesla enthusiasts. Learn more.
  • Do you value your experience at TMC? Consider becoming a Supporting Member of Tesla Motors Club. As a thank you for your contribution, you'll get nearly no ads in the Community and Groups sections. Additional perks are available depending on the level of contribution. Please visit the Account Upgrades page for more details.


    SUPPORT TMC