One dashboard per role
Four tabs on the home page, for the asset manager, the PV engineer, operations and the executive, each built around the decisions that person makes. The assumptions behind each are written down on the Who it's for page.
- Why
- The same data answers different questions depending on who's asking, and each question has its own grain and freshness: an executive needs six numbers by morning, an engineer needs every string. Splitting the views lets each one query only what it needs, so the light views stay fast while the heavy one scans raw data.
- Trade-off
- Four views to keep consistent instead of one. People who wear two hats switch tabs. The roles are assumptions until they're tested with real users.
Precompute what executives read
ClickHouse refreshable materialized views run the executive queries every morning at 09:00 UTC (05:00 in Toronto) and on the 1st of each month, and write a few dozen rows into small tables. The executive tab reads only those, and shows when they were computed.
- Why
- Executives open it first thing, often on a phone, and nothing they decide changes by the hour. The morning run reads millions of rows once so every page view reads tens. The database runs the schedule itself: no cron job or worker to deploy, and a refresh swaps the table atomically, so nobody sees half a snapshot. Month closes are kept, so the number reported to the board doesn't move.
- Trade-off
- The view is up to a day old, by design. A refresh that fails leaves yesterday's numbers in place (the computed-at time shows it). The schedule is in UTC, so the run lands at 04:00 in Toronto in winter.
A budget from the same model
Report the executive view against a P50 budget: the fault-free physics model run over 15 simulated weather years, less a 2% allowance, for every site and local day.
- Why
- Executives compare against budget, not the model. Building the budget from the same physics means the gap splits cleanly in two: budget to expected is the weather, expected to actual is operations. The bridge on the executive tab balances to the dollar.
- Trade-off
- A real budget comes from a pre-construction yield study (PVsyst or similar) with decades of satellite weather, not 15 synthetic years.
ClickHouse for telemetry
Store every reading in a columnar database, sorted by site, then device, then time, in monthly partitions.
- Why
- Dashboards scan a few columns across millions of rows. Column codecs keep a string reading to about 2 bytes, and the site-first sort key lets a one-site query skip the rest of the table (a test checks this with EXPLAIN).
- Trade-off
- It's not for transactional data like users or settings; those would live in Postgres beside it. Updates are expensive, so the data model is append-only.
Roll up on insert, by local day
A materialized view sums each site's energy and losses per local calendar day as data arrives.
- Why
- Summaries read hundreds of rollup rows instead of tens of millions of readings, in about 10 ms. Using the site's own day, not UTC, keeps a western site's evening on the right date.
- Trade-off
- A second copy of the numbers that must stay consistent. A test asserts the rollup equals aggregating the raw rows.
GraphQL with a code-first schema
Pothos builds the schema from TypeScript; GraphQL Yoga serves it at /api/graphql.
- Why
- The data is naturally nested (fleet → site → inverter → string) and each screen needs a different slice. Types flow from the SQL rows through the resolvers to the pages.
- Trade-off
- The N+1 query trap: fixed with DataLoader, and a test proves a deep query costs the same 5 SQL queries for one site or all of them. HTTP caching is harder than with REST.
Pages query GraphQL in-process
Server components execute the schema directly instead of calling the HTTP endpoint or shipping a data client to the browser.
- Why
- No network hop and no client-side fetching code, while pages still go through the same resolvers, batching and limits as the public API.
- Trade-off
- Pages render per request rather than being cached as static files. At this data size that costs tens of milliseconds.
A synthetic fleet with an answer key
Generate the data, including planted faults, and keep the true cost of every fault in separate truth_ tables.
- Why
- Real plant data can't be published. With an answer key, tests can measure the loss analysis: within 8% of the truth fleet-wide for every cause, under 0.2% of energy blamed on faults that don't exist, and a drifting sensor never mistaken for soiling.
- Trade-off
- The physics is deliberately simple (clear-sky irradiance with clouds). It isn't a full 3D, physics-based performance model, and doesn't pretend to be.
Every kWh of the gap is accounted for
Attribute losses in a fixed order (outage, curtailment, soiling, offline strings, degraded strings) and keep a residual.
- Why
- Expected − actual = losses + residual holds exactly for every record, so totals always reconcile. Data gaps are reported as unmeasured, never as loss.
- Trade-off
- When faults overlap, the order decides which one gets the credit.
Judge strings against their siblings
Flag a string when its output per kW falls below 93% of the median of its siblings on the same inverter.
- Why
- Siblings share weather, soiling, clipping and curtailment, so comparing them cancels all of that. It runs in SQL alone, straight on the raw readings.
- Trade-off
- A string fault is invisible while its whole inverter is down, because every sibling reads zero. The inverter-level analysis catches the outage instead.
Accessibility over the draft palette
Start from a navy-and-purple palette, and change any pairing that fails WCAG 2.2 AA.
- Why
- The draft's 30% grey labels measured 1.9:1, and purple focus rings on navy 2.1:1. Both were changed to the nearest passing value in the same palette.
- Trade-off
- Labels are a little heavier than the draft. The Storybook audit shows each change side by side with the measured ratios.
Charts drawn by hand, each with a table
Small SVG charts with a validated palette, a keyboard-operable tooltip, and a table view of every value.
- Why
- No charting library to ship. Colours are checked by a validator rather than by eye, and no value is reachable only by hovering.
- Trade-off
- Fewer chart types than a library offers. The map is the exception, because it needs pan, zoom and picking on WebGL.
Washing is a payback decision
Wash when the soiling it removes, before the next heavy rain or scheduled wash, is worth more than the wash. Count the dust still to come, from the station's build-up rate. Review every scheduled wash due in the next two weeks the same way, and say when to skip it.
- Why
- Washing a 100 MW site costs six figures and rain does it for free, so "dirty" isn't enough of a reason, and neither is "it's on the calendar". Soiling that has already sat through a heavy rain won't wash off, so it's judged over 90 days instead of waiting for rain that won't help.
- Trade-off
- The wait for rain comes from climate, not a forecast. The build-up rate is trusted for 30 days, then held flat, so the savings shown are conservative. The cost is an estimate until an operator types in a quote.
Measure soiling, don't infer it
Give every site a soiling station and attribute soiling from its reading. Without one, fall back to inferring it from every string being low together.
- Why
- Inference can't tell dust from a pyranometer reading high: both make every string look short by the same amount. The station can, so a drifting sensor becomes "check the sensor" instead of a six-figure wash. Measured soiling also matches the answer key within 8%, where inference missed the early build-up.
- Trade-off
- One station is one spot: if it sits by a dirt road or in a corner that never gets dusty, the whole site is judged by it. Its clean reference module has to be kept clean, daily, which is its own maintenance job.
A deck.gl map with no tile service
Draw the fleet map with deck.gl over a bundled Natural Earth outline of provinces and states (about 75 KB), instead of Mapbox or MapLibre tiles.
- Why
- No API key, no third-party requests, and it works on an air-gapped on-prem install. Circle area, not radius, is proportional to lost revenue, so a site losing twice as much looks twice as big.
- Trade-off
- No streets or satellite imagery. deck.gl layers drop onto a Mapbox or MapLibre basemap unchanged when that's wanted. The canvas isn't keyboard-operable, so the table view carries the same data.