Skip to content

fix(telemetry): dark offline PV counts as 0 W so live load stays known - #1767

Closed
frahlg-agents[bot] wants to merge 1 commit into
masterfrom
fix/offline-pv-keeps-load
Closed

frahlg-agents[bot] wants to merge 1 commit into
masterfrom
fix/offline-pv-keeps-load

Conversation

@frahlg-agents

@frahlg-agents frahlg-agents Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Reported by Anders (Growatt PV + Pixii meter/battery, v0.154.1): after sunset Growatt goes offline and /api/status shows pv_w:null, load_w:null, history_reason:"offline:Growatt:pv" although Pixii still reports the site meter.

Root cause — measurementLocked (go/internal/telemetry/forecast.go) fails the whole balance (Valid=false) whenever any expected flow's driver is !TelemetryLive() (reason = "offline:"). qualifyStatusHistory then nulls load_w (MissingLoad) and pv_w (MissingPV).

Fix (live path only, alignSources == false): a PV source that is offline or stale and whose last reading was within ±50 W (PVDarkThresholdW) is counted as 0 W. The source is marked AssumedZero, the reading gets PVAssumedZero; Known[DerPV] and PVValid stay false so history and PV forecast training do not record an assumed value as measured. /api/status shows pv_w: 0 and the load from meter + battery.

Unchanged: PV that drops out while producing (last reading > 50 W) still fails as offline:…:pv; a missing site meter still nulls load; a PV driver with no reading ever (missing:) still fails; forecast/history alignment paths unchanged.

Tests: new cases in telemetry/live_measurement_test.go and api/api_history_quality_test.go. go test green for telemetry, api, ha, state, cmd/ftw. Locally internal/drivers fails only because the bundled driver catalog is not checked out in my worktree (unrelated).

Open questions: should the night check use internal/sunpos (sun below horizon) instead of / in addition to the last-reading heuristic? Is 50 W the right threshold?

@frahlg-agents

frahlg-agents Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favour of #1768, which restores live Home use from the site meter with quality tracked separately (no 50 W heuristic).

@frahlg-agents frahlg-agents Bot closed this Oct 21, 2026
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.

0 participants