Repository navigation
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. |
… (2.2.1) Both drivers sent 0 on the meter and PV streams when a read failed. A 0 W meter reading looks like a site in balance. Each field now comes only from a register that answered, and the meter and PV streams only from their power reads: 820-822 and 808/850 on victron, 3100 and 5100 on ferroamp_modbus. ferroamp_modbus also treats a reply with fewer registers than asked for as failed, since the missing word decoded as 0. Harness tests cover each failed read; both drivers leave the invented-number baseline. Not checked on hardware. Refs #258 Signed-off-by: Fredrik Ahlgren <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
A one-off failure of the AC-coupled PV read (808) while 850 answers sends a PV figure without the AC-coupled part until the next poll. Keep that trade-off and say so. Refs #258 Signed-off-by: Fredrik Ahlgren <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 22, 2026
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.
What was wrong
victron2.2.0 andferroamp_modbus2.2.0 started every meter and PVfield at 0 and emitted both streams whether or not their reads answered.
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 reading from a failed read looks like a site in
balance. #254 fixed the battery side of both drivers; this does the meter
and PV sides.
Change
victron 2.2.1
all three phases. Its metrics likewise.
answered. A GX with no DC-coupled MPPT does not answer 850, so PV is the
AC part alone; with neither, there is no PV reading. So a one-off
failure of 808 while 850 answers sends a PV figure without the
AC-coupled part until the next poll. That trade-off is kept and noted
in the CHANGELOG.
ferroamp_modbus 2.2.1
voltages (2032), currents (3112) and energy counters (3064) are each set
only when their read answered. Per-phase watts (V x I) need both.
(5064) only when it answered.
reads.
decode_f32_ws_atturned the missing word into 0, and theinvented-number probe does not catch that, since the value was read in
its healthy phase.
stream is left out.
Both drivers leave
drivers/tests/invented-number-baseline.json(victron was 5, ferroamp_modbus 15);
make invented-number-reportnowfinds nothing for either.
make absent-register-reportsettles everyregister for both.
Tests
drivers/tests/test_victron_meter_pv.py, 6 scenarios: all answer, gridread fails, both PV reads fail, no DC PV, no AC PV, nothing answers.
drivers/tests/test_ferroamp_modbus_meter_pv.py, 9 scenarios: all answer,grid power fails, voltage fails, current fails, frequency and energy fail,
PV power fails, PV energy fails, short reply, nothing answers.
mainand pass here. The 4 that pass onmain(each driver's "all answer", and victron's "no DC PV" and "no AC PV")
check behaviour that must not change.
make test-driver ID=victron: 117 passed, 10 skipped.make test-driver ID=ferroamp_modbus: 65 passed, 4 skipped.make checkonmain2cf08cb: 5258 passed, 928 skipped.Not verified on hardware
Neither driver has been run against a real GX or EnergyHub for this
change. On a healthy device the readings are the same as before; the
difference shows only when a read fails.
Found on the way, not changed here
decode_f32_ws_atinferroamp_modbusalso returns 0 for a register thatanswers with NaN or infinity, which the driver treats as "not present".
That is a reply, not a failed read, and it reaches the battery fields too.
A parallel change to fronius, alphaess, kstar and goodwe may also edit
invented-number-baseline.json. The lines sit next to each other, sowhichever lands second may need a one-line merge.
Refs #258
🤖 Generated with Claude Code