Skip to content

Zero stale optimizer readings when panels stop reporting at night#18

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/investigate-tigo-data-freeze-issue
Draft

Zero stale optimizer readings when panels stop reporting at night#18
Copilot wants to merge 3 commits into
mainfrom
copilot/investigate-tigo-data-freeze-issue

Conversation

Copilot AI commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

When optimizers sleep at sunset they stop emitting power reports, so the coordinator's last PowerReportEvent stays in data["nodes"][barcode] and sensors show frozen daytime power/voltage/current all night.

Changes

  • Stale-data timer (coordinator.py) — added _schedule_stale_check/_perform_stale_check, scheduled and cancelled alongside the existing midnight-reset timer. Every STALE_CHECK_INTERVAL_SECONDS (30s) it inspects each node's last_update; nodes silent longer than STALE_DATA_TIMEOUT_SECONDS (120s, aligned with ENERGY_GAP_THRESHOLD_SECONDS) get their instantaneous values zeroed and a coordinator update pushed.
  • Zeroed fields (const.py STALE_ZERO_KEYS) — power, performance, voltage_in/out, current_in/out, dc_dc_duty_cycle.
  • Preserved — cumulative meters (daily_energy_wh, total_energy_wh, readings_today) and diagnostics (temperature, rssi); zeroing 0 °C / 0 dBm would be misleading rather than helpful.
  • Tests — 6 cases covering zeroing, fresh-node no-op, already-zero no-op, missing/None last_update skip, reschedule, and stop-cancel.
  • Docs — README feature bullet + CHANGELOG entry.

Updates are idempotent: nodes already at zero, recently reporting, or lacking a last_update produce no coordinator update.

Notes for review

  • 120s is a deliberate balance — long enough to ignore transient daytime gaps, short enough to reflect sleep promptly. Could be made configurable via the options flow later (see planning/future_considerations.md item 8).
  • Aggregate string/installation sensors recompute automatically from the zeroed node values via the pushed update.

Copilot AI linked an issue Jun 4, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Investigate Tigo data freezing during night hours Zero stale optimizer readings when panels stop reporting at night Jun 4, 2026
Copilot finished work on behalf of azebro June 4, 2026 17:12
Copilot AI requested a review from azebro June 4, 2026 17:12
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.

Tigo data during night frozen to last active state

2 participants