Skip to content
forked from nside/pytesla

pytesla is a python bindings for the Model S REST API

License

Notifications You must be signed in to change notification settings

jstenback/pytesla

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pytesla

pytesla is a python binding to the Tesla Model S REST API <http://docs.timdorr.apiary.io/> so that you can monitor your car or programmatically interact with it. It makes it easy to schedule charging times, trigger heating/cooling according to weather or just gather stats.

This works with Tesla's updated oauth setup as of 2021-02-07, including with MFA enabled (securty code + backup code).

Usage

>>> import pytesla
>>> mycar = pytesla.Connection('myemail', 'mypassword').vehicle('myvin')
>>> mycar.honk_horn()
True
>>> for e in mycar.stream(StreamEvents.ALL, 2):
>>>    print(str(e[0]))
{'shift_state': 'P', 'elevation': '28', 'soc': '83', 'est_heading': '128', 'est_lat': 'xxx.yyy', 'timestamp': '1450666313710', 'power': '0', 'odometer': '1868.8', 'speed': '', 'est_lng': 'xxx.yyy'}
{'shift_state': 'D', 'elevation': '28', 'soc': '83', 'est_heading': '128', 'est_lat': 'xxx.yyy', 'timestamp': '1450666315459', 'power': '21', 'odometer': '1868.8', 'speed': '43', 'est_lng': 'xxx.yyy'}

Installation

$ pip install pytesla

About

pytesla is a python bindings for the Model S REST API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%