Overview of TeslaPy
masterTeslaPy is a Python implementation of the client-side interface to the Tesla Motors Owner API. It allows developers to monitor and control Tesla products (Vehicles, Powerwalls, and Solar Panels) remotely.
Key Features:
- OAuth 2 Support: Implements Tesla's Single Sign-On (SSO) service.
- Automatic Token Management: Acquired tokens are cached in
cache.jsonin the current working directory and automatically refreshed when expired. - HTTP/2 Support: Uses
httpx(with the[http2]extra) to communicate with Tesla's SSO and Owner API endpoints, which require HTTP/2 as of June 2026. It falls back torequests(HTTP/1.1) ifhttpxis unavailable. - Streaming API: Supports real-time data updates via WebSockets.
- Pluggable Architecture: Supports custom cache loaders/dumpers and authenticator methods.
Important Compatibility Note: The Owner API will eventually stop working for vehicles requiring the Tesla Vehicle Command Protocol. Pre-2021 Model S and X vehicles remain controllable via TeslaPy.