Skip to main content

Tesla API

This is a package for connecting to the Tesla API.

Usage for a vehicle

import asyncio
from tesla_api import TeslaApiClient

async def main():
    client = TeslaApiClient('your@email.com', 'yourPassword')

    vehicles = await client.list_vehicles()

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

asyncio.run(main())

Usage for Powerwall 2

import asyncio
from tesla_api import TeslaApiClient

async def main():
    client = TeslaApiClient('your@email.com', 'yourPassword')

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

asyncio.run(main())

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tesla_api-2.0.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tesla_api-2.0.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file tesla_api-2.0.0.tar.gz.

File metadata

  • Download URL: tesla_api-2.0.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.5.7

File hashes

Hashes for tesla_api-2.0.0.tar.gz
Algorithm Hash digest
SHA256 06532e2730bcf106ee53f1086397f15c874a2bb1f1413cf8f80a351428ad0cac
MD5 16feac48f0d6477b60a101e009f2fb6c
BLAKE2b-256 a61a507471b2f22db00c32774e01c57bd05a0b724a5ba2d1303824bef978e068

See more details on using hashes here.

File details

Details for the file tesla_api-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: tesla_api-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.5.7

File hashes

Hashes for tesla_api-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2fb84f3e0e2655b082178c4d5a81a48c420038310b03efc63b820d936be60d05
MD5 fee871fc528c429cf93914ebc6741642
BLAKE2b-256 04d19eb3bcf52cde53316d3cc5b5e13acecc980e14581ff4142d09eb6e8c15c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page