github jasonacox/pypowerwall v0.16.5
v0.16.5 - PW3 Lifetime Energy Accumulators via Gateway Local API

latest release: v0.17.0
6 hours ago

PW3 systems now report lifetime energy_imported / energy_exported in /api/meters/aggregates — resolving dashboards showing zero cumulative energy on Powerwall 3. (#221, #372)

Changes

  • feat(tedapi): lifetime energy_imported / energy_exported accumulators are now merged into the synthesized /api/meters/aggregates response for Powerwall 3 systems
    • PW3 firmware still serves the classic /api/meters/aggregates endpoint behind the customer login (POST /api/login/Basic → Bearer token); the TEDAPI adapter fetches that native payload and overlays the energy fields (site/battery/load/solar) that the TEDAPI payloads do not carry
    • Works in both v1r wired-LAN mode and WiFi full-tedapi mode; password auto-derived the same way the library already does it
    • Merged sections carry a provenance note in their disclaimer (…; energy from gateway local API)
    • Gateways without the endpoint degrade gracefully — values stay 0 exactly as before, with a 5-minute retry backoff so unsupported firmware isn't hammered; successful fetches are cached on the normal poll cadence
    • Thread-safety hardening for the proxy's multi-threaded use: bounded lock acquisition with stale-cache fallback on contention (no unbounded queuing behind a slow fetch), double-checked cache inside the lock (no thundering-herd refetch on cache expiry), and last-good-host ordering so a dead wired LAN doesn't add a full timeout to every poll
    • Verified against a live Powerwall 3 (firmware 26.x): values cross-check against solar/grid/battery/load power flows and tick upward between polls
  • test: 17 new unit tests covering the merge logic, cache/backoff, customer-login auth retry (401 → re-login with fresh Bearer), host ordering, and lock contention — full suite 373 passed, 10 skipped

Proxy (t99)

  • Legacy proxy image: jasonacox/pypowerwall:0.16.5t99 (also tagged latest) — carries this release's library changes, so PW3 systems begin reporting lifetime energy on first poll after upgrade

Full Changelog: v0.16.4...v0.16.5


Contributors

Thanks to the community members who made this release possible:

  • @cavedon — discovered that PW3 serves the lifetime energy counters on the gateway local API behind the customer login, and pointed the project at it (issue #221) — the find this release is built on
  • @ajfhodgson — reported the zero energy counters on PW3 and tested endpoint candidates along the way (issue #221)
  • @Nexarian — technical review of the customer-login token flow, scopes, and how it composes with the bearer-auth work (#359)
  • @jasonacox — review findings that hardened the fetch path for multi-threaded proxy use

Don't miss a new pypowerwall release

NewReleases is sending notifications on new releases.