CrestronHomeDriver.Tesla.Powerwall 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package CrestronHomeDriver.Tesla.Powerwall --version 1.0.2
                    
NuGet\Install-Package CrestronHomeDriver.Tesla.Powerwall -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CrestronHomeDriver.Tesla.Powerwall" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CrestronHomeDriver.Tesla.Powerwall" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="CrestronHomeDriver.Tesla.Powerwall" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CrestronHomeDriver.Tesla.Powerwall --version 1.0.2
                    
#r "nuget: CrestronHomeDriver.Tesla.Powerwall, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CrestronHomeDriver.Tesla.Powerwall@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CrestronHomeDriver.Tesla.Powerwall&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=CrestronHomeDriver.Tesla.Powerwall&version=1.0.2
                    
Install as a Cake Tool

TeslaPowerwallCrestronDriver

A Crestron Home Entity V2 driver that integrates a Tesla Powerwall energy site via the Tesla Owners (cloud) 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.

License: MIT + Commons Clause


Driver Architecture

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 its Tesla Owners (cloud) API support. Only a Tesla account OAuth refresh token is required — the library automatically derives and renews the access token from it on every connection.


Supported Connection Modes

This driver currently connects to Tesla using one mode, via TeslaPowerwallLibrary:

Tesla Owner API (Cloud)

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.

⚠️ Stability notice: The Owner API is unofficial and undocumented. As of July 2026, Tesla has begun deprecating Owner API access for vehicle endpoints (confirmed via multiple independent reports and Tesla's own error responses pointing to the official Fleet API). Energy/Powerwall endpoints appear unaffected at this time, but there is no guarantee this will remain the case. If Owner API access breaks for your site, please open an issue on this repository.

Not Yet Supported

  • Local Mode (Powerwall 2 / Powerwall+ only)TeslaPowerwallLibrary can 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.
  • Fleet API (official) — Tesla's officially supported, documented API. Not yet implemented in TeslaPowerwallLibrary. It covers live status and control (backup reserve, operating mode, Storm Watch) fully, but its historical calendar_history endpoint has no equivalent to the Owner API's self_consumption, soe, or power history, so switching entirely to Fleet API would mean losing that historical data.
  • TEDAPI (Powerwall 3 local access) — Scaffolded in TeslaPowerwallLibrary but 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.


Features

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

Usage

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.

Home tile and Main page

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.

Energy 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.

Impact page

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.

Settings 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
  • 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

Programming

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.


Prerequisites

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

Installation

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.

  1. Download the generated .pkg asset from the GitHub Release, or build it yourself using the instructions in Building from Source.
  2. Upload the .pkg file to your Crestron Home processor manually (for example via SFTP to /user/ThirdPartyDrivers/Import).
  3. In the Crestron Home configuration UI, add a new device and select the Tesla Powerwall driver.
  4. Configure the driver using the values below.

Configuration

Field Description
Tesla Account Email Optional, label only. Not sent to Tesla; just identifies which account the refresh token below belongs to.
Tesla Refresh Token Required. OAuth refresh token for the Tesla account — 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 the Tesla cloud. 30-3600 seconds; default 60.

Obtaining a Tesla Refresh Token

This driver authenticates to Tesla exclusively through the Tesla Owners cloud API, so it needs an OAuth refresh token for your Tesla account before it can connect. 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:

  1. Go to the TeslaPowerwallLibrary releases page and download the latest TeslaPowerwallLibrary.Setup release asset.
  2. Run the tool and sign in with your Tesla account credentials in the interactive login window.
  3. Copy the resulting refresh token shown by the tool.
  4. Paste it into the Tesla Refresh Token field when configuring this driver in Crestron Home.

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.


Building from Source

Dependencies

Build

dotnet build TeslaPowerwallCrestronDriver.slnx -c Release

The build pipeline:

  1. Compiles the driver targeting net472
  2. Bumps DriverVersion and VersionDate in TeslaPowerwallCrestronDriver.json
  3. ILRepacks runtime dependencies into the driver assembly
  4. Runs PatchMergedAssembly.ps1 against the merged assembly
  5. Packages the driver into a .pkg using Crestron's ManifestUtil

GitHub Release Asset

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:

  1. Push the release commit and tag
  2. Publish the GitHub Release for that tag
  3. Let the workflow build and attach the .pkg asset automatically

Repository Notes

  • 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

License

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.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.2 55 7/10/2026
1.1.1 59 7/10/2026
1.1.0 52 7/10/2026
1.0.2 58 7/9/2026
0.1.0-preview 51 7/9/2026