docs: warn about 80% reserve limit in cloud/FleetAPI mode#304
Conversation
Tesla's cloud APIs enforce a maximum backup reserve of 80%. Setting reserve above 80% requires v1r LAN mode. This adds: - CLI warning when set_reserve > 80% in cloud or FleetAPI mode - Post-set verification showing actual capped value - README documentation in LAN Control table and CLI usage section - API reference note on set_reserve() Refs: jasonacox/discussions/303
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #304 +/- ##
==========================================
- Coverage 26.49% 26.45% -0.05%
==========================================
Files 42 42
Lines 7636 7648 +12
Branches 1091 1097 +6
==========================================
Hits 2023 2023
- Misses 5469 5481 +12
Partials 144 144
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds user-facing documentation and CLI feedback to reflect Tesla Cloud/FleetAPI’s enforced 80% maximum backup reserve, and points users to v1r LAN mode for reserves above 80%.
Changes:
- Added README documentation describing the 80% reserve cap in Cloud/FleetAPI mode and an example using
-v1rto set higher reserves. - Added CLI warnings when
set -reserve/set -currentattempts to exceed 80% in cloud/FleetAPI mode. - Added a post-set verification step intended to detect when Tesla caps the requested reserve.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| README.md | Documents the Cloud/FleetAPI 80% reserve cap and shows how to exceed it via v1r LAN mode. |
| pypowerwall/main.py | Adds CLI warnings and post-set verification to inform users when reserves above 80% may be capped by Tesla. |
Comments suppressed due to low confidence (1)
pypowerwall/main.py:472
- Same issue as the -reserve path: the post-set verification uses
pw.get_reserve()with defaultscale=Trueandforce=False, which can produce misleading "capped at" output (scaled percent) or stale cached data. Useget_reserve(scale=False, force=True)and compare against the requested value (here,current).
if current > 80 and pw.mode in ('cloud', 'fleetapi'):
actual = pw.get_reserve()
if actual is not None and actual <= 80:
print(f"NOTE: Tesla capped reserve at {actual}% instead of {current:.0f}%.")
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| print(f"WARNING: Tesla cloud/FleetAPI limits backup reserve to 80%% max. " | ||
| f"Requesting {reserve}%% but Tesla may cap it at 80%%. " | ||
| f"Use TEDAPI v1r mode (-v1r) to set reserve above 80%%.") |
There was a problem hiding this comment.
Good catch — fixed. The doubled %% was unnecessary in f-strings (that's only needed for %-formatting). Changed to single % in all three WARNING lines.
— Sam 🌊
| print("Setting Powerwall Reserve to %s" % reserve) | ||
| pw.set_reserve(reserve) | ||
| result = pw.set_reserve(reserve) |
There was a problem hiding this comment.
Fixed — removed the unused result assignments. The return values weren't being used for error handling, so dropping the assignment is cleaner.
— Sam 🌊
| | Backup reserve | `set_reserve(level)` | 0-100 (percentage) | | ||
|
|
||
| > **Cloud/FleetAPI Reserve Limit:** Tesla's cloud APIs enforce a maximum backup reserve of 80%. If you need to set the reserve above 80% (e.g., for a full charge before an outage), use the v1r LAN mode shown below. The `set` CLI will print a warning when you attempt to exceed 80% in cloud or FleetAPI mode. | ||
| | Operation mode | `set_mode(mode)` | `self_consumption`, `backup` | | ||
| | Grid charging | `set_grid_charging(enable)` | `True` / `False` | |
There was a problem hiding this comment.
Fixed — moved the blockquote note below the table so the Markdown table renders correctly.
— Sam 🌊
|
@jasonacox-sam Please address the Copilot review points above if they make sense (post replies for each one). Also, please add this reserve limit changes to the RELEASE.md under v0.15.7 (I'll fold it into that release version). |
…ication, move README note outside table
|
@jasonacox Done — addressed all four Copilot points and pushed the fix:
Also added the reserve limit docs entry to RELEASE.md under v0.15.7. — Sam 🌊 |
|
Following up from discussion #303 — Jason noted that the Tesla app also requires pairing with the Powerwall to set backup reserve above 80%. Without pairing, the app enforces the same 80% cap as cloud/FleetAPI. The README note in this PR currently says:
Suggested update to also mention the Tesla app pairing requirement:
— Sam ⚡ |
|
@jasonacox All done — three items addressed:
Ready for your review. — Sam ⚡ |
|
Good job on this, @jasonacox-sam - merging. |
Summary
Tesla's cloud and FleetAPI APIs enforce a maximum backup reserve of 80%. Setting reserve above 80% (e.g., to 100% before an outage) silently fails — the value snaps back to 80%.
To set reserve above 80%, users must use v1r LAN mode (
-v1r).Changes
CLI (
__main__.py)set -reserveorset -currentwould exceed 80% in cloud/FleetAPI modeREADME
set_reserve()API reference with the limitationTesting
Tested on firmware 26.10.3 — cloud and FleetAPI both cap at 80%, v1r allows 90%+.
Ref: #303