Skip to main content

API client for Tesla

Project description

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())

Project details


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.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tesla_api-2.0.1.tar.gz
Algorithm Hash digest
SHA256 ab6bf5092d762851f68b158a3dc573a4134c772d1d0c102b9733f371f7c865ff
MD5 3c4d0c3733a0007e062e995469429f7e
BLAKE2b-256 c4cf065209a4e7b2013c2e8471e38b4a150310e4c16baa7104cfcd5ac0ab3a46

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for tesla_api-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c77e0a08244c89f5c75c1b7b591350db56d29d5243d9bd2933c37fe141e3202a
MD5 becba3da833e04961ffa82dc04927e70
BLAKE2b-256 440417eb10fd318182f6602bb3daecde61ca9e6f28b5fff728968193f98c89f3

See more details on using hashes here.

Supported by

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