Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register
  • We just completed a significant update, but we still have some fixes and adjustments to make, so please bear with us for the time being. Cheers!

What can be polled from the car via wifi?

Zeromus-X

Member
Apr 10, 2016
206
184
Los Angeles, 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
 

Tam

Well-Known Member
Nov 25, 2012
8,361
7,195
Visalia, CA
...12V socket 'hot' when the car's asleep?

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

thimel

Member
Feb 27, 2015
603
471
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

DOCAL

Member
May 5, 2016
462
806
San Jose, CA
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

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
Top