A Crestron Home Entity V2 driver that integrates a Tesla Powerwall energy site via the Tesla Owner API or the official Tesla Fleet API, providing live power flow, battery status, energy history, and site control from the Crestron Home app.
Tesla and Powerwall are trademarks of Tesla, Inc. This project is an independent, unofficial driver and is not affiliated with, endorsed by, or sponsored by Tesla, Inc. Crestron and Crestron Home are trademarks or registered trademarks of Crestron Electronics, Inc. This project is not affiliated with, endorsed by, or sponsored by Crestron Electronics, Inc.
This driver is a Crestron Home energy-automation Entity V2 driver implemented on the Crestron Home SDK Entity V2 Model. It derives directly from ReflectedAttributeDriverEntity and exposes all configuration items, properties, commands, and extension UI bindings through SDK attributes and the entity model.
The driver connects to a single Tesla Powerwall energy site through the TeslaPowerwallLibrary NuGet package, using either its Tesla Owner API (cloud) support or its official Tesla Fleet API support. Only an OAuth refresh token is required for either mode — the library automatically derives and renews the access token from it on every connection.
This driver connects to Tesla using one of two modes, via TeslaPowerwallLibrary. Which mode is used is selected entirely by configuration: leave Tesla Fleet API Client ID blank to use the Tesla Owner API, or set it to use the Tesla Fleet API (see Configuration below).
Uses Tesla's unofficial, undocumented Owner API. Requires a one-time login via the companion TeslaPowerwallLibrary.Setup tool (see Obtaining a Tesla Refresh Token below), using your own Tesla account credentials via Tesla's own login page — this driver never sees or stores your password.
Uses Tesla's officially supported, documented Fleet API. Requires a Tesla Fleet API application (with its own Client ID) and a Fleet API refresh token for your Tesla account. Configuring a Tesla Fleet API Client ID switches the driver into this mode, and the Tesla Refresh Token field must then contain a Fleet API refresh token rather than an Owner API one.
The Fleet API covers everything this driver uses — live status, energy/impact history, backup reserve, operating mode, and grid export control — with one exception: Storm Watch is not available through the Fleet API. When a Client ID is configured, the Storm Watch toggle is hidden from the Settings page and the setStormWatchEnabled command is a no-op.
- Local Mode (Powerwall 2 / Powerwall+ only) —
TeslaPowerwallLibrarycan connect directly to a Gateway 2's local REST API over your home LAN, but this driver does not yet expose it as a configuration option. Not supported on Powerwall 3 in any case, since PW3 replaces this local API with TEDAPI. - TEDAPI (Powerwall 3 local access) — Scaffolded in
TeslaPowerwallLibrarybut not yet complete; requires physical/network access to the Powerwall 3's isolated local interface.
See the TeslaPowerwallLibrary repository for the underlying library's full roadmap and known issues.
- Live house, solar, grid, and Powerwall power flow on the Main page
- Battery level, backup reserve, operation mode, and grid export status
- Energy page with Day/Week/Month/Year/Lifetime period selection, back/forward period navigation, and a per-sub-period breakdown (hourly/daily/weekly/monthly rows depending on the selected period)
- Impact page showing self-powered percentage, home usage, and grid usage for the selected period
- Settings page to adjust backup reserve, grid charging, Storm Watch, operation mode, and grid export mode directly from Crestron Home
- Automatic background polling with a configurable refresh interval
- Manual "Refresh Now" command
- Programmable commands and events for the Crestron Home programming environment (grid status changed to backup, grid status restored, Storm Watch activated/deactivated, battery reserve low, battery fully charged)
The pages below roughly follow the layout of the Tesla mobile app, but everything shown is generated by this driver directly from the Tesla cloud data described here — no app access is required to use it.
The device tile shows current home power consumption (with a BKUP suffix whenever the grid is down and the Powerwall is supplying the house) plus a compact summary of which sources are currently contributing. The Main page breaks that out into four rows — House, Solar, Grid, and Powerwall — each showing that source's live power, plus a status block showing a plain-language summary, the current operation mode, and the current grid export mode. From the Main page you can navigate to the Energy page, the Impact page, or the Settings page.
Shows energy (kWh), not instantaneous power. Two selector rows control what's displayed:
- Period — Day, Week, Month, Year, or Lifetime. Back/forward arrows step through prior instances of the selected period (for example, Day steps one calendar day at a time); the forward arrow disables once you're back at the current period. Lifetime has no history to step through, so the arrows are hidden for it.
- Type — Solar, Powerwall, Grid, or House. Changes which totals are displayed for the selected period:
- Solar: energy produced, home usage, and grid export (export line is hidden when grid export is set to Never)
- Powerwall: energy discharged, energy charged, and the net of the two
- Grid: energy imported, energy exported, and the net of the two
- House: energy used, a Solar/Grid breakdown of where it came from, and how much the Powerwall contributed
Beneath the totals, a per-sub-period breakdown lists the same figures split into rows — Day shows up to 24 hourly rows, Week shows 7 daily rows, Month shows its weekly rows, and Year shows 12 monthly rows. Lifetime has no breakdown and hides this section entirely.
Shows how self-sufficient the site was for the selected period: a gauge with the self-powered percentage, plus how much of that usage came from solar/Powerwall versus the grid. It uses the same Period selector and back/forward navigation as the Energy page.
Lets you adjust the site directly from Crestron Home:
- Backup Reserve — the minimum battery charge percentage reserved for outages
- Charge From Grid — allow the battery to charge from the grid, not just from solar
- Storm Watch — Tesla's predictive pre-charge ahead of severe weather forecasts (only shown when connected via the Tesla Owner API; not available on the Tesla Fleet API)
- Operation Mode — Self Powered, Backup Only, or Autonomous
- Grid Export — Battery OK, Solar Only, or Never
- Refresh Now — forces an immediate refresh instead of waiting for the next scheduled poll
For Crestron Home programmers, every Settings control above is also exposed as a programmable command, and the driver raises programmable events for grid status changed to backup/restored, Storm Watch activated/deactivated, battery reserve low, and battery fully charged — see PowerwallDriver.Commands.cs for the full list.
| Requirement | Details |
|---|---|
| Crestron Home processor | Running a firmware version compatible with Entity V2 drivers |
| Tesla account | Must have one or more Powerwalls linked to the account |
| Tesla OAuth refresh token | Obtained using the TeslaPowerwallLibrary login tool — see Obtaining a Tesla Refresh Token below |
The best way to download and install this driver on a Crestron Home system is to use the Crestron Home Driver Feed Installer repository and application.
If you prefer to install manually, use the attached .pkg asset from the relevant GitHub Release. The automatic GitHub Source code (zip) and Source code (tar.gz) assets are repository snapshots, not installable Crestron driver packages.
NuGet package availability: this driver is also published as the CrestronHomeDriver.Tesla.Powerwall NuGet package. This NuGet package conforms to the Crestron Home Driver NuGet Publishing Standard v1. It is a distribution wrapper for the final .pkg artifact, includes the required crestron-driver-package.json manifest, and is not intended as a direct DLL reference package.
Crestron Home Driver NuGet Publishing Standard v1 is not an official Crestron product or specification. It is an open source packaging standard created to facilitate community distribution and discovery of Crestron Home drivers through NuGet.
- Download the generated
.pkgasset from the GitHub Release, or build it yourself using the instructions in Building from Source. - Upload the
.pkgfile to your Crestron Home processor manually (for example via SFTP to/user/ThirdPartyDrivers/Import). - In the Crestron Home configuration UI, add a new device and select the Tesla Powerwall driver.
- Configure the driver using the values below.
| Field | Description |
|---|---|
| Tesla Fleet API Client ID | Optional. Leave blank to use the Tesla Owner API. Set to a Tesla Fleet API application Client ID to use the Tesla Fleet API instead — when set, the refresh token below must be a Fleet API refresh token, and Storm Watch is unavailable. |
| Tesla Refresh Token | Required. OAuth refresh token for the Tesla account — an Owner API refresh token if Client ID above is blank, or a Fleet API refresh token if it is set. See Obtaining a Tesla Refresh Token below. |
| Tesla Energy Site ID | Optional. Numeric Tesla energy site ID, or the site's name exactly as shown in the Tesla app/account. Leave blank to use the account's first/default energy site. |
| Refresh Interval Seconds | How often the driver refreshes Powerwall status and power data from Tesla. 30-3600 seconds; default 60. |
This driver needs an OAuth refresh token for your Tesla account before it can connect, regardless of mode. Tesla's login flow requires an interactive browser sign-in, which isn't something a Crestron Home driver can perform on its own, so token retrieval is handled by a companion tool from the TeslaPowerwallLibrary repository:
- Go to the TeslaPowerwallLibrary releases page and download the latest
TeslaPowerwallLibrary.Setuprelease asset. - Run the tool and sign in with your Tesla account credentials in the interactive login window. For Fleet API mode, use the tool's Fleet API login option and supply your Fleet API application's Client ID.
- Copy the resulting refresh token shown by the tool.
- Paste it into the Tesla Refresh Token field when configuring this driver in Crestron Home (and, for Fleet API mode, paste the Client ID into the Tesla Fleet API Client ID field).
Full step-by-step instructions, including screenshots, are in the Tesla cloud login guide.
Tesla may periodically rotate the refresh token; this driver automatically persists an updated token if Tesla rotates it during normal use, so re-running the login tool should only be necessary if the stored token is lost or revoked.
- TeslaPowerwallLibrary NuGet package
- Crestron.DeviceDrivers.DevKit NuGet package
- Crestron.SimplSharp.SDK.Library NuGet package
.NET Framework 4.7.2- ILRepack via
ILRepackMerge.ps1 PatchMergedAssembly.ps1to rewrite merged assemblies for Crestron Home runtime compatibilityManifestUtil.exefrom the Crestron Driver SDK to produce the final.pkg
dotnet build TeslaPowerwallCrestronDriver.slnx -c ReleaseThe build pipeline:
- Compiles the driver targeting
net472 - Bumps
DriverVersionandVersionDateinTeslaPowerwallCrestronDriver.json - ILRepacks runtime dependencies into the driver assembly
- Runs
PatchMergedAssembly.ps1against the merged assembly - Packages the driver into a
.pkgusing Crestron's ManifestUtil
This repository includes a GitHub Actions workflow that builds the Release package and attaches the generated .pkg to a GitHub Release.
The same release workflow also publishes the TeslaPowerwallCrestronDriver NuGet package, which wraps the final generated .pkg artifact.
Typical release flow:
- Push the release commit and tag
- Publish the GitHub Release for that tag
- Let the workflow build and attach the
.pkgasset automatically
- XML documentation generation is enabled in the project build
- The release workflow builds the package on
windows-latest - The repository includes the driver package/build scripts needed for packaging and deployment
MIT + Commons Clause © 2026 Neil Colvin — see LICENSE.
Free to use and modify. You may not sell the Software as a standalone product or sublicense it. Commercial system integration work (for example, a Crestron installer commissioning a customer system) is explicitly permitted, even where a fee is charged for that service.
Tesla and Powerwall are trademarks of Tesla, Inc.
Note: This project references Crestron.DeviceDrivers.DevKit, which is subject to Crestron's SDK license agreement. That license governs the SDK libraries only; the source code in this repository is licensed independently under the terms above.