Electrical |verified| | Maximum Demand

Two‑stage shedding + restoration.

CREATE TABLE md_log ( id INTEGER PRIMARY KEY, timestamp DATETIME, demand_kw REAL, peak_flag BOOLEAN ); CREATE TABLE md_config ( param TEXT PRIMARY KEY, value REAL ); -- e.g., ('limit_kw', 150.0), ('warning_pct', 80.0), ('window_min', 15)

kVA = (kW) / Power Factor OR directly measure kVA = (V × I × sqrt(3))/1000 for 3‑phase Minimal table schema (SQLite example): maximum demand electrical

For kVA demand (common for utilities), measure voltage and current, then:

"timestamp": "2026-04-14T10:15:00Z", "demand_kw": 134.7, "limit_kw": 150.0, "demand_percent": 89.8, "peak_kw": 148.2, "peak_timestamp": "2026-04-13T18:30:00Z", "warning_level": "none", "shedding_active": false Two‑stage shedding + restoration

return demand_kw When demand approaches limit, shed non‑critical loads.

"limit_kw": 160.0, "warning_threshold_pct": 85, "window_minutes": 15, "auto_reset_peak_on": "monthly" peak_flag BOOLEAN )

// POST /api/max_demand/config