energyscraper
A command-line tool for querying Tesla Energy systems using the Fleet API and the Powerwall device protocol, exposing telemetry Tesla's public apps don't normally show.
The problem
A Powerwall 3 installation with four solar orientations (north, south, east, and west) raises an obvious question: how does each array actually perform through the day and across the seasons? Tesla's apps provide excellent high-level information, but they intentionally hide much of the underlying telemetry, including the per-string voltage, current, and power values the hardware already measures.
energyscraper exposes that data using the documented Fleet API where possible and the Powerwall's own protocols where appropriate. It began as a simple way to collect Powerwall metrics for Prometheus and has grown into a toolkit for site power flows, battery telemetry, and per-MPPT PV string readings.
What it does
- Per-string PV telemetry - voltage, current, and power for each Powerwall 3 MPPT string, read directly from the gateway over the local network
- Passwordless gateway pairing - authenticates to the gateway with a one-time RSA key registration; the gateway DIN and LAN IP are discovered automatically from the Fleet API, so no gateway password or Wi-Fi connection is needed
- AC-coupled solar breakdown - separates the Powerwall's DC string production from any AC-coupled inverter feeding the same site, computed as the metered solar total minus the DC string sum
- Site power flows - solar, load, battery, and grid, plus vehicle and Wall Connector status from the Fleet API
- Watch mode - prints a timestamped reading each interval, in the spirit of zpool iostat, with cloud values cached to stay under Fleet API rate limits
- Prometheus exporter - serves the live metrics on a /metrics endpoint, with a ready-to-run Prometheus and Grafana stack included via docker compose
- JSON output - every command can emit the raw responses for scripting
Technical details
Python CLI. Cloud data comes from the Tesla Fleet API using OAuth authorization-code login; the refresh token is stored locally with file mode 0600 and the client secret is never persisted. Per-string data comes from the gateway's TEDAPI over an RSA-signed channel, with pair and unpair commands to register and revoke the key. A raw gateway gRPC device-command escape hatch is included for protocol investigation, and an optional pypowerwall-based local mode supports older gateway setups.
The exporter publishes gauges for per-string voltage, current, and power, DC and AC-coupled solar totals, site power flows, and Powerwall charge. PV strings are read locally on every scrape, while cloud values are cached so fast scrape intervals don't hit rate limits.
On the roadmap: a continuous daemon mode for high-resolution history, follower-inverter support on multi-inverter sites, remote string reads relayed through the Fleet API, and per-string labels such as roof orientation.