fix(pixii): preserve measured AC power sign - #155
Conversation
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>
Hardware validationTested this PR on a real Pixii Home system using the Pixii 2.1.8 driver from commit Both power directions were verified through FTW Core's measured ChargingThe driver status at the same time also reported positive battery power ( DischargingThe driver status at the same time reported 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 |
Origin of the regressionI 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 Hardware validation on a Pixii PowerShaper now shows that register 40083 already uses FTW site signs:
Observed discharge validation:
Charging was also validated with positive measured power. This confirms that The originating commit is authored/signed off by Fredrik Ahlgren and also credits Claude Opus 5.5 as co-author. |
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
control_power_wEvidence
Issue #154 contains PowerShaper site telemetry showing
battery_ac_w = -1231 Wwhile the battery was physically discharging. That matches the repository contract: battery discharge is negative.Validation
The existing Pixii status test now asserts both directions:
control_power_wcontrol_power_wGitHub 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.