Skip to content

fix(battery): explain calibration and suspend manual control - #2017

Open
segran2 wants to merge 3 commits into
srcfl:masterfrom
segran2:fix/pixii-calibration-status
Open

segran2 wants to merge 3 commits into
srcfl:masterfrom
segran2:fix/pixii-calibration-status

Conversation

@segran2

@segran2 segran2 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

When Pixii calibrates its batteries, it can continue to charge while the FTW setpoint remains at 0 W. This is normal device-managed operation. Show Calibrating under Are we in control?, keep measurements live, and suspend power dispatch and planning for the calibrating battery.

Disable Install hold for that battery and explain why. Reject the same scoped request at the API. An all-batteries override can still apply to other eligible batteries.

The Pixii driver change is in srcfl/device-drivers#228. The bundled driver pin can follow once that change lands.

Validation

  • On a Raspberry Pi with the local Core and driver patches, Pixii reported Modbus running-service code 116. FTW reported an informational calibration state with fresh telemetry and issued no further Pixii power commands after detection.
  • The scoped-hold API regression test verifies that a calibrating battery rejects a hold and is surfaced in the manual-hold status. The control-feedback test verifies that clearing calibration makes the battery eligible for control again.
  • The Pi journal shows zero Pixii power setpoints from 01:24:42 until the calibration exit at 03:00:11 CET on 15 November 2026. The same FTW process resumed dispatch automatically and issued a 463 W charge setpoint via Modbus at 03:00:12, followed by an idle setpoint at 03:00:17. A later live API check showed calibration cleared, fresh battery telemetry and no active manual hold. This verifies that Core resumed writing setpoints. The brief 463 W request was not independently verified as delivered power.
  • All 927 web tests and make verify passed locally. GitHub's web, Go, race and full-stack jobs passed on the updated PR head.

@miravoss26 miravoss26 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Adds a device-managed calibration state: new set_calibrating host call, DriverHealth.Calibrating, dispatch/planning suspended for that battery, scoped manual hold rejected with 409 (and the UI disables Install hold). Tests cover the API rejection and the feedback state. Security screen: nothing found (no new deps, hosts, secrets or authz changes).

  • IsOnline() now returns false while calibrating. Fine for dispatch, but every other consumer of IsOnline (health endpoint, driver inventory, support report, any offline alerting) will now read a calibrating battery as offline. The new test asserts this on purpose; worth a quick grep that nothing pages on it.
  • The flag has no timeout. If a driver sets set_calibrating(true) and then stops calling (crash, bad poll), control stays suspended until stale-status logic marks it offline anyway. Probably acceptable, but say so if intended.
  • battery_calibrating is added to controlVerificationLost's exclusion list, good: no false 'lost control' during calibration.

Safe to merge from my read, with the first point as a check rather than a blocker.

@segran2

segran2 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

A battery under calibration is unavailable for control. The device manages its own charge and discharge during calibration, and FTW setpoints or manual holds could interrupt that process. The battery can still report telemetry, but planning and dispatch must exclude it from controllable capacity until the device reports that calibration is complete.

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.

2 participants