aiopytedapi
An async Python client for the Tesla Powerwall gateway's local TEDAPI.
- Async only, built on aiohttp. You pass in the
ClientSession, so it fits Home Assistant and other asyncio apps. - Typed (
py.typed, checked withmypy --strict). - Local: talks to the gateway on your network. Nothing goes to Tesla's servers.
- Errors are exceptions, never
None: every one derives fromTedapiError.
Status: alpha (0.x). The API may change between minor versions. Pin
aiopytedapi>=0.1,<0.2.
Connections
| Connection | Endpoint | Authenticates with | Can change settings |
|---|---|---|---|
| Signed | /tedapi/v1r on the gateway's home-network address or its Wi-Fi address (192.168.91.1) |
An RSA key registered with the gateway | Yes |
| Gateway Wi-Fi | /tedapi/v1 on 192.168.91.1 |
The Wi-Fi password printed on the gateway | No (read-only) |
Registering a key needs Tesla's cloud once (for example python -m pypowerwall register). This library doesn't do that step.
Features
| Feature | Methods | Signed | Gateway Wi-Fi |
|---|---|---|---|
| Network status (Wi-Fi, Ethernet, cellular) | get_network_status() |
✅ Powerwall 3 | ✅ Powerwall 3 and 2 |
| Site import/export limits | get_site_limits(), set_import_limit(), set_export_limit() |
✅ read and write | ✅ read |
| Battery calibration delay | get_battery_calibration_delay_status(), delay_battery_calibration() |
✅ | — |
| Registered keys | get_authorized_clients(), add_authorized_client(), remove_authorized_client() |
✅ list, add, remove | ✅ list |
| Gateway configuration | get_config() |
✅ | ✅ |
What has been seen on hardware so far:
- Network status: Powerwall 3 (firmware 26.34.3) on both connections; Powerwall 2 (26.42.0) on Gateway Wi-Fi only. Over the signed connection a Powerwall 2 answers
MessageFaultError(MESSAGEFAULT_ERROR_TIMEOUT). - Registered keys: listing, adding and removing on a Powerwall 3 (26.34.3).
- Site limits: reading on a Powerwall 3 (26.34.3). Writing has not been tried on hardware.
- Calibration delay: a Powerwall 3 on 26.34.3 answers
NotSupportedError(the firmware doesn't implement it). The delay command has not been sent to hardware.
Example
import asyncio
from pathlib import Path
import aiohttp
from aiopytedapi import RsaKey, TedapiClient
async def main() -> None:
key = RsaKey.from_pem(Path("tedapi_rsa_private.pem").read_bytes())
async with aiohttp.ClientSession() as session:
client = TedapiClient.signed(session, "192.168.1.50", key, password="ABCDE")
await client.connect()
status = await client.get_network_status()
print(status.active, status.to_dict())
limits = await client.get_site_limits()
print(limits.import_limit_kw, limits.export_limit_kw)
for c in (await client.get_authorized_clients()).clients:
print(c.fingerprint[:16], c.type, c.state)
asyncio.run(main())
password is the customer login password (the last 5 characters of the Gateway Wi-Fi password on most gateways). It's used to fetch the DIN. Pass din= instead if you already know it.
For the Gateway Wi-Fi connection:
client = TedapiClient.wifi(session, "WIFI_PASSWORD")
Safety
Some commands change how your Powerwall and your site behave.
- Site limits: an installer may have set the import or export limit to meet your grid connection agreement (for example a network export limit). Don't raise or remove one unless you're allowed to.
- Calibration delay: the gateway allows a limited number of delays, and each may use one.
- Removing a key stops that client sending commands. Removing the key you sign with is refused unless you pass
allow_current_key=True.
Every command that changes something logs a WARNING. You use these commands at your own risk; check your warranty and your grid connection agreement first.
Privacy
Models keep values that identify a home or a person (Wi-Fi SSID, MAC and IP addresses, key descriptions) out of repr, and to_dict() only includes them with details=True. The gateway's Wi-Fi password is never parsed. get_config() returns the gateway's full configuration, which includes identifiers: don't log or publish it.
Credits
The wire schema and the request formats come from pypowerwall (MIT), which in turn credits Matthew1471's Tesla-API, Nexarian's TEDAPI work and Teslemetry/tesla-protocol. See NOTICE.
This project is not affiliated with or endorsed by Tesla.
Development
pip install -e . pytest pytest-asyncio pytest-cov mypy ruff types-protobuf
ruff check . && mypy && pytest --cov
The protobuf bindings are generated: change src/aiopytedapi/_proto/tedapi.proto, then run bash tools/gen_proto.sh. Never edit tedapi_pb2.py by hand.
Licence
MIT. See LICENSE.
Metadata
Release files for aiopytedapi 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aiopytedapi-0.1.0.tar.gz | 48.2 kB | With provenance | Details for aiopytedapi-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aiopytedapi-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for aiopytedapi-0.1.0-py3-none-any.whl |
Total release size: 93.0 kB
Release files / aiopytedapi-0.1.0.tar.gz
| Download URL | aiopytedapi-0.1.0.tar.gz |
|---|---|
| Size | 48.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6559bd8a625dca7c004810d949bd213e823e658d009b19670b44798fef3f7376
|
|
BLAKE2b-256 checksum How to use checksums |
7e3333c731479b1dd93a8addacadb671648d5b9761f156268ad191e578b4d511
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logRelease files / aiopytedapi-0.1.0-py3-none-any.whl
| Download URL | aiopytedapi-0.1.0-py3-none-any.whl |
|---|---|
| Size | 44.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4542c3125cd4b311c0241a17d9cda29ae6eda56d8207da7a3b336d6d2d6931cb
|
|
BLAKE2b-256 checksum How to use checksums |
a81fa754cad996f4f0e52f90d7d7e7588056e3a67a102ce3f1ce3aad5a1f26fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logSecurity for aiopytedapi 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for aiopytedapi-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.