Repository navigation
Conversation
A Pixii can stop charging below 100 %. On one site its SoC held at 90 while Core kept planning and ordering charge to 95 %, and the Pixii app showed 100 % (#175). Pixii's Modbus mapping (U8022_06ENG rev 2.20) gives the SoC register as a percentage and names the upper limits on the same scale: SoCMax (40128), SoCRsvMax (40130) and the maximum SoC safety limit (39917, per mille, where "regulation will stop"). The driver reports the lowest valid one as max_soc_fract, the `@srcful/data-models` name for a battery's own maximum SoC. The SoC stays as read: the document does not say how the Pixii app maps it to 100 %. Every limit, the lower ones and the gross SoC go to history so a field check can show which one holds. Refs #175 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
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. |
6 tasks done
Review findings: - 39917 is a gross safety limit in tenths of a percent, and Pixii does not document how gross relates to the SoC at 40132. max_soc_fract now comes only from SoCMax (40128) and SoCRsvMax (40130), which share the SoC's scale factor. 39915-39917 stay in history. - A limit below 50 % is taken as a misread and left out. Real ceilings sit around 80-100 %, and Core applies the same bound. - read_sf treats 0x8000, SunSpec's unimplemented scale factor, as no scaling. Read as -32768 it scaled the SoC and every limit to zero. Refs #175 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
This branch has not been deployed
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.
Summary
Refs #175
A Pixii Home 20 kWh shows 90 % in FTW and 100 % in the Pixii app, and does not take charge orders at 90 %. FTW kept planning "90 → 95 %, 1.0 kWh" and ordering charge the battery never took.
What Pixii's own Modbus mapping says (U8022_06ENG rev 2.20, the same document #228 cites):
SoCis "State of charge in %", scaled bySoC_SF(40177). Nothing in the document puts it on another scale.SoCMax, 40129SoCMin, 40130SoCRsvMax("maximum reserved state of charge") and 40131SoCRsvMinare all marked in use and all useSoC_SF: the same scale as the SoC.So the evidence points to a configured charge ceiling on the SoC's own scale, not a different SoC scale. This PR reports that ceiling and does not remap the SoC.
Change (pixii 2.2.0).
SoCMaxandSoCRsvMaxasmax_soc_fracton the battery. Only these two share the SoC's scale. A value below 50 %, above 100 % or0xffff, or a failed read, gives no ceiling and the key is left out. Real ceilings sit around 80–100 %; Core applies the same 50 % bound.battery_soc_max_pct,battery_soc_reserve_max_pct,battery_soc_min_pct,battery_soc_reserve_min_pct,battery_soc_gross_pct,battery_soc_safety_min_pct,battery_soc_safety_max_pct). The driver logs the ceiling and the register it came from when it changes.read_sfnow treats0x8000, SunSpec's unimplemented scale factor, as no scaling. Read as −32768 it scaled the SoC and every limit to zero.max_soc_fractis the@srcful/data-modelsname for a battery's own maximum SoC (battery metadata there; FTW has no metadata channel, so it rides on the reading).docs/WRITING-A-DRIVER.mdgains a short section, andtest_emit_fields.pyallows the key.Paired Core PR: srcfl/ftw#2083. It plans and dispatches to the lower of the configured ceiling and this one, holds it across a missed read for up to 10 minutes, and ignores one below 50 % or at or below the SoC floor. An older Core ignores the key.
Driver evidence
pixii2.2.0upstream_docs); SunSpec model 802Field check still needed
On the #175 site, with driver 2.2.0:
battery_soc_max_pct) and 40130 (battery_soc_reserve_max_pct) reads 90, and the log linePixii: charge ceiling … from …. If neither does, the ceiling is elsewhere and this PR does not fix the site.battery_soc_reserve_min_pct,battery_soc_min_pct), the gross values (39915–39917) and the app's figure at a second charge level. That shows how the app maps to 100 %. Nothing here depends on it, and no remap should be added without it.Relation to #228
#228 (calibration via
StVnd116, pixii 2.1.10) has right of way onpixii.lua. This branch is cut frommainand keeps clear of #228's lines: the new code sits afteremit_troubleshooting_metrics, plus two lines indriver_polland one inread_sf. Agit merge-treeagainst #228's head conflicts inpixii.luaonly on theversionline, plus the generated catalog files (index.yaml,devices.yaml, support status,CHANGELOG.md, manifest).Whichever PR merges second takes the next version number above the first (2.2.0 here, 2.1.10 in #228) and regenerates the catalog files. Both add the same Pixii PDF to
upstream_docs; keep one entry.Safety
Control evidence
Not applicable: no control path changes.
Checks
Signed-off-by.make test-driver ID=pixii: 139 passed, 13 skipped.make check: 5443 passed, 928 skipped.New tests in
drivers/tests/test_pixii_charge_ceiling.py, ten cases:0x8000) no longer zeroes the SoC;Six fail against
main; the four invalid-value cases pass there by design.🤖 Generated with Claude Code