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 or making a Paypal contribution here: paypal.me/SupportTMC

Service available: record and display your Tesla's locations and battery stats

Discussion in 'Model S: User Interface' started by wga22, Jul 6, 2016.

  1. wga22

    wga22 Member

    Joined:
    Aug 10, 2015
    Messages:
    22
    Location:
    Vienna, VA
    Is anyone interested in having me set something like this up for them?

    I've written an application that I run on a hosted service and associated website to record and display location and battery stat history for my car. I'm interested in setting this up for others who might also be interested, so please PM me if you'd like to set something similar up.

    Here are the features:
    • Integration with google maps api to show where you've been (unique locations), and where car is most recently located
    • Record battery level, ideal range, estimated range, etc
    • Record latitude and longitude and speed
    • website displays the monthly summary (See screenshot)
    • The hosted application runs hourly, and pulls information from the car via the tesla api, and stores it to thingspeak.com. It can be stored privately or public, based on your preference.

    Details stored on your private website with monthly summaries of battery and driving patterns.
    [​IMG]

    Icons showing where car was at a given time
    [​IMG]

    information is recorded on "thingspeak.com" website, private database available.
    [​IMG]
     
  2. msnow

    msnow Active Member

    Joined:
    Jul 14, 2015
    Messages:
    4,180
    Location:
    SoCal
    Hi, are our MyTesla credentials stored on your hosted server?
     
  3. L-P-G

    L-P-G Member

    Joined:
    Feb 20, 2016
    Messages:
    122
    Location:
    Orlando, FL
    How would this work on our own website? is it a container like docker we would have to deploy on our side?
     
  4. wga22

    wga22 Member

    Joined:
    Aug 10, 2015
    Messages:
    22
    Location:
    Vienna, VA
    I have a scheduled job that runs a script every hour on the hosted site, rhcloud.com. If you have your own site, I can give you the html for the website, and the javascript for the server side code.

    I would prefer to get you started with your own free hosted sites, and let just show you where to put your own credentials.
     
  5. wga22

    wga22 Member

    Joined:
    Aug 10, 2015
    Messages:
    22
    Location:
    Vienna, VA
    For anyone interested in working this out for themselves, the code is all open source. I welcome feature ideas and feedback via github. I'm happy to help you setup; tips appreciated via bitcoin (1LvvbLXyiNBkQ8vpe3Vgh3YAVmRoi3Q4AP).

    3 main steps:
    1. setup hourly process
      1. it requires node.js and one of the libraries for tesla api.
      2. nodejs/tesla at master · wga22/nodejs · GitHub
    2. setup thingspeak account to store the data
    3. host the html page (pulls from thingspeak, so no server side code other than a static html)
      1. pure_html/tmap.html at master · wga22/pure_html · GitHub
     
  6. wga22

    wga22 Member

    Joined:
    Aug 10, 2015
    Messages:
    22
    Location:
    Vienna, VA
    The service here is that I will setup this application, then handover the control of the free online services to you, so I am never have access of your credentials. This system is free, and YOU would be the one managing the thingspeak and node.js services. Node.js would contain your Tesla credentials so that it can contact the Tesla servers, and get the information about the current details of your car.
     
  7. msnow

    msnow Active Member

    Joined:
    Jul 14, 2015
    Messages:
    4,180
    Location:
    SoCal
    So the protection of the users Tesla credentials would be with whoever manages the thingspeak infrastructure. What I'm getting at is if there is a breach of the thingspeak cloud infrastructure wouldn't a users credentials be at risk?
     
  8. wga22

    wga22 Member

    Joined:
    Aug 10, 2015
    Messages:
    22
    Location:
    Vienna, VA
    The breach to be concerned with is whatever runs the hourly process to collect the data, a nodejs process that I currently run on rhcloud. Thingspeak is the "database" for the results, but not your credentials. There are many other options for how your hourly process could be hosted. You could even decide to just run it on a server at your home/office, or perhaps a router or raspberry pi that is running linux. Need a full time device, is all.
     

Share This Page