← all branches

feat/powerradar

safeviewing older commit
6ed65b4 · incrementalPR #327reviewed 2026-07-22 00:00 UTC0H · 1M · 3L · 1I
The branch
Purpose
Add an automatic, API-based PowerRadar (Centrica / Panoramic Power) metrics integration — a headless pull worker on the portal's internal /eigw energy-insights-gateway API — replacing the manual-CSV path with native 5/15/60-min collection on the existing Site Collection SFN.
Goal
New integration code powerradar-api is a second access path to the powerradar brand (the CSV worker stays the deep-history fallback), exactly like shelly-cloud → shelly-fleet. Auth is fully headless (Spring OAuth2 broker password grant, no MFA, no browser).
Sub-goals
  • SG-1: Auth + transport engine + live probe ✓
  • SG-2: Manifest + catalog + provider registration ✓
  • SG-3: Pure chart-to-batu translation + tests ✓
  • SG-4: Metrics handler (§9) + tests ✓
  • SG-5: CDK stack + wiring ✓
  • SG-6: Live worker e2e ✓
  • SG-7: Framework fold-back + docs ✓
The changes (whole branch)
What
This incremental commit (6ed65b4) tightens documentation only: updates the granularity JSDoc in the powerradar-api manifest and the CLAUDE.md caveats section to document a full bill-reconciliation result showing that 1h under-bills GDMTH demand ~3% vs the true CFE 15-min peak, confirming 15m as the correct default provisioning cadence.
Why
The previous wording said '15m recommended' without quantified evidence. A full reconciliation vs the legacy prod-ddb-simulated-bills (6 months, Energía Real ALBOA /14/56/51) confirmed the 15m default is load-bearing for accurate CFE demand billing — documenting it with the reconciliation numbers makes the decision auditable.
Areas
services/metrics/integrations/powerradar-api+15930infra/cdk+1932packages/integration-manifests+1090packages/database+170
Blast
24 files, +2200/-317 across new worker package (services/metrics), CDK infra, integration manifests, and database seed; this commit touches only 2 doc files (+31/-13).
docs-only commit billing-critical documentation empirical reconciliation numbers from live prod data
ci· no CI check data available at review timecoderabbit· no .coderabbit.yaml in repo

Findings · 5

conventions2

low

CLAUDE.md specialist file approaching length guideline (~30 lines)

services/metrics/integrations/CLAUDE.md:374

The bill-reconciliation bullet added here is ~12 lines of dense prose. Content is justified (non-derivable empirical data) but consider whether the May distribution_kw nuance and 0.57/THOR provenance could live in the linked [[project_powerradar_api_integration]] Notion page to keep the CLAUDE.md focused on load-bearing caveats only.

info

Manifest JSDoc block now substantially longer than sibling manifests

packages/integration-manifests/src/manifests/powerradar-api.ts:32

The granularity paragraph grew from ~9 to ~18 lines. Dense detail is appropriate for integration manifests, but reviewers should verify consistency with sibling manifests (egauge.ts, victron.ts) to avoid this file becoming an IDE-hover outlier.

improvement3

medium

distribution_kw rolling-annual nuance is unactionable as written

services/metrics/integrations/CLAUDE.md:390

The parenthetical '(but note May's looked like a rolling-annual max, a smaller-charge nuance)' records an observation without a conclusion. A future operator can't act on it: is this a known CFE tariff behavior they should account for, a data anomaly to investigate, or a reconciliation artifact to ignore? Either document the implication or drop the note until there's an actionable rule.

low

5m chunking constraint mentioned but not quantified

packages/integration-manifests/src/manifests/powerradar-api.ts:47

Both the JSDoc and CLAUDE.md mention 'vendor 400s on a full-month 5m span — chunk it' but neither gives the safe window size (e.g. '≤7 days' or '≤N points'). An engineer reaching for 5m will hit the same 400 and rediscover the limit. The empirical cap should be here.

low

JSDoc missing back-reference to reconciliation record

packages/integration-manifests/src/manifests/powerradar-api.ts:34

The CLAUDE.md closes with 'See [[project_powerradar_api_integration]]' but the JSDoc block has no such pointer. Readers of the manifest hover in IDE have no path to the deeper reconciliation record. Adding a one-liner 'See [[project_powerradar_api_integration]] for full reconciliation.' at the end of the JSDoc would make it symmetric.

History · 15 commits

  1. f34e4ceneeds attentionincremental0H · 1M · 3L2026-07-23 00:32
  2. 1bc8aedneeds attentionincremental0H · 2M · 3L2026-07-22 21:34
  3. 31e63bbneeds attentionincremental0H · 2M · 5L2026-07-22 20:53
  4. 482cb88safeincremental0H · 0M · 1L2026-07-22 17:56
  5. 9a73b79safeincremental0H · 0M · 0L2026-07-22 17:34
  6. 87f8298needs attentionincremental0H · 1M · 3L2026-07-22 16:59
  7. 1e80096safeincremental0H · 0M · 1L2026-07-22 16:42
  8. 6ed65b4safeincremental0H · 1M · 3L2026-07-22 00:00current
  9. 74a1131needs attentionfull0H · 7M · 12L2026-07-21 19:06
  10. 563252bneeds attentionincremental4H · 9M · 8L2026-07-21 18:32
  11. beced58needs attentionincremental0H · 3M · 3L2026-07-21 01:13
  12. 7fa8684needs attentionincremental4H · 9M · 7L2026-07-20 22:56
  13. 230784fneeds attentionfull2H · 11M · 14L2026-07-10 00:15
  14. b876b54needs attentionincremental2H · 2M · 5L2026-07-08 04:44
  15. ec4847fneeds attentionfull2H · 11M · 8L2026-07-08 03:32