Skip to content

fix(gecloud): honour battery_rate_max over charge_rate's max attribute - #4929

Closed
kennedy-nic wants to merge 1 commit into
springfall2008:mainfrom
kennedy-nic:fix-battery-max-discharge
Closed

fix(gecloud): honour battery_rate_max over charge_rate's max attribute#4929
kennedy-nic wants to merge 1 commit into
springfall2008:mainfrom
kennedy-nic:fix-battery-max-discharge

Conversation

@kennedy-nic

@kennedy-nic kennedy-nic commented Sep 4, 2026

Copy link
Copy Markdown
  • GEC/GEE (GivEnergy Cloud) inverters always derived their max charge/discharge rate from the charge_rate entity's max attribute, which GivEnergy's cloud API can report as a stale/low value (2600W on a 20kW 3-phase inverter) instead of the real capability.
  • gecloud.py already computes and publishes an accurate battery_rate_max sensor from the device's model/capability data, but it was being silently ignored for GEC/GEE.
  • battery_rate_max now takes priority over charge_rate's max attribute when configured, fixing the incorrect 2600W cap.

Precedent: this brings GE-family inverters in line with how battery_rate_max already works for AlphaESS, which is documented as an override, in watts, for the battery's max charge/discharge rate specifically because its API doesn't reliably report one. Same situation here – an untrustworthy API-reported value with a manual correction – so this reuses the existing key rather than introducing a new, differently-named one for the same job.

Who this affects: I checked all three default GivEnergy templates (givenergy_givtcp.yaml/GE, givenergy_cloud.yaml/GEC, givenergy_ems.yaml/GEE) and none of them set battery_rate_max, commented or otherwise – the GEE template in fact states that apps.yaml entries in that section are ignored entirely in favour of Cloud auto-configuration. So only a user who has deliberately added battery_rate_max themselves (as this fix requires) would see a behaviour change; anyone on a stock template is unaffected regardless of inverter type.

Fixes #4908

Test plan

  • Added test_gecloud_battery_rate_max_priority regression test (GEC uses the battery_rate_max sensor; GE still falls back to charge_rate's max attribute)
  • ./run_all --test inverter passes
  • ./run_pre_commit – passes except two pre-existing failures confirmed to reproduce identically on a clean main tree, unrelated to this change (a Windows-only triage-daemon-tests POSIX-path bug, and a file-contents-sorter CRLF no-op on requirements.txt)
  • ./run_all --quick – no regressions from this change; two further pre-existing failures confirmed environment-specific to this fresh Windows setup (a missing encoding="utf-8" in an unrelated test helper, and a debug_cases golden-plan mismatch caused by the compiled prediction kernel not being built here)

🤖 Generated with Claude Code

https://claude.ai/code/session_01Djbv5fZh1Nr7MEYF7AqznT

For GEC/GEE (GivEnergy Cloud) inverters, battery_rate_max_raw was always
derived from the charge_rate entity's max attribute, which reflects a live
register limit that GivEnergy's cloud API can read back stale/low (2600W on
a 20kW 3-phase inverter). gecloud.py already computes and publishes an
accurate battery_rate_max sensor from the device's model/capability data,
but it was being silently ignored for GEC/GEE. battery_rate_max now takes
priority when configured, fixing charge/discharge being capped at 2600W.
Fixes springfall2008#4908.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djbv5fZh1Nr7MEYF7AqznT
@kennedy-nic
kennedy-nic marked this pull request as ready for review September 5, 2026 06:06
@springfall2008

Copy link
Copy Markdown
Owner

Fixed a slightly different way here: #4954

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants