Maximum Demand Electrical [repack] -
At each minute:
def demand_control(self, demand_kw, limit_kw): if demand_kw >= limit_kw: self.shed_level(2) # shed all non‑critical loads elif demand_kw >= limit_kw * 0.95: self.shed_level(1) # shed first stage loads elif demand_kw < limit_kw * 0.85: self.restore_level(1) if demand_kw < limit_kw * 0.70: self.restore_level(2) maximum demand electrical
Electricity meters continuously log energy consumption. The meter averages the power used during each consecutive time block. On restart, wait for full window before reliable demand
| Condition | Handling | |-----------|----------| | Power loss | Persist buffer & peak to EEPROM. On restart, wait for full window before reliable demand. | | Incomplete window at startup | Use partial window average with a flag. | | Meter rollover | Detect by comparing readings; adjust delta with max meter reading. | | Communication delay | Timestamp each reading; interpolate if needed. | | | Communication delay | Timestamp each reading;
Interlocking controls prevent two heavy machines from running at the same time.
"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
Maximum Demand=Total Connected Load×Diversity FactorMaximum Demand equals Total Connected Load cross Diversity Factor

