Skip to content

fix(drivers): expose device limits and measured control response - #149

Draft
frahlg wants to merge 3 commits into
mainfrom
feat/control-feedback
Draft

frahlg wants to merge 3 commits into
mainfrom
feat/control-feedback

Conversation

@frahlg

@frahlg frahlg commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

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 aa9099e9b985cbfb657c53576a12a5778910a75a to 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.

Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T07:50:40.436938Z 405ca9a PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread drivers/lua/pixii.lua
local battery = {
w = bat_w,
setpoint_w = setpoint_pixii_w and -setpoint_pixii_w,
control_power_w = acw_regs and ac_w,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread drivers/lua/pixii.lua
Comment on lines +477 to +478
control_power_w = acw_regs and ac_w,
control_power_available = acw_regs ~= nil,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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>
@frahlg
frahlg marked this pull request as draft September 29, 2026 11:40
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant