Skip to content

Make the accumulator saturation check reachable - #1040

Open
it-rec wants to merge 1 commit into
WillCodeForCats:mainfrom
it-rec:fix/accum-saturation-check
Open

Make the accumulator saturation check reachable#1040
it-rec wants to merge 1 commit into
WillCodeForCats:mainfrom
it-rec:fix/accum-saturation-check

Conversation

@it-rec

@it-rec it-rec commented Aug 16, 2026

Copy link
Copy Markdown

Problem

Three accumulator sensors treat a saturated SunSpec accumulator as unavailable:

or self._platform.decoded_model[key] > SunSpecAccum.LIMIT32

SunSpecAccum.LIMIT32 is 0xFFFFFFFF and the value is decoded as UINT32, so it can never be greater than the limit. The check never fires, and a fully saturated accumulator is reported as a normal value.

Changes

Compare with >= in SolarEdgeACEnergy, MeterVAhIE and MetervarhIE.

Testing

Verified by reasoning about the value range, not on hardware: my accumulators are nowhere near saturation, so I cannot produce the condition on a real device. The change is a one-character comparison fix whose current form is unreachable by construction.

Checklist

  • Based on the latest upstream main.
  • One subject only.
  • Tested against real hardware - the condition cannot be produced on my system, see above.

The three accumulator sensors treat a saturated SunSpec accumulator as
unavailable via "decoded_model[key] > SunSpecAccum.LIMIT32". LIMIT32 is
0xFFFFFFFF, and the value is decoded as UINT32, so it can never exceed
that limit and the check never fires.

Compare with >= so a fully saturated accumulator is actually detected.
@it-rec
it-rec force-pushed the fix/accum-saturation-check branch from 7decb15 to 53af248 Compare August 17, 2026 05:04
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