Skip to content
forked from mlowijs/tesla_api

Lightweight Python API client for the Tesla API.

License

Notifications You must be signed in to change notification settings

swm11/tesla_api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tesla API

This is a fork of https://github.com/mlowijs/tesla_api. My version uses the requests pacakge to talk to the Tesla server where as the https://github.com/mlowijs/tesla_api version now uses AsyncIO. I suggest you use https://github.com/mlowijs/tesla_api since it is still under active development.

I've switched over to using TeslaPy: https://github.com/tdorssers/TeslaPy since it currently (September 2021) supports the current authentication mechanism.

This is a package for connecting to the Tesla API.

Usage for a vehicle

from tesla_api import TeslaApiClient

client = TeslaApiClient('your@email.com', 'yourPassword')

vehicles = client.list_vehicles()

for v in vehicles:
    print(v.vin)
    v.controls.flash_lights()

Usage for Powerwall 2

from tesla_api import TeslaApiClient

client = TeslaApiClient('your@email.com', 'yourPassword')

energy_sites = client.list_energy_sites()
print("Number of energy sites = %d" % (len(energy_sites)))
assert(len(energy_sites)==1)
reserve = energy_sites[0].get_backup_reserve_percent()
print("Backup reserve percent = %d" % (reserve))
print("Increment backup reserve percent")
energy_sites[0].set_backup_reserve_percent(reserve+1)

About

Lightweight Python API client for the Tesla API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%