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. |
frahlg
added a commit
that referenced
this pull request
Nov 22, 2026
…y again Review of #272: - With storage, PV power is now the sum of the MPPT blocks before the battery blocks, as evcc's fronius-gen24 template reads it. Fronius's map does not say whether model 113's DC power includes the battery input, so a 3 kW discharge could have shown as 3 kW of sun. Model 113's DC power is used only where there is no battery input, and PV is left out for a poll where the storage model is known but the battery blocks are not readable. - The storage check is no longer sticky. While no storage model is known the driver reads the chain again every five minutes, and at once when model 160's length changes, so a battery fitted after start is found. Refs #260 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
frahlg
added a commit
that referenced
this pull request
Nov 22, 2026
…y again Review of #272: - With storage, PV power is now the sum of the MPPT blocks before the battery blocks, as evcc's fronius-gen24 template reads it. Fronius's map does not say whether model 113's DC power includes the battery input, so a 3 kW discharge could have shown as 3 kW of sun. Model 113's DC power is used only where there is no battery input, and PV is left out for a poll where the storage model is known but the battery blocks are not readable. - The storage check is no longer sticky. While no storage model is known the driver reads the chain again every five minutes, and at once when model 160's length changes, so a battery fitted after start is found. Refs #260 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
frahlg
added a commit
that referenced
this pull request
Nov 22, 2026
…y again Review of #272: - With storage, PV power is now the sum of the MPPT blocks before the battery blocks, as evcc's fronius-gen24 template reads it. Fronius's map does not say whether model 113's DC power includes the battery input, so a 3 kW discharge could have shown as 3 kW of sun. Model 113's DC power is used only where there is no battery input, and PV is left out for a poll where the storage model is known but the battery blocks are not readable. - The storage check is no longer sticky. While no storage model is known the driver reads the chain again every five minutes, and at once when model 160's length changes, so a battery fitted after start is found. Refs #260 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
frahlg
added a commit
that referenced
this pull request
Nov 22, 2026
…y again Review of #272: - With storage, PV power is now the sum of the MPPT blocks before the battery blocks, as evcc's fronius-gen24 template reads it. Fronius's map does not say whether model 113's DC power includes the battery input, so a 3 kW discharge could have shown as 3 kW of sun. Model 113's DC power is used only where there is no battery input, and PV is left out for a poll where the storage model is known but the battery blocks are not readable. - The storage check is no longer sticky. While no storage model is known the driver reads the chain again every five minutes, and at once when model 160's length changes, so a battery fitted after start is found. Refs #260 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
….3.0) Earlier releases read model 124 at fixed addresses that assume a model 160 with two inputs. With storage, Fronius's model 160 has two more blocks for the battery, so those reads landed inside them. Battery power also came from the OutWRte / InWRte setpoints times WChaMax, not a measurement. The driver now reads model 160's header, finds model 124 right after it, and takes battery power from the StCha / StDisCha blocks (charge minus discharge, positive charging), voltage from the same blocks, and SoC from ChaState with its scale factor. Without model 124 it sends no battery. The float decoder works on the 16-bit halves, so floats keep their sign on 32-bit Lua, and NaN is left out instead of sent as 0. Failed PV reads are left out too; fronius leaves the invented-number baseline. Source: Fronius register map bundle 1.2.7-2 (GEN24 and Verto float maps with storage) and the GEN24 Modbus manual 42,0410,2649; evcc's fronius-gen24 template agrees. Not verified on hardware. Refs #260 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
…y again Review of #272: - With storage, PV power is now the sum of the MPPT blocks before the battery blocks, as evcc's fronius-gen24 template reads it. Fronius's map does not say whether model 113's DC power includes the battery input, so a 3 kW discharge could have shown as 3 kW of sun. Model 113's DC power is used only where there is no battery input, and PV is left out for a poll where the storage model is known but the battery blocks are not readable. - The storage check is no longer sticky. While no storage model is known the driver reads the chain again every five minutes, and at once when model 160's length changes, so a battery fitted after start is found. Refs #260 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
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 this does
froniusread battery power, voltage and SoC from addresses that do not match Fronius's GEN24 storage maps, and its float decoder flipped the sign of every float on 32-bit Lua. This PR reads the battery where Fronius's maps put it, fixes the decoder, and leaves out what did not answer. The driver isread_only; no command path changes.Source
Fronius register map bundle 1.2.7-2 (
www.fronius.com/QR-link/0024, already inupstream_docs): the GEN24 Primo/Symo and Verto float maps, with and without storage. Fronius GEN24 Modbus manual 42,0410,2649 (also inupstream_docs). evcc'sfronius-gen24template reads the battery the same way (checked for addresses and signs only; no code copied). Fronius numbers registers from 1; the wire address is one lower.Reads changed
On a GEN24 with storage the old battery reads landed inside model 160's battery blocks (40315 is the StCha name string, for example).
ferroamp_modbuswas fixed in feat(victron_mqtt, victron, ferroamp_modbus, zap): what the battery can do now #254. The old one compared the joined word with0x80000000, which is negative on 32-bit Lua, so every float came out negative there. FTW and Blixt L1 use 64-bit integers and were not affected. NaN and infinity now give nil instead of 0.froniusleavesinvented-number-baseline.json(10 to 0).Left alone
Tests
drivers/tests/test_fronius_storage_map.py, 28 cases, built from the float storage maps:26 of the 28 fail against
main. The two that pass, MPPT values and rated power, cover reads whose registers did not change.make test-driver ID=fronius: 173 passed, 24 skipped.make absent-register-report ID=fronius: every address settles.make check: 5299 passed, 928 skipped, on head 2d29914 (rebased ontomainafter fix(growatt): leave a failed read out instead of sending 0 (2.2.2) #273).Not verified on hardware. All values in the tests are synthetic. A field report from a GEN24 or Verto with a battery would confirm it: battery W, V and SoC next to Solar.web. The same report would show whether model 113's DC power includes the battery, which decides nothing now but would tell us if the MPPT sum is needed.
Refs #260
🤖 Generated with Claude Code