Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

What can be polled from the car via wifi?

This site may earn commission on affiliate links.
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
 
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?

View attachment 236780
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
  • Like
Reactions: bmah and Tam
That thread is great. I'll be reading this for hours. Thank you!

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
Reactions: pilotSteve