Conversation
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Codex Review SummaryThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 405ca9a927
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| local battery = { | ||
| w = bat_w, | ||
| setpoint_w = setpoint_pixii_w and -setpoint_pixii_w, | ||
| control_power_w = acw_regs and ac_w, |
There was a problem hiding this comment.
Convert Pixii AC feedback to site signs
When the battery discharges, register 40083 is the SunSpec inverter AC-power value, whose positive direction is inverter output; other Model 103 consumers such as drivers/lua/solaredge_pv.lua:203-243 negate this register before emitting the repository's site sign. Passing ac_w through here therefore reverses command feedback in both charge and discharge, so Core will compare a site-signed setpoint with an oppositely signed response. Emit -ac_w and test both power directions.
AGENTS.md reference: AGENTS.md:L71-L73
Useful? React with 👍 / 👎.
| control_power_w = acw_regs and ac_w, | ||
| control_power_available = acw_regs ~= nil, |
There was a problem hiding this comment.
Require a valid scale factor for AC feedback
If the separate read of register 40084 fails while 40083 succeeds, read_sf silently substitutes scale factor zero, yet this code reports the resulting raw register value as available control power. A transient failure can therefore make Core treat a value that is off by the device's power multiplier as fresh command feedback; availability should require successful reads of both the value and its scale factor, preferably from one block read.
AGENTS.md reference: AGENTS.md:L17-L20
Useful? React with 👍 / 👎.
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
An Easee charger can cap charging at 8 A while FTW asks for 16 A. Pixii can accept a write and report a different setpoint on a later poll. These changes expose those facts during normal operation.
Pixii 2.1.7 reads the setpoint outside troubleshooting mode and reports AC power separately from its DC battery reading. Easee Cloud 1.3.6 reports its static current ceiling and age separately from the dynamic current offer. It also keeps the source timestamp for control evidence when a cloud poll repeats an old power observation. Missing power or source time cannot confirm a command's effect.
Sungrow 1.5.10 reports the active forced setpoint from its existing holding-register read and identifies the separate physical meter on known hybrid models. Failed meter/PV reads cannot supply control evidence. No extra Modbus calls.
A failed settings read does not refresh the limit's age. The optional settings read follows power telemetry and the existing phase-reset recovery. Existing polling cadence and write/control policy stay unchanged.
Paired with srcfl/ftw#1474 and srcfl/ftw-webapp#75. Core pins
aa9099e9b985cbfb657c53576a12a5778910a75ato carry these versions.Validation: full
make check(4,753 passed, 913 skipped); focused Pixii/Easee checks (142 passed, 28 skipped), including missing readback, AC/DC separation, an 8 A ceiling, stale settings and repeated cloud source timestamps. Sungrow-specific checks: 87 passed, four skipped. A private ARM64 box run confirmed the Sungrow setpoint readback and fresh measured power. A successful physical Tier 2 trace and Pixii hardware checks remain; keep draft. Existing Heishamon PRs #60 and #66 remain untouched; their catalog rows and changelog sections are separate.