Skip to content

Health Score Calculation

What the health score is

The system health score is a 0–100 composite metric stored in the bwts_iot_health_scores table. It represents the overall condition of the BWTS at each telemetry timestamp. The score is displayed as the arc gauge on the Overview tab’s top-right corner and as a trend line in the Trend Analysis tab.

The score is pre-computed by the data pipeline — not calculated by the dashboard itself. The dashboard reads and displays the stored values.

The four component scores

Each component is independently scored 0–100 and contributes to the overall score:

ComponentFieldWhat it measures
UV Healthuv_healthHow closely UVR_INTENSITY matches the target operating point (650 W/m²)
Lamp Healthlamp_healthAggregate efficiency of all 16 lamps relative to their rated output
Power Efficiencypower_efficiencyRatio of actual to rated power consumption across the lamp array
Thermal Healththermal_healthLDC temperature management — LDC_AIR_TEMP vs safe operating range, fan status

The Trend Analysis tab exposes uv_health and lamp_health as individual series in the health evolution chart alongside overall_score.

Risk level thresholds

Overall ScoreRisk LevelGauge colourInterpretation
80–100LOWGreenAll systems nominal
60–79MEDIUMBlueMinor degradation — monitor closely
40–59HIGHOrangeMaintenance recommended soon
0–39CRITICALRedImmediate action required

The risk_level field in the database stores the string value (LOW, MEDIUM, HIGH, CRITICAL) corresponding to these bands.

Where health scores appear in the dashboard

LocationWhat is shown
Overview tab — top-right arc gaugeoverall_score from the latest health record
Trend Analysis — health evolution chartoverall_score, uv_health, lamp_health over the selected date range
/api/health endpointArray of health records (latest first)
/api/health/aggregated endpointTime-bucketed health scores for charting

API response shape

{
"timestamp": "2026-04-30T00:00:00Z",
"overall_score": 82,
"risk_level": "LOW",
"components": {
"uv_health": 88,
"lamp_health": 79,
"power_efficiency": 84,
"thermal_health": 91
}
}

References

  • UV Thresholds — how UV intensity maps to compliance and health
  • RUL Algorithm — how lamp predictions relate to lamp_health
  • lib/constants.tsTHRESHOLDS.HEALTH_SCORE contains the 80/60/40 breakpoints