fix(inverter): don't press the update button on idle non-export cycles - #4713
Draft
chalfontchubby wants to merge 1 commit into
Draft
fix(inverter): don't press the update button on idle non-export cycles#4713chalfontchubby wants to merge 1 commit into
chalfontchubby wants to merge 1 commit into
Conversation
chalfontchubby
marked this pull request as ready for review
August 24, 2026 18:42
Collaborator
Author
|
Marking as ready for review on the strength of the auto triage on the source issue. |
execute.py calls adjust_force_export(False) with no times at all whenever nothing is being exported. On an inverter with has_discharge_enable_time set the midnight override is skipped, so new_start/new_end stay None while the inverter still reports a real time - and None never compares equal, so every idle cycle looked like a schedule change and pressed the update button. That is most of the day, not just export windows (#2328). Only compare times the caller actually asked us to set. A genuine transition out of export is still caught by force_export != old_discharge_enable, and the GE branch that deliberately clears the times keeps its existing behaviour - it is distinguished by whether the caller supplied any times, not by the times being None once we are past that branch. Affects GS_fb00 and the FoxCloud/TESLA/Enphase/Deye/Sunsynk/AlphaESS cloud types; plain GS takes the midnight-override path and was never affected. Not yet confirmed against a live install - awaiting logs on #4709. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
chalfontchubby
force-pushed
the
fix/solis-non-export-button-press
branch
from
August 24, 2026 20:22
fe7f215 to
4bd8cb1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4712
Draft — stacked on #4711, and not yet confirmed against a live install.
Base is
fix/solis-redundant-button-press-4709, so this PR shows only its own commit. Retarget tomainonce #4711 lands.Problem
execute.pycallsadjust_force_export(False)with no times at all whenever nothing is being exported. On an inverter withhas_discharge_enable_timeset, the midnight-override branch is skipped, sonew_start/new_endstayNonewhile the inverter still reports a real time — andNonenever compares equal, so every idle cycle looks like a schedule change and presses the update button.That is most of the day, not just export windows: roughly 288 presses/day rather than a handful. On Solis each press is a non-volatile register write (#2328) and also zeroes the timed current registers (#4415 / #4709).
This PR is necessary but not sufficient on its own
There are two independent routes from an idle cycle to the button press, and this PR closes one of them. Measured on unmodified
main(b08b7716), four idleadjust_force_export(False)calls:GSischarge_time_format: "H M", so onmainit presses every idle cycle viachanged_start_end. fix(inverter): stop re-committing a stable export window every cycle (Solis) #4711 fixes that — a wider benefit than fix(inverter): stop re-committing a stable export window every cycle (Solis) #4711's own description claims.GS_fb00and the cloud types (FoxCloud,TESLA,EnphaseCloud,DeyeCloud,SunsynkCloud,AlphaESSCloud) additionally hit theNonecomparison. Theirold_start/old_endare never overwritten — nothing is written whennew_startisNone— so that route stays true forever past fix(inverter): stop re-committing a stable export window every cycle (Solis) #4711, and needs this PR.An earlier revision of this description said plain
GS"was never affected". That was measured with #4711 already applied rather than againstmain, and was wrong; corrected above. Thanks to the automated triage on #4712 for catching it.Fix
Only compare times the caller actually asked us to set.
The distinction matters: the GE branch deliberately clears the times to signal "we're using immediate controls", which is a different thing from the caller never supplying any. So the check keys off whether the caller supplied times, captured before either override runs — not off the times being
Noneby the time we reach the comparison. That keeps the GE path's behaviour byte-for-byte unchanged, and is whatadjust_force_export1in the existing suite pins down.A genuine transition out of export is still caught by
force_export != old_discharge_enable.Testing
New regression test covering both types, verified to fail without the fix:
Full
--quicksuite green.Why draft
Unit-level reproduction only; no live confirmation yet, and six of the eight affected types are cloud inverters that are hard to test here. Logs requested on #4712 and #4709 — the specific question is whether presses continue at the same 5-minute cadence when no export is scheduled.
🤖 Generated with Claude Code