sensor.evcs_consommation_jour_kwh : consommation du jour (sortie AC du MultiPlus), comme VRM
Delta depuis minuit de ac_in_1->ac_out + inverter->ac_out : 25,2 kWh a 17:11 le 26/09 pour ~25 dans VRM. Remise a zero -> indisponible, compteur muet -> partiel. Tests 59/59, mutation qui mord. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011uJ47NxgfpGnuuMr3f2n7Z
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// Les cas PV reprennent les gammes du banc OpenClaw (HANDOFF §77) : G3, G4, G5, G7.
|
||||
// node tests/diagnostics-agent/run.mjs
|
||||
import fs from 'node:fs';
|
||||
import { diagnosticPv, etatCellules, productionJour, chargeSolaire, bilanNuit, etatReseau, importJour, COMPTEURS_IMPORT, COMPTEUR_EDF, MPPT_MODES, ORIGINE_PAR_SOURCE } from '../../tools/diagnostics-agent.mjs';
|
||||
import { diagnosticPv, etatCellules, productionJour, chargeSolaire, bilanNuit, etatReseau, importJour, COMPTEURS_IMPORT, COMPTEUR_EDF, MPPT_MODES, ORIGINE_PAR_SOURCE, consoJour, COMPTEURS_CONSO } from '../../tools/diagnostics-agent.mjs';
|
||||
|
||||
const LIM = 'voltage_current_limited', ACT = 'mppt_active';
|
||||
function st({ pv, conso, reseau, soc = 80, courant = 0, edf = 'off', modes }) {
|
||||
@@ -249,6 +249,26 @@ for (const [nom, r, test] of imp) {
|
||||
console.log(`${ok ? 'OK ' : 'KO '} ${nom}`);
|
||||
}
|
||||
|
||||
const n = cas.length + cel.length + prod.length + charge.length + 1 + bn.length + res.length + imp.length;
|
||||
// --- Consommation du jour : releve reel du 26/09 a 17:11 (VRM ~25 kWh) ------
|
||||
{
|
||||
const [R, O] = COMPTEURS_CONSO.map(([, id]) => id);
|
||||
const mi = { [R]: 9, [O]: 292.4 };
|
||||
const cj = [
|
||||
['conso reelle 26/09 17:11 : 0,6 + 24,6 = 25,2 kWh, complet', consoJour({ [R]: 9.6, [O]: 317 }, mi),
|
||||
(r) => r.etat === 25.2 && r.attributs.statut === 'complet' && r.attributs.detail_kwh.depuis_reseau === 0.6],
|
||||
['compteur remis a zero -> indisponible, jamais negatif', consoJour({ [R]: 9.6, [O]: 3.1 }, mi),
|
||||
(r) => r.etat === 'indisponible'],
|
||||
['un compteur muet -> partiel « au moins »', consoJour({ [R]: null, [O]: 317 }, mi),
|
||||
(r) => r.etat === 24.6 && r.attributs.statut === 'partiel' && /au moins/.test(r.attributs.explication)],
|
||||
['minuit inconnu -> indisponible', consoJour({ [R]: 9.6, [O]: 317 }, {}), (r) => r.etat === 'indisponible'],
|
||||
];
|
||||
for (const [nom, r, test] of cj) {
|
||||
const ok = test(r); if (!ok) { ko++; console.log(JSON.stringify(r)); }
|
||||
console.log(`${ok ? 'OK ' : 'KO '} ${nom}`);
|
||||
}
|
||||
globalThis.__nConso = cj.length;
|
||||
}
|
||||
|
||||
const n = (globalThis.__nConso || 0) + cas.length + cel.length + prod.length + charge.length + 1 + bn.length + res.length + imp.length;
|
||||
console.log(`\n${n - ko}/${n}`);
|
||||
process.exit(ko ? 1 : 0);
|
||||
|
||||
Reference in New Issue
Block a user