Add configurable override duration and hard-stop thresholds
Override duration (web UI): - Dropdown on Ein button: 30min / 1h / 2h / 4h - Engine notified immediately via ApplyOverride() — no waiting for next SyncHardwareState cycle - Aus button always uses 1h lockout (keeps consumer off for 1h) Hard-stop thresholds that cancel active overrides: - SOC emergency brake: now also clears ManualOverride flag so EMS resumes full control after the safety shutdown - override_max_import_w (default 800W): if grid import exceeds this while an override is active, override is cancelled immediately (no hysteresis delay — protection is instant) Config: ems.override_max_import_w (0 = disabled) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -534,6 +534,17 @@ h1 { font-size: 1.4rem; font-weight: 700; color: #14532d; }
|
||||
.consumer-detail.active { color: #16a34a; font-weight: 500; }
|
||||
.consumer-detail.override { color: #d97706; font-weight: 500; }
|
||||
|
||||
.dur-select {
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 8px;
|
||||
padding: 0.3rem 0.4rem;
|
||||
font-size: 0.75rem;
|
||||
background: #f9fafb;
|
||||
color: #374151;
|
||||
cursor: pointer;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.override-btn {
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
@@ -673,13 +684,20 @@ h1 { font-size: 1.4rem; font-weight: 700; color: #14532d; }
|
||||
<span class="power-badge">{{formatW .LivePowerW}}</span>
|
||||
{{end}}
|
||||
{{if .CanOverride}}
|
||||
<form method="post" action="/override">
|
||||
<form method="post" action="/override" style="display:flex;align-items:center;gap:0.4rem;flex-shrink:0">
|
||||
<input type="hidden" name="consumer" value="{{.ConsumerKey}}">
|
||||
{{if .Active}}
|
||||
<input type="hidden" name="state" value="off">
|
||||
<input type="hidden" name="duration" value="1h">
|
||||
<button type="submit" class="override-btn turn-off">Aus</button>
|
||||
{{else}}
|
||||
<input type="hidden" name="state" value="on">
|
||||
<select name="duration" class="dur-select">
|
||||
<option value="30m">30 min</option>
|
||||
<option value="1h" selected>1 Std</option>
|
||||
<option value="2h">2 Std</option>
|
||||
<option value="4h">4 Std</option>
|
||||
</select>
|
||||
<button type="submit" class="override-btn turn-on">Ein</button>
|
||||
{{end}}
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user