Skip to content

fix(pixii): retain calibration fault while charge status is unknown - #147

Merged
frahlg merged 1 commit into
mainfrom
fix/pixii-unknown-charge-status
Sep 28, 2026
Merged

frahlg merged 1 commit into
mainfrom
fix/pixii-unknown-charge-status

Conversation

@frahlg

@frahlg frahlg commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Problem and result

Pixii's SunSpec charge status can return 0xffff (unsupported). The driver treated every readable value except TESTING (7) as proof that calibration had ended. A TESTING → unsupported/unknown transition therefore cleared the device fault and allowed Core to rely on the battery again without evidence of recovery.

Pixii 2.1.5 reports unsupported status as unknown, omits unsupported numeric status fields, and retains a known calibration fault until a recognized non-testing charge status arrives. Unknown status at startup does not establish calibration and does not create a new fault. A warning records changes to unknown charge status without repeating it every poll. Battery and meter telemetry remain available.

Scope and safety

Companion Core fix: srcfl/ftw#1468 makes planner and dispatch power limits agree. The fixes can be reviewed independently.

Verification

  • New tests failed against 2.1.4 for unsupported status and for TESTING → 0xffff, 99 and 0.
  • make test-driver ID=pixii: 103 passed, 13 skipped.
  • make check: 4742 passed, 913 skipped; manifests, catalog generation, sandbox and host API checks passed.
  • Tests cover missing reads, recognized recovery states, valid remote-mode code 0, telemetry continuity and bounded warnings.
  • No hardware test. Exact installed model/firmware and physical response are unverified. This stays draft until the hardware check required by CONTRIBUTING.md is done. This change does not claim to explain a site's low output.

Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@frahlg
frahlg marked this pull request as ready for review September 28, 2026 18:28
@frahlg
frahlg merged commit f4e6060 into main Sep 28, 2026
5 checks passed
@frahlg
frahlg deleted the fix/pixii-unknown-charge-status branch September 28, 2026 18:28
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 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-28T18:30:50.391743Z 19b7de7 Draft marked ready
ℹ️ 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: 19b7de7b85

ℹ️ 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
Comment on lines +158 to +161
-- SunSpec enum16/uint16 uses 0xffff for an unsupported value.
local function read_status_u16(addr)
local regs = probe_read(addr, 1, "holding")
if regs then return regs[1] end
if regs and regs[1] ~= 0xffff then return regs[1] end

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Record the status specifications in upstream_docs

This new sentinel and enum interpretation is explicitly decoded from the SunSpec Device Information Model and model 802, but manifests/pixii.yaml still has no upstream_docs entry. As a result, the weekly watcher cannot alert maintainers if either specification changes or disappears; add the durable source URLs already identified for this change to the manifest.

AGENTS.md reference: AGENTS.md:L76-L82

Useful? React with 👍 / 👎.

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