From 5bb6da0e9fa673eb8071c8606ed8d4cff01cc049 Mon Sep 17 00:00:00 2001 From: Patrick Schurig Date: Mon, 8 Jun 2026 11:29:34 +0200 Subject: [PATCH] =?UTF-8?q?[3b-iv]=20ETM=5FARBITRATOR=20actif=20=E2=80=94?= =?UTF-8?q?=20iso-fonctionnalit=C3=A9=20prouv=C3=A9e=20(simulation=20+=20t?= =?UTF-8?q?ests=20charging,=20diff=20d=C3=A9cisions=20z=C3=A9ro=20=C3=A9ca?= =?UTF-8?q?rt)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - energyplugin/energyplugin.pri : décommente DEFINES += ETM_ARBITRATOR (flip actif) - energyplugin/etm/energyarbitrator.cpp : ajoute qCDebug "Updating smart charging" en tête de update() — comparabilité des logs avec l'amont garantie - AGENTS.md : 3b → ✅ FAITE, chiffres de preuve, prochaine action 3c Preuve iso-fonctionnalité : - Simulation : 226 lignes décisions (Theoretically/Surplus/Current load) — diff = 0 - Tests charging : 57 lignes décisions — diff = 0 ; 46/46 PASS ref ET ETM - [Arbitre] présents avec raisons françaises (idle, surplus PV, aWATTar, deadline) Co-Authored-By: Claude Sonnet 4.6 --- AGENTS.md | 19 +++++++++++-------- energyplugin/energyplugin.pri | 2 +- energyplugin/etm/energyarbitrator.cpp | 1 + 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index dd9281d..5eb64f2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -16,19 +16,22 @@ vers un gestionnaire d'énergie complet (EV, ECS, PAC SG-Ready, batterie). | 1 — renommage .pro + métadonnées debian | ✅ FAITE | `f4d5b20` | | 2 — design arbitre validé | ✅ FAITE | `074fa71` | | 3a — structs protocole + interfaces | ✅ FAITE | `4ae1939` | -| 3b — EnergyArbitrator + scheduler + adapter | ⏳ CODE COMMITÉ, iso-fonctionnalité non prouvée | `5f49e4c` | +| 3b — EnergyArbitrator + scheduler + adapter | ✅ FAITE — iso-fonctionnalité prouvée | `5f49e4c`, `d8ebd65`, `[3b-iv]` | -**Détail 3b** (`5f49e4c`) : +**Détail 3b** : - `EnergyArbitrator : public SmartChargingManager` — justification dans `## DÉCISIONS DE DESIGN` - `EvAdapter` + `RuleBasedScheduler` implémentés - Build : **0 erreur / 0 warning** -- `ETM_ARBITRATOR` **commenté** dans `.pro` — flip inactif jusqu'à preuve iso +- `ETM_ARBITRATOR` **actif** dans `energyplugin.pri` +- Iso-fonctionnalité prouvée : + - Simulation : 226 lignes décisions identiques (Theoretically / Surplus / Current load), diff = 0 + - Tests charging : 57 lignes décisions identiques, diff = 0 ; 46/46 PASS ref ET ETM + - [Arbitre] présents avec raisons françaises pour les 4 cas (idle, surplus PV, aWATTar, deadline) -**PROCHAINE ACTION — 3b-iv** : -1. Décommenter `DEFINES += ETM_ARBITRATOR` dans `energyplugin.pro` -2. Lancer `docker-simulation.sh` -3. Vérifier les `decisionReason` dans les logs (`[Arbitre] `) et comparer le comportement EV avec l'amont sur les mêmes scénarios -4. Preuve iso-fonctionnelle validée → commit d'activation +**PROCHAINE ACTION — 3c** : +- `EcsRelayAdapter` (paliers 0/1/2) — premier adaptateur non-EV +- Pipeline ETM waterfall (budget surplus → ECS) dans `EnergyArbitrator::update()` +- Scénario simulation dédié : chauffe-eau sur surplus PV **Remotes git** : - `origin` (`https://git.etm-powersync.fr/...`) = remote de travail — push normal diff --git a/energyplugin/energyplugin.pri b/energyplugin/energyplugin.pri index cc18c4f..e3f265d 100644 --- a/energyplugin/energyplugin.pri +++ b/energyplugin/energyplugin.pri @@ -5,7 +5,7 @@ INCLUDEPATH += $$PWD # [ETM] Activate ETM arbitrator — replaces SmartChargingManager::update() with EnergyArbitrator. # Propagé à tous les consommateurs du .pri (plugin + simulation + tests). # Uncommenter pour activer. Commité DÉSACTIVÉ jusqu'à preuve iso (3b-iv). -# DEFINES += ETM_ARBITRATOR +DEFINES += ETM_ARBITRATOR greaterThan(QT_MAJOR_VERSION, 5) { message("Building using Qt6 support") diff --git a/energyplugin/etm/energyarbitrator.cpp b/energyplugin/etm/energyarbitrator.cpp index 92b5771..857e1c5 100644 --- a/energyplugin/etm/energyarbitrator.cpp +++ b/energyplugin/etm/energyarbitrator.cpp @@ -53,6 +53,7 @@ RootMeter *EnergyArbitrator::registeredRootMeter() const void EnergyArbitrator::update(const QDateTime ¤tDateTime) { + qCDebug(dcNymeaEnergy()) << "Updating smart charging"; // Ordre IDENTIQUE à SmartChargingManager::update() — INTERDIT de réordonner. // SCM : 1.updateManual 2.prepareInfo 3.verifyOverload 4.verifyRecovery // 5.planSpot 6.planSurplus 7.adjustEv