Skip to content

fix(transport): auto-derive v1r login password from full gateway password - #7

Merged
Bre77 merged 1 commit into
mainfrom
fm/apw-gwpassword-last5-fix
Jul 20, 2026
Merged

fix(transport): auto-derive v1r login password from full gateway password#7
Bre77 merged 1 commit into
mainfrom
fm/apw-gwpassword-last5-fix

Conversation

@Bre77

@Bre77 Bre77 commented Jul 20, 2026

Copy link
Copy Markdown
Member

Intent

  • Fixes a silent 401 usability trap in local v1r login: the gateway's /api/login/Basic only accepts the last 5 characters of the gateway/WiFi password, not the full value.
    • Discovered live against real Powerwall 3 hardware: the full saved gateway password 401s, the last-5-chars truncation succeeds first try.
    • This is a known, established Powerwall local-login convention - jasonacox/pypowerwall's v1r path auto-derives it the same way, rather than documenting it as a caller burden.
    • aiopowerwall previously took gateway_password and passed it straight through unverbatim, so every caller had to already know the last-5 trick out-of-band or get a bare 401 with no hint why.
  • Fix: V1rTransport now derives the 5-char customer password internally (_customer_password, truncates to the last 5 characters). PowerwallClient(gateway_password=...) keeps taking the full gateway/WiFi password - the value callers already have and the value the constructor docstring and README document.
    • No public API change - just correct behavior for the documented parameter.
    • README and constructor docstring now say explicitly that the full password is expected and the truncation is automatic.
  • Tests: unit-tests the truncation helper and asserts V1rTransport.login() sends the derived 5-char value over the wire, given a full password input. No live-hardware test added (per the brief, the live proof already exists).

…sword

The gateway's local /api/login/Basic only accepts the last 5 characters of
the gateway/WiFi password, an undocumented Tesla convention (also
auto-derived by pypowerwall's v1r path) discovered live against real
hardware: the full saved password 401s, the last-5 truncation succeeds.

PowerwallClient(gateway_password=...) still takes the full password;
V1rTransport now derives the 5-char value internally instead of silently
401ing on every caller who doesn't already know the trick out-of-band.
@Bre77
Bre77 merged commit 6dc56f2 into main Jul 20, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant