For kVA demand (common for utilities), measure voltage and current, then:
"limit_kw": 160.0, "warning_threshold_pct": 85, "window_minutes": 15, "auto_reset_peak_on": "monthly" maximum demand electrical
Demand = (kWh_last_15min) / 0.25 To avoid storing raw energy every second, break window into N sub‑intervals. For kVA demand (common for utilities), measure voltage