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
Start a Discussionhttps://teslamotorsclub.com/tmc/tags/

API trip information / energy consumption

Discussion in 'Model S: User Interface' started by pjotr, Dec 27, 2016.

  1. pjotr

    pjotr Member

    Joined:
    Sep 20, 2016
    Messages:
    36
    Location:
    Sweden
    Is there any API endpoint I have missed? I want to get out the information from the "trips", for example energy consumed since last charge etc... Because I cannot find kWh or any other figure in any of the below endpoints :/

    {
    'mobile_enabled': 'https://owner-api.teslamotors.com/api/1/vehicles/%d/mobile_enabled',
    'charge_state': 'https://owner-api.teslamotors.com/api/1/vehicles/%d/data_request/charge_state',
    'climate_state': 'https://owner-api.teslamotors.com/api/1/vehicles/%d/data_request/climate_state',
    'drive_state': 'https://owner-api.teslamotors.com/api/1/vehicles/%d/data_request/drive_state',
    'gui_settings': 'https://owner-api.teslamotors.com/api/1/vehicles/%d/data_request/gui_settings',
    'vehicle_state': 'https://owner-api.teslamotors.com/api/1/vehicles/%d/data_request/vehicle_state',
    }
     
  2. tliving

    tliving Member

    Joined:
    Mar 8, 2014
    Messages:
    735
    Location:
    New England, USA
    Tesla doesn't give you information on kWh consumed on a trip. If you charge nightly you can do some math to see how much kWh you added during the charge and how many miles (rated and normal) you drive and then get consumption data. Thats the sort of stuff I tweet our daily on @Teslaliving.

    If you save the charge information from the last charge you can get the latest estimate for kWh for a rated mile and then use that for math for newer trips etc.

    The short of it is that it would be really nice for Tesla to add that to the (unoffocial) API.
     
  3. pjotr

    pjotr Member

    Joined:
    Sep 20, 2016
    Messages:
    36
    Location:
    Sweden
    Yes, they should add that. I'm doing the math, so i already have some approximation :)

    Currently I'm using available battery % together with added energy as approximate for energy consumption.

    How do you do it?
     
  4. tliving

    tliving Member

    Joined:
    Mar 8, 2014
    Messages:
    735
    Location:
    New England, USA
    Yup, that's the way to do it.
     

Share This Page