Alerte BOOST : resistance jamais atteinte en HC (AUTO s'arrete sous 65 °C) ; Jeep non identifiee si elle roule apres le branchement ; relecture Uconnect au branchement

This commit is contained in:
Tallagrand Thierry
2026-10-07 12:48:46 +02:00
parent 9094984069
commit 377b87f6d1
7 changed files with 71 additions and 24 deletions

View File

@@ -53,7 +53,8 @@ eq('helper corrompu repart a vide', JSON.parse(ajouterReleve('pas du json', { ve
const journ = async () => {};
const appels = [];
const etiq = async (b, n, m) => { appels.push([b.toISOString(), n, m]); return 1; };
const etat = (km, niv, maj, branchee = 'on', borne = 'on') => new Map([
const etat = (km, niv, maj, branchee = 'on', borne = 'on', contact = 'off') => new Map([
[JEEP.contact, { state: contact }],
[JEEP.odometre, { state: String(km) }], [JEEP.niveau, { state: String(niv) }], [JEEP.majA, { state: maj }],
[JEEP.branchee, { state: branchee }], ['binary_sensor.victron_evcs_vehicle_connected', { state: borne }],
['input_number.victron_evcs_capacity_jeep_kwh', { state: '8.7' }], ['input_number.victron_evcs_autonomie_jeep_km', { state: '50' }]]);
@@ -83,6 +84,11 @@ eq('helper corrompu repart a vide', JSON.parse(ajouterReleve('pas du json', { ve
base.branche = new Date('2026-10-09T17:06:00Z'); base.etiquette = 'VW';
await ingererJeep(sql, lire, etat(112950, 40, '2026-10-09T17:05:00+00:00', 'off', 'on'), journ, etiq);
eq('jeep : proprietaire a deja dit VW -> rien', [appels.length, base.niveaux.length], [2, 2]);
// 07/10 : une autre voiture est branchee ; la Jeep publie APRES le branchement
// avec le contact mis et se declare « branchee » (cas extreme) -> pas JEEP.
base.branche = new Date('2026-10-10T10:32:00Z'); base.etiquette = null;
await ingererJeep(sql, lire, etat(113000, 50, '2026-10-10T10:37:20+00:00', 'on', 'on', 'on'), journ, etiq);
eq('jeep : contact mis apres le branchement -> pas d identification', appels.length, 2);
}
if (process.argv.includes('--vues')) {

View File

@@ -81,25 +81,28 @@ for (const c of cas) {
if (o.observedPowerW === 0 && o.observedRegime === 'off') { ok++; console.log('✅ coupe-zero-watt'); }
else { ko++; console.log(`❌ coupe-zero-watt | ${o.observedPowerW} W ${o.observedRegime}`); }
}
// Alerte BOOST (07/10) : en HC sur EDF, le ballon ne tire que la pompe a chaleur.
// Alerte BOOST (07/10) : en HC sur EDF, la resistance n'a jamais ete atteinte.
{
const minuit = new Date(new Date().toLocaleDateString('sv-SE', { timeZone: 'Europe/Paris' }) + 'T00:00:00');
const nowMin = (() => { const p = new Intl.DateTimeFormat('fr-FR', { timeZone: 'Europe/Paris', hour: '2-digit', minute: '2-digit', hour12: false }).format(new Date()).split(':'); return Number(p[0]) * 60 + Number(p[1]); })();
const hm = (m) => { const x = ((m % 1440) + 1440) % 1440; return `${String(Math.floor(x / 60)).padStart(2, '0')}:${String(x % 60).padStart(2, '0')}:00`; };
const stamp = new Date(Date.now() - 5 * 60000).toLocaleString('sv-SE', { timeZone: 'Europe/Paris' });
const fenetre = { hc_midday_start: hm(nowMin - 30), hc_midday_stop: hm(nowMin + 60), hc_night_start: hm(nowMin + 300), hc_night_stop: hm(nowMin + 600) };
const base = { ...BASE, ...fenetre, grid_state: 'on', hc_session_committed: 'on', water_heater_switch: 'on',
water_heater_energy_total_kwh: '18.65', energy_total_prev_kwh: '18.60', energy_prev_at: stamp }; // 0,05 kWh / 5 min = 600 W : pompe a chaleur
const verif = (nom, snap, attenduAlerte) => {
water_heater_energy_total_kwh: '18.65', energy_total_prev_kwh: '18.60', energy_prev_at: stamp }; // 600 W : pompe a chaleur
const debut = new Date().toLocaleDateString('sv-SE', { timeZone: 'Europe/Paris' }) + ' ' + hm(nowMin - 30).slice(0, 5);
const verif = (nom, snap, attendu) => {
const s = executer({ ...base, ...snap });
const a = s.ARBITRATION[0].json.finalDecision.alerteChauffeEau;
const ok1 = attenduAlerte ? (a && JSON.parse(a).active === true && JSON.parse(a).message.includes('BOOST')) : a === '';
let j = null; try { j = JSON.parse(a); } catch {}
const actif = !!(j && j.active === true && j.message && j.message.includes('BOOST'));
const appel = s.BUILD_ACTIONS.map((x) => x.json).find((c) => c.data?.entity_id === 'input_text.evcs_alerte_chauffe_eau');
if (ok1 && appel) { ok++; console.log(`✅ ${nom}`); } else { ko++; console.log(`❌ ${nom} | alerte=${a} appel=${!!appel}`); }
if (actif === attendu && appel) { ok++; console.log(`✅ ${nom}`); } else { ko++; console.log(`❌ ${nom} | alerte=${a} appel=${!!appel}`); }
};
verif('alerte-boost-pompe-a-chaleur-en-hc', {}, true);
verif('alerte-boost-auto-arrete-0-w-en-hc', { water_heater_energy_total_kwh: '18.60' }, true);
verif('alerte-boost-resistance-pas-d-alerte', { water_heater_energy_total_kwh: '18.75' }, false);
verif('alerte-boost-thermostat-satisfait-pas-d-alerte', { water_heater_energy_total_kwh: '18.60' }, false);
verif('alerte-boost-resistance-deja-vue-dans-la-fenetre', { water_heater_energy_total_kwh: '18.60',
alerte_prev: JSON.stringify({ active: false, since: debut, max_w: 1235 }) }, false);
verif('alerte-boost-debut-de-fenetre-attente', { hc_midday_start: hm(nowMin - 5) }, false);
verif('alerte-boost-edf-ouvert-pas-d-alerte', { grid_state: 'off' }, false);
}