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/

What can be polled from the car via wifi?

Discussion in 'Model S' started by Zeromus-X, Jul 20, 2017.

Tags:
  1. Zeromus-X

    Zeromus-X Member

    Joined:
    Apr 10, 2016
    Messages:
    140
    Location:
    Sacramento, CA
    I recently set up a wallboard in my living room using a Raspberry Pi 3, which is basically a 24" screen that turns on when you walk up to it and provides me a real-time view of my calendars, the weather, the local traffic on my commute, and an RSS feed from a tech site I frequent. I'd like to add information about the current state of my car -- such as the current charge, or range, or time until charge is completed. Is there a way to pull that data from the vehicle? Both are within wifi range so if I can do it without requiring an external login then even better, but I'm also content using a web-based service.

    Basically, I have some empty space on the wallboard and it's time to fill it with Tesla stuff. :)

    Any ideas here?

    IMG_1740.JPG
     
  2. Tam

    Tam Active Member

    Joined:
    Nov 25, 2012
    Messages:
    2,939
    Location:
    Visalia, CA
    I don't see why not.

    I don't know how but if you are a computer programmer, it should be easy for you.
     
  3. ferdboyce

    ferdboyce Member

    Joined:
    Dec 14, 2013
    Messages:
    62
    Location:
    Seattle WA
    Probably a little off topic, and if so, pls forgive an ignorant luddite . . . is there a way to keep the 12V socket 'hot' when the car's asleep?
     
  4. Tam

    Tam Active Member

    Joined:
    Nov 25, 2012
    Messages:
    2,939
    Location:
    Visalia, CA
    Short answer yes.

    There's already a constant 12V easily accessible from OBD-2 outlet on the left, under the dashboard.

    You can also keep your cigarette lighter socket with constant 12V if you change its fuse to a regular one instead of the current relay.
     
    • Like x 1
  5. thimel

    thimel Member

    Joined:
    Feb 27, 2015
    Messages:
    429
    To do this, don't go to the car directly on wifi, but go to Tesla's servers which then talk to your car. You can get anything the Tesla app shows. There is a whole thread where people figured out how to do this. Model S REST API
     
    • Informative x 1
    • Like x 1
  6. Zeromus-X

    Zeromus-X Member

    Joined:
    Apr 10, 2016
    Messages:
    140
    Location:
    Sacramento, CA
    That thread is great. I'll be reading this for hours. Thank you!
     
  7. DOCAL

    DOCAL Member

    Joined:
    May 5, 2016
    Messages:
    189
    Location:
    San Jose, CA
    If you're working in Python, grab the class from GitHub - gglockner/teslajson: Simple Python class to access the Tesla JSON API and then maybe start with a simple data dumper such as....

    Code:
    #!/usr/bin/python
    
    import teslajson
    
    conn=teslajson.Connection('YOURLOGIN', 'YOURPASSWORD')
    cars=conn.vehicles
    
    for car in cars:
            print "======================= CAR ======================="
            for key in sorted(car.keys()):
                    print str(key) + " : " + str(car[key])
            print "======================= Mobile enabled ======================="
            mobenab=car.get('mobile_enabled')
            for key in sorted(mobenab.keys()):
                    print str(key) + " : " + str(mobenab[key])
            print "===================== Wake up ====================="
            car.wake_up()
            for item in ['charge_state', 'climate_state', 'drive_state', 'gui_settings', 'vehicle_state' ]:
                    print "====================== Data : " + item
                    data=car.data_request(item)
                    for key in sorted(data.keys()):
                            print str(key) + " : " + str(data[key])
    
    That'll let you see the fields you've got to work with.
     
    • Helpful x 1
  8. Chips

    Chips Member

    Joined:
    Dec 7, 2016
    Messages:
    24
    Location:
    Merritt Island
    Can't wait to see what you board looks like after you've integrated some of the car data!
     

Share This Page