The Rules page configures the thresholds, weights and message templates used by the Analysis Engine — the component that turns raw collected data into the Health Score, insights, events and forecast you see on the Analysis page. Everything here is stored in rules.yaml.
Sections are collapsible — click a section header to expand or collapse it. Frequently-tuned sections (Grid Quality, Load Analysis, Power Factor, Energy) are open by default; deeper, rarely-touched sections (Anomaly Detection, Detective Engine, Forecast, System State, Health Score, Messages) start collapsed.
Controls how much history each analysis run looks at.
These limits describe your own electrical installation, so PowerTrace ships with them empty and the section stays silent until you fill them in. There is no sensible default: a 25 A apartment and a 40 A house would each get hundreds of false events from the other one's setting. Fill in what you know and leave the rest blank.
Statistical outlier detection for both single-day energy totals and short power bursts.
Looks for recurring daily patterns and cause-effect correlations between events (e.g. voltage sagging whenever load surges), shown as cards on the Analysis page.
Predicts tomorrow's and next month's energy consumption using a weighted moving average (WMA) — more recent days count more than older ones.
1, 1, 2, 2, 3, 3, 4. The number of weights must match Window days. Higher numbers for recent days make the forecast react faster to changes in usage.The single 0–100 number shown at the top of the Analysis page, built from six weighted components.
Every insight, event and recommendation shown on the Analysis page is built from an editable text template here — you can rewrite the wording (make it more casual, add detail) without touching code.
rules.yaml. To translate the interface, install a language pack instead (see Settings → Interface Language); these fields are for overriding individual messages on top of it.
{min_voltage}, {duration_min}. Do not remove or rename placeholders — the page validates this and blocks saving if a placeholder used by the engine is missing from your edited text.
rules.yaml is normal, not an error: the report then uses the wording from your language pack, falling back to the engine's own built-in English rather than printing a bare code like VOLTAGE_SAG. Saving through this page will, however, reject an unknown message key or a template that has dropped a placeholder the engine needs.
| Message | Fires when… |
|---|---|
| VOLTAGE_SAG / VOLTAGE_SWELL | Voltage sags below or swells above a threshold for at least the minimum duration. |
| LOAD_BURST | A short power spike exceeds the burst multiplier for at least the minimum burst duration. |
| ENERGY_ANOMALY | A day's total consumption is a statistical outlier (Z-score/IQR). |
| LOW_PF_SUSTAINED | Power factor stays below the poor threshold for longer than the warn/alert duration share. |
| VOLTAGE_UNSTABLE | Voltage coefficient of variation exceeds the CV warn threshold. |
| DATA_GAP | One or more gaps in the collected data are found for the period. |
| HIGH_TEMP | Device temperature is at or above the warn threshold right now (see System State — this one describes the present moment, not the period). |
| LOAD_INCREASED / LOAD_DECREASED | Average load changed vs. the previous period by more than the warn percentage (a rise past the alert percentage becomes a warning). |
| ENERGY_TREND_RISING / ENERGY_TREND_FALLING | The energy trend slope is above/below the stable-slope threshold. |
| HIGH_ANOMALY_RATE | The number of anomaly events in the period is unusually high. |
| LOAD_BALANCE_POOR | Peak/average load ratio exceeds the load-balance threshold. |
| RECURRING_PATTERN_DETECTED / VOLTAGE_SAG_FOLLOWS_LOAD | The Detective Engine finds a repeating daily pattern, or a load→voltage correlation that clears both the confidence and the lift thresholds. |
| *_MAIN_ISSUE (PF, Voltage, Load Balance, Energy Trend, Anomaly Rate, Data Continuity, System) | That component is the single worst-scoring one behind a reduced Health Score. |
| HEALTH_SCORE_IMPROVED / DECLINED | Shown when the score differs from the previous run. An unchanged score produces no message. |
| NO_CRITICAL_EVENTS / ALL_COMPONENTS_HEALTHY | Shown when nothing needs attention, so the report doesn't look empty. |
rules.yaml. Blocked if any field is out of its valid range, if the six Health Score weights don't sum to 1.0, if a message template is missing a required placeholder, or if two fields contradict each other — see below.rules.yaml.