Skip to content

fix(inverter): don't press the update button on idle non-export cycles - #4713

Draft
chalfontchubby wants to merge 1 commit into
fix/solis-redundant-button-press-4709from
fix/solis-non-export-button-press
Draft

fix(inverter): don't press the update button on idle non-export cycles#4713
chalfontchubby wants to merge 1 commit into
fix/solis-redundant-button-press-4709from
fix/solis-non-export-button-press

Conversation

@chalfontchubby

@chalfontchubby chalfontchubby commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

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 to main once #4711 lands.

Problem

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 branch 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 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 idle adjust_force_export(False) calls:

             GS      GS_fb00
main         4/4     4/4
+#4711       1       4/4     <- #4711 closes the is_hm_format / changed_start_end route
+#4713       1       1       <- this PR closes the None-comparison route

An earlier revision of this description said plain GS "was never affected". That was measured with #4711 already applied rather than against main, 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 None by the time we reach the comparison. That keeps the GE path's behaviour byte-for-byte unchanged, and is what adjust_force_export1 in 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:

ERROR: GS_fb00 pressed the button 4 times over 4 idle cycles, expected at most 1

Full --quick suite 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

@chalfontchubby

Copy link
Copy Markdown
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
chalfontchubby force-pushed the fix/solis-non-export-button-press branch from fe7f215 to 4bd8cb1 Compare August 24, 2026 20:22
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