Repository navigation
Pixii: AC power sign inversion causes false power_wrong_direction during discharge #154
Description
Problem
On a Pixii Home site, the battery is discharging and both its DC reading and the raw inverter AC metric are negative. The Pixii driver negates the AC reading when emitting control_power_w, so FTW's control feedback reports charging and raises not_following / power_wrong_direction while the power-flow view shows discharge.
The sent command and setpoint readback agree on discharge. This report concerns measurement normalization, not the command's sign conversion.
Environment
- Hardware: Pixii Home, 15 kWh; firmware version not collected.
- FTW: local test release
v0.139.0-beta.9004, based on officialv0.139.0-beta.1. - Bundled Pixii source:
DRIVER.version = "2.1.7". - Bundled driver repository pin:
srcfl/device-drivers@424f1e5c75e4cf4d9ada3ca016c6cba5c428e893. - Operating mode:
planner_arbitrage. - The local test changes concern EV SoC/charging UI and provenance. Pixii driver contents are identical in local test1 and test4. The same AC-negation line is also present on this repository's current default branch.
Observed evidence
Two successive live API samples, supplied by the site owner on 2026-10-02; these are not a single synchronized capture.
Control feedback, around 19:33 CEST
From GET /api/status:
{
"driver": "pixii",
"kind": "battery",
"mode": "planner_arbitrage",
"status": "not_following",
"reason": "power_wrong_direction",
"readings_fresh": true,
"site_confirmation": "independent_source_unknown",
"site_meter": "pixii",
"requested_w": -1236.5655136028975,
"sent_w": -1236.5655136028975,
"readback_w": -1244,
"actual_w": 1242,
"battery_soc": 0.585
}The UI said: “Asked for 1.2 kW discharge, but it is charging 1.2 kW.”
Raw readings and diagnostic metric, 19:34:00.888 CEST
From GET /api/drivers/pixii:
{
"readings": [
{"type": "meter", "raw_w": -114.92, "stale": false},
{"type": "battery", "raw_w": -1334, "soc": 0.5830000000000001, "stale": false}
],
"metrics": [
{
"name": "battery_ac_w",
"value": -1231,
"updated_at": "2026-10-02T19:34:00.888919886+02:00"
}
]
}The flow view also showed discharge, household consumption and approximately 0.11 kW grid export. Battery SoC decreased between the samples, consistent with discharge.
Suspected cause
In drivers/lua/pixii.lua, the inverter AC power is read from holding register 40083, with scale factor 40084. The metric preserves that reading, but the control observation reverses it:
control_power_w = acw_regs and -ac_w,
-- ...
host.emit_metric("battery_ac_w", ac_w)For the reported hardware, ac_w = -1231 becomes a positive control measurement, although the DC battery reading is also negative. FTW Core prefers control_power_w over the normal battery w when classifying control feedback, explaining the conflicting views.
Expected behavior
A genuine discharge should remain negative under FTW's convention (+ charging, − discharging). Feedback should compare the negative AC measurement with the negative sent setpoint rather than flag the opposite direction.
Reproduction
- Observe a Pixii during normal FTW planner-driven discharge.
- Compare
control_feedbackin/api/statuswith battery readings andbattery_ac_win/api/drivers/pixii. - If the raw AC metric and battery DC reading are both negative, check whether feedback's
actual_wis positive and the UI reports charging.
Fix considerations
For this observed register convention, preserving the AC sign (control_power_w = acw_regs and ac_w) would make the measurement consistent with the discharge evidence. Please verify charging as well as discharge, and check other supported Pixii models/firmware before adopting a universal convention or a documented model-specific normalization.
Keep the existing command/setpoint conversions separate: the discharge command and its readback already agree. Add regression coverage for positive charging and negative discharging AC measurements, and correct the generator-frame comment if it does not apply to this hardware.
This report does not establish independent site confirmation: the grid meter and battery share the Pixii source, as the API explicitly notes. No driver fix has been applied on the reporting site.
Activity
segran2 commentedon Oct 3, 2026