Add DAILY_MAINS_POWER: on mains, a mains loss turns the day red at once

A station is on mains when its BusVoltage mean over the 3 days before
the day is >= 14.0 V (solar never exceeds 13.50 V on VERMONT; mains
stays >= 14.08 V). On mains, the mains loss decides the day color
instead of the state x trend matrix: red as soon as an hour falls under
13.4 V (top of the OCV plateau; mains-on hours stay >= 13.65 V, mains-off
hours are 13.1-13.3 V). On MISSISSIPPI the day turns red 1-2 h after the
loss instead of 29-40 h with the matrix; WEISSHORN and NORDEND (mains)
raise no false alert, VERMONT (solar) is unchanged (D-043).

The matrix drawio gets the mains case, the site figure a third panel,
and the support notification and the client Energy block header show
"On mains" / "Not on mains" / "Mains unknown".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-10-13 17:22:16 +02:00
1 parent 28ed86baba
commit 9177982de1
18 files changed
+359 -43

No files matched your search

+4
View File
@@ -55,6 +55,7 @@
.status.GREEN { background: var(--green); } .status.ORANGE { background: var(--orange); color: #1a1a1a; }
.status.RED { background: var(--red); } .status.UNKNOWN { background: var(--unknown); }
.meta { color: var(--muted); font-size: 13px; }
.power { padding: 1px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--text); }
.diag-item > summary .chev { margin-left: auto; width: 13px; height: 13px; transition: transform .15s; }
.diag-item[open] > summary .chev { transform: rotate(180deg); }
.diag-body { border-top: 1px solid var(--line); padding: 14px; }
@@ -266,6 +267,9 @@ for (const [key, dom] of Object.entries(DATA.domains)) {
el.id = key;
el.querySelector(".name").textContent = name;
el.querySelector(".status").outerHTML = chip(c);
// Energy : sur secteur ou non, visible sans ouvrir le bloc (DAILY_MAINS_POWER, D-043) ; null = statut inconnu.
if (key === "energy") el.querySelector(".status").insertAdjacentHTML("afterend",
`<span class="power">${R.power_label[cur.power ?? null]}</span>`);
el.querySelector(".meta").textContent = `${DATA.label} · ${ACTION[c] || "Check data"}`;
el.querySelector(".headline").textContent = dom.headline[c] || `Not enough data to assess the station's ${what}.`;
el.querySelector(".days").innerHTML = ROWS[key](cur).map(([k, x]) => `<tr><th>${k}</th><td>${x}</td></tr>`).join("");