Repository navigation
fix(growatt): leave a failed read out instead of sending 0 (2.2.2) - #273
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
frahlg
force-pushed
the
growatt-zeros
branch
from
November 22, 2026 12:49
5009a2c to
72fba2f
Compare
Every PV, battery and meter value started at 0, so a read that did not answer sent 0 W, 0 V or 0 % SoC. Each field now comes only from a read that answered with every register asked for. PV goes out only with its power (1-2), the meter only with its power (1015-1016). The battery keeps its presence check and gets each field only from a read that answered; its power needs both 1009 and 1011. growatt leaves the invented-number baseline. Harness tests for each failed read fail on main. Which registers the meter should read is #271, unchanged here. Not checked on hardware. Refs #263 Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both 1009 and 1011 fail while voltage and SoC answer: the battery goes out without w. A one-word reply to a two-word read is left out. Both tests fail on main. The CHANGELOG now says that a failed PV or meter power read also drops that stream's counters and phase values for the poll. Refs #263 Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
frahlg
force-pushed
the
growatt-zeros
branch
from
November 22, 2026 12:52
72fba2f to
896b6ae
Compare
This was referenced Nov 22, 2026
Merged
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.
This is the never-fabricate half of #263. #265 fixed the battery sign.
Which registers the meter should read is #271 and is not changed here.
What was wrong
growatt2.2.1 started every PV, battery and meter value at 0, so a readthat did not answer still sent a number: 0 W PV, 0 W meter, 0 V and 0 % SoC
on the battery, 0 Hz. docs/WRITING-A-DRIVER.md ("Never fabricate") says a
field that did not answer is left out, and a stream whose defining reading
did not answer is not emitted. A 0 W meter looks like a site in balance, a
0 % SoC like an empty pack.
Change (growatt 2.2.2)
asked for. A shorter reply counts as failed, since a 32-bit decode would
misread the missing word. The metrics follow the same rule.
and the lifetime counter are left out when their reads fail.
per-phase voltages and currents, and the energy counters are left out
when their reads fail.
reading did not answer is not emitted." So when the PV or meter power
read fails, that poll also sends no PV lifetime counter or MPPT values,
or no meter energy counters, frequency or phase values, even if those
reads answered. The MPPT and phase values still reach history as
metrics.
reads that answered, and follows "A hybrid inverter may have no
battery": each field comes only from a read that answered, and the
stream goes out when what answered shows a battery. So a failed power
read does not also drop a good SoC, as in
ferroamp_modbussince feat(victron_mqtt, victron, ferroamp_modbus, zap): what the battery can do now #254.Its power needs both 1009 and 1011, since either alone is not the net.
drivers/tests/invented-number-baseline.json(was 16).make invented-number-report ID=growattfinds nothing, andmake absent-register-report ID=growattsettles every register.Tests
drivers/tests/test_growatt_never_fabricate.py, 13 tests: all answer; PVpower, MPPT, lifetime, meter power, phase and frequency, energy counters,
SoC, voltage and battery power each failing; both battery power reads
failing while voltage and SoC answer (the battery goes out without
w); aone-word reply to a two-word read; and nothing answering. 12 fail on
main; "all answer" passes there and checks values that must not change.The existing growatt tests pass unchanged.
make test-driver ID=growatt: passes.make checkonmain0b8cc26: 5271 passed, 928 skipped.Not verified on hardware
Not run against a real Growatt. On a healthy inverter the readings are the
same as before; the difference shows only when a read fails.
Refs #263
🤖 Generated with Claude Code