Skip to content

fix(pixii): preserve measured AC power sign - #155

Merged
frahlg merged 8 commits into
srcfl:mainfrom
segran2:fix/pixii-control-power-sign
Oct 3, 2026
Merged

frahlg merged 8 commits into
srcfl:mainfrom
segran2:fix/pixii-control-power-sign

Conversation

@segran2

@segran2 segran2 commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #154.

Problem

Pixii register 40083 (measured AC power) already follows FTW site signs on the reported PowerShaper hardware: charging is positive and discharging is negative. The driver inverted that value as if it used the same generator-frame convention as the setpoint. During discharge, for example, -1231 W became +1231 W and Core could report power_wrong_direction.

Change

  • preserve the sign of measured AC power for control_power_w
  • leave setpoint/command sign conversion unchanged
  • add regression coverage for both negative discharge and positive charge feedback
  • bump Pixii from 2.1.7 to 2.1.8 and refresh catalog metadata
  • update the changelog

Evidence

Issue #154 contains PowerShaper site telemetry showing battery_ac_w = -1231 W while the battery was physically discharging. That matches the repository contract: battery discharge is negative.

Validation

The existing Pixii status test now asserts both directions:

  • -1400 W measured AC -> -1400 W control_power_w
  • +1400 W measured AC -> +1400 W control_power_w

GitHub CI should run the repository checks for this PR. No command, heartbeat, calibration or safety-policy behavior is changed.

Paired Core update: srcfl/ftw#1504. Core bundles Pixii 2.1.8 and tests measured power and command feedback in both directions.

Signed-off-by: Göran Andersson <268038031+segran2@users.noreply.github.com>
Signed-off-by: Göran Andersson <268038031+segran2@users.noreply.github.com>
Signed-off-by: Göran Andersson <268038031+segran2@users.noreply.github.com>
Signed-off-by: Göran Andersson <268038031+segran2@users.noreply.github.com>
Signed-off-by: Göran Andersson <268038031+segran2@users.noreply.github.com>
Signed-off-by: Göran Andersson <268038031+segran2@users.noreply.github.com>
Signed-off-by: Göran Andersson <268038031+segran2@users.noreply.github.com>
Signed-off-by: Göran Andersson <268038031+segran2@users.noreply.github.com>

segran2 commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

Hardware validation

Tested this PR on a real Pixii Home system using the Pixii 2.1.8 driver from commit 1d3babb02d81f2ba3e47cdc864a5b1ff1b1a0818 as an FTW user-driver.

Both power directions were verified through FTW Core's measured control_feedback.

Charging

requested_w  +5625.58 W
sent_w       +5625.58 W
readback_w   +5626 W
actual_w     +5661 W
evidence     measured
readings_fresh true

The driver status at the same time also reported positive battery power (bat_w ≈ +5154 W).

Discharging

requested_w  -1504.74 W
sent_w       -1504.74 W
readback_w   -1505 W
actual_w     -1501 W
status       following
reason       power_observed
evidence     measured
readings_fresh true

The driver status at the same time reported bat_w ≈ -1598 W.

This confirms on hardware that measured command feedback now preserves FTW site signs in both directions: charging is positive and discharging is negative. Command/setpoint conversion also remains correct. No power_wrong_direction was observed during these tests.

segran2 commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

Origin of the regression

I traced the sign regression to commit 424f1e5c75e4cf4d9ada3ca016c6cba5c428e893, merged via #149 on 2026-10-01.

That change introduced the assumption that Pixii AC power register 40083 uses the same SunSpec generator-frame sign convention as the setpoint, and therefore negated it for control_power_w. The commit message explicitly noted that the sign had not yet been hardware-verified.

Hardware validation on a Pixii PowerShaper now shows that register 40083 already uses FTW site signs:

  • charging: positive
  • discharging: negative

Observed discharge validation:

  • requested: -1504.7 W
  • readback: -1505 W
  • measured actual: -1501 W
  • FTW control status: following / power_observed

Charging was also validated with positive measured power. This confirms that control_power_w must preserve ac_w rather than negate it.

The originating commit is authored/signed off by Fredrik Ahlgren and also credits Claude Opus 5.5 as co-author.

@frahlg
frahlg merged commit 7c3440c into srcfl:main Oct 3, 2026
5 checks passed
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.

Pixii: AC power sign inversion causes false power_wrong_direction during discharge

2 participants