Maximum | Demand Electrical [upd]
"limit_kw": 160.0, "warning_threshold_pct": 85, "window_minutes": 15, "auto_reset_peak_on": "monthly"
# Store in circular buffer self.buffer[self.index] = delta_kwh self.index = (self.index + 1) % self.num_blocks maximum demand electrical
Demand = (kWh_last_15min) / 0.25 To avoid storing raw energy every second, break window into N sub‑intervals. "limit_kw": 160
Two‑stage shedding + restoration.
| Priority | Load Type | Action at demand > limit | |----------|-----------|--------------------------| | 1 (low) | Water heater | Shed first | | 2 | HVAC – stage 2 | Shed second | | 3 (high) | Lighting, critical | Never shed | | Signal | Source | Use | |--------|--------|-----| | Energy pulses (kWh) | Utility meter / CT + energy IC | Calculate delta per sub‑interval | | Voltage, Current | Power quality meter | Compute kVA if PF varies | | Relay outputs | PLC / MCU | Load shedding control | | Real‑time clock | RTC / NTP | Timestamp peaks | maximum demand electrical