iobroker.eos-admin 9.0.38 → 9.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NEXOWATT_EOS_BUILD_INFO.json +12 -10
- package/README.md +10 -2
- package/adminWww/.vite/manifest.json +114 -114
- package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +13759 -13759
- package/adminWww/assets/{AdapterUpdateDialog-D4gUYZep.js → AdapterUpdateDialog-DDmYbnK4.js} +1 -1
- package/adminWww/assets/{Adapters-DLxiJc3y.js → Adapters-73Uo4VUy.js} +1 -1
- package/adminWww/assets/{ConfigManager-D_YTKUdP.js → ConfigManager-DoFx_j4o.js} +1 -1
- package/adminWww/assets/{Enums-D79rON6b.js → Enums-BRQSAW9I.js} +1 -1
- package/adminWww/assets/{Fields-CTOv49EU.js → Fields-pcmISvLk.js} +1 -1
- package/adminWww/assets/{Files-DNLzjEG5.js → Files-E8-7c9Ab.js} +1 -1
- package/adminWww/assets/{Hosts-DHNboUMq.js → Hosts-D4a3shrq.js} +1 -1
- package/adminWww/assets/{Instances-BJxYNJAC.js → Instances-ByxEHRoo.js} +1 -1
- package/adminWww/assets/{Intro-8R-Q7CR_.js → Intro-DFriWa6g.js} +1 -1
- package/adminWww/assets/{Logs-CjAPhWuK.js → Logs-BXR0h5Sz.js} +1 -1
- package/adminWww/assets/{Objects-cvdqooGe.js → Objects-h6jg_6uT.js} +1 -1
- package/adminWww/assets/{Overview-JPfBOuKv.js → Overview-B39PiMGJ.js} +1 -1
- package/adminWww/assets/{State-CGnvMceJ.js → State-CqF2ARx_.js} +1 -1
- package/adminWww/assets/{UsedResources-FBd9jThR.js → UsedResources-CnbnoF3d.js} +1 -1
- package/adminWww/assets/{Users-BbUu3hZj.js → Users-BQik0rIi.js} +1 -1
- package/adminWww/assets/{bootstrap-Df_WTIJg.js → bootstrap-Dllnekqb.js} +3 -3
- package/adminWww/assets/{hostInit-BQCRqFay.js → hostInit-CQbS-SCS.js} +1 -1
- package/adminWww/assets/{icons-material-DS82xOs8.js → icons-material-rYFYu2DM.js} +1 -1
- package/adminWww/assets/{index-BlBZd8r8.js → index-BzbVZbb2.js} +2 -2
- package/adminWww/assets/{installSVGRenderer-BtlXF9y3.js → installSVGRenderer-DbH6B8B8.js} +1 -1
- package/adminWww/assets/{mf-entry-bootstrap-0-8bb11ea2.js → mf-entry-bootstrap-0-4dee1225.js} +2 -2
- package/adminWww/index.html +23 -23
- package/adminWww/mf-manifest.json +1 -1
- package/adminWww/mf-stats.json +1 -1
- package/adminWww/remoteEntry-eos-9.0.39.js +12 -0
- package/adminWww/remoteEntry.js +1 -1
- package/docs/README.md +1 -0
- package/docs/reports/EMS_ZIELLADEN_2026-11-28.md +45 -0
- package/docs/reports/unified-9.0.39/PRUEFBERICHT.md +48 -0
- package/docs/reports/unified-9.0.39/raw/INDEX.json +51 -0
- package/docs/reports/unified-9.0.39/raw/node22-tests-final.log +18189 -0
- package/docs/reports/unified-9.0.39/raw/node22-version.log +1 -0
- package/docs/reports/unified-9.0.39/raw/node24-tests-final.log +3129 -0
- package/docs/reports/unified-9.0.39/raw/node24-version.log +1 -0
- package/docs/reports/unified-9.0.39/raw/npm-runtime-audit.json +77 -0
- package/docs/reports/unified-9.0.39/raw/overnight-simulation.json +117 -0
- package/docs/start/START_HIER_9.0.39.md +14 -0
- package/io-package.json +8 -8
- package/modules/ocpp/README.md +2 -0
- package/modules/ocpp/ocpp/common.js +64 -40
- package/modules/ocpp/ocpp/eos-contract.js +8 -3
- package/modules/ocpp/runtime.js +10 -5
- package/modules/ocpp/test/eos-contract.test.js +67 -0
- package/modules/ocpp/test/hosted.test.cjs +29 -1
- package/package.json +7 -3
- package/release-manifests/unified/build-environment.cdx.json +6 -6
- package/release-manifests/unified/files.json +123 -109
- package/release-manifests/unified/frontend.cdx.json +6 -6
- package/release-manifests/unified/installer.cdx.json +6 -6
- package/release-manifests/unified/obsolete-admin-assets.json +83 -0
- package/release-manifests/unified/runtime.cdx.json +27 -27
- package/release-manifests/unified/validation.json +17 -17
- package/tools/eos-release-manifest.cjs +2 -0
- package/ui/docs/STATES_AND_DATAPOINTS_DE.md +132 -0
- package/ui/ems/engine.js +5 -3
- package/ui/ems/evcs-control-mapping.js +13 -1
- package/ui/ems/modules/charging-management.js +40 -76
- package/ui/ems/services/admin-overview-publisher.js +13 -7
- package/ui/ems/services/charging-management-audit.js +32 -1
- package/ui/ems/services/forecast-aware-target-planner.js +12 -5
- package/ui/ems/services/forecast-target-runtime-bridge.js +12 -5
- package/ui/io-package.json +5 -1
- package/ui/lib/charging-point-identity.js +91 -16
- package/ui/lib/hosted-adapter.js +35 -1
- package/ui/main.js +69 -41
- package/ui/package.json +1 -1
- package/ui/www/app.js +57 -72
- package/ui/www/charging-diagnostics-appcenter.js +12 -7
- package/ui/www/dashboard-lp-status.js +19 -12
- package/ui/www/evcs.js +71 -98
- package/ui/www/licenses/smarthome-markdown-components.json +156 -156
- package/ui/www/manifest.webmanifest +2 -2
- package/adminWww/remoteEntry-eos-9.0.38.js +0 -12
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# NexoWatt UI – State- und Datenpunkt-Katalog
|
|
2
|
+
|
|
3
|
+
Diese Datei beschreibt wichtige States und Datenpunkte. Sie ist keine vollständige automatisch generierte Liste, sondern eine fachliche Orientierung für Wartung und TypeScript-Migration.
|
|
4
|
+
|
|
5
|
+
## 1. Grundregeln für Werte
|
|
6
|
+
|
|
7
|
+
| Regel | Bedeutung |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Wattwerte | intern als `number` in W führen |
|
|
10
|
+
| Prozentwerte | intern als `number` von 0 bis 100 führen |
|
|
11
|
+
| Energiewerte | kWh klar von W trennen |
|
|
12
|
+
| 0-Wert | ist ein gültiger Messwert |
|
|
13
|
+
| fehlender Wert | `null`, `undefined`, leer oder nicht numerisch |
|
|
14
|
+
| stale Wert | nur bei Quellen werten, bei denen altes Alter fachlich problematisch ist |
|
|
15
|
+
|
|
16
|
+
## 2. Energiefluss-States
|
|
17
|
+
|
|
18
|
+
| State / Key | Bedeutung | Einheit | Schreibt | Liest | Kritisch |
|
|
19
|
+
|---|---:|---:|---|---|---|
|
|
20
|
+
| `productionTotal` | PV-/Erzeugerleistung gesamt | W | main.js/EMS | app.js/history/KI | positiv führen |
|
|
21
|
+
| `gridBuyPower` | Netzbezug | W | main.js/EMS | app.js/history/KI | positiv führen |
|
|
22
|
+
| `gridSellPower` | Netzeinspeisung | W | main.js/EMS | app.js/history/KI | positiv führen |
|
|
23
|
+
| `consumptionBuilding` | Gebäudeverbrauch ohne optionale externe Lasten | W | main.js/EMS | app.js/history/KI | nicht doppelt mit EVCS zählen |
|
|
24
|
+
| `consumptionTotal` | Gesamtverbrauch | W | main.js/EMS | app.js/KPI | abhängig von Konfiguration |
|
|
25
|
+
| `storageSoc` | Speicher-SoC | % | main.js/Mapping | app.js/KI/History | normale Anlage bevorzugt vor Farm |
|
|
26
|
+
| `storageChargePower` | Speicher lädt | W | Resolver/Mapping | app.js/EMS | 0 W gültig |
|
|
27
|
+
| `storageDischargePower` | Speicher entlädt | W | Resolver/Mapping | app.js/EMS | 0 W gültig |
|
|
28
|
+
| `storagePower` | signed Speicherleistung | W | Mapping/Resolver | EMS/UI | Vorzeichen dokumentieren |
|
|
29
|
+
|
|
30
|
+
## 3. Speicher-Datenquellen
|
|
31
|
+
|
|
32
|
+
### Split-DPs
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
storageChargePower Ladeleistung, positiv
|
|
36
|
+
storageDischargePower Entladeleistung, positiv
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Signed-DP
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
storagePower Speicherleistung mit Vorzeichen
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Die konkrete Vorzeichenrichtung muss beim Mapping normalisiert werden.
|
|
46
|
+
|
|
47
|
+
### Fallback
|
|
48
|
+
|
|
49
|
+
Nur wenn kein Speicher-DP vorhanden ist.
|
|
50
|
+
|
|
51
|
+
## 4. Heizstab-States
|
|
52
|
+
|
|
53
|
+
| State / Key | Bedeutung | Einheit | Wichtig |
|
|
54
|
+
|---|---:|---:|---|
|
|
55
|
+
| `heatingRod.*.enabled` | Heizstab aktiv | boolean | Freigabegrundlage |
|
|
56
|
+
| `heatingRod.*.powerW` | aktuelle Heizstableistung | W | Dashboard/History |
|
|
57
|
+
| `heatingRod.*.storageReserveW` | Speicher-/PV-Reserve | W | darf nicht auf Default zurückspringen |
|
|
58
|
+
| `heatingRod.*.allowGrid` | Netzbezug erlaubt | boolean | Regelung |
|
|
59
|
+
| `heatingRod.*.allowStorageDischarge` | Speicherentladung erlaubt | boolean | Regelung |
|
|
60
|
+
|
|
61
|
+
## 5. EVCS-States
|
|
62
|
+
|
|
63
|
+
| State / Key | Bedeutung | Einheit | Wichtig |
|
|
64
|
+
|---|---:|---:|---|
|
|
65
|
+
| `chargingManagement.wallboxes.*.actualPowerW` | Ladeleistung | W | nur bei echter Wallbox anzeigen |
|
|
66
|
+
| `chargingManagement.wallboxes.*.goalEnabled` | Zielladen aktiv | boolean | KI-Planung |
|
|
67
|
+
| `chargingManagement.wallboxes.*.goalTargetSocPct` | Ziel-SoC | % | KI-Planung |
|
|
68
|
+
| `chargingManagement.wallboxes.*.goalFinishTs` | Zielzeit | ms | KI-Planung |
|
|
69
|
+
|
|
70
|
+
Regel:
|
|
71
|
+
|
|
72
|
+
```text
|
|
73
|
+
EVCS im Kundenfrontend nur sichtbar, wenn echte Ladepunktkonfiguration vorhanden ist.
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Zeit-/Zielladen bis 07:00 Uhr prüfen
|
|
77
|
+
|
|
78
|
+
Für einen Ladepunkt, etwa `lp1`, stehen Benutzerwunsch und aktuelle EMS-Entscheidung getrennt unter `chargingManagement.wallboxes.lp1`. Bei einer Bestandsübernahme den bisherigen UI-Namensraum verwenden.
|
|
79
|
+
|
|
80
|
+
1. Vor dem Update bei angeschlossenem Fahrzeug `userMode`, `goalEnabled`, `goalFinishTs`, `goalTargetSocPct` und `goalBatteryKwh` zusammen mit der Ladepunktzuordnung festhalten. Nach dem Neustart dieselbe Wallbox und die lokale Zieluhrzeit vergleichen. Bei einem aktiven täglichen Ziel darf das Datum nach Erreichen der Abfahrt auf den nächsten Tag wechseln.
|
|
81
|
+
2. Mit `userMode=auto` kann die aktuelle Ladeentscheidung zunächst PV sein. Bei ausbleibendem Überschuss hängt der notwendige Netzladestart unter anderem von Energiebedarf, Stations- und Standortgrenze sowie der erlaubten Tarifübersteuerung ab. Mit ausdrücklich gewähltem PV-Modus bleibt ein gespeichertes Ziel pausiert. Ein bei einer anderen Wallbox aktiver Boost gibt diesem Ladepunkt keinen Netzbezug frei.
|
|
82
|
+
3. Für die Abnahme die für diese Anlage freigegebenen Grenzen beibehalten. Im Ladeprotokoll Zielzeit, Fahrzeugverbindung, SoC und dessen Aktualität, Tarifentscheidung, EMS-Sollleistung und Wallbox-Istleistung mit Uhrzeit vergleichen. `Ist_W` enthält bei neuen Ereignissen eine bestätigte, frische Leistungsmessung. Eine leere Zelle mit `missing`, `stale` oder `incomplete` weist auf eine fehlende Einzelmessung, eine veraltete Einzelmessung oder eine unvollständige Summe hin. `legacy-unverified` kennzeichnet einen Wert aus dem bisherigen Protokollformat. Zeitfelder mit `Z` verwenden UTC. Bei einer Abweichung diese Werte zusammen mit dem Warte- oder Begrenzungsgrund sichern.
|
|
83
|
+
|
|
84
|
+
## 6. Speicherfarm-States
|
|
85
|
+
|
|
86
|
+
| State / Key | Bedeutung | Einheit | Wichtig |
|
|
87
|
+
|---|---:|---:|---|
|
|
88
|
+
| `storageFarm.totalSoc` | Farm-SoC | % | nur bei aktiver Farm nutzen |
|
|
89
|
+
| `storageFarm.totalChargePowerW` | Farm lädt | W | nur bei aktiver Farm |
|
|
90
|
+
| `storageFarm.totalDischargePowerW` | Farm entlädt | W | nur bei aktiver Farm |
|
|
91
|
+
| `storageFarm.storagesStatusJson` | Farm-Speicherliste | JSON | Tabelle |
|
|
92
|
+
|
|
93
|
+
Regel:
|
|
94
|
+
|
|
95
|
+
```text
|
|
96
|
+
Eine Einzelanlage darf nicht durch alte storageFarm.* States beeinflusst werden.
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## 7. KI-Berater States
|
|
100
|
+
|
|
101
|
+
| State | Bedeutung | Schreibt | Liest |
|
|
102
|
+
|---|---|---|---|
|
|
103
|
+
| `aiAdvisor.enabled` | KI-App aktiv | AI/App-Center | Frontend |
|
|
104
|
+
| `settings.aiAdvisorEnabled` | Kunde will KI sehen | Settings | AI/App |
|
|
105
|
+
| `aiAdvisor.suggestionsJson` | Vorschlagsliste | ai-advisor.js | app.js |
|
|
106
|
+
| `aiAdvisor.topTitle` | Hauptvorschlag Titel | ai-advisor.js | app.js |
|
|
107
|
+
| `aiAdvisor.topText` | Hauptvorschlag Text | ai-advisor.js | app.js |
|
|
108
|
+
| `aiAdvisor.peakStateText` | Peakstatus | ai-advisor.js | app.js/Diagnose |
|
|
109
|
+
| `aiAdvisor.weatherSummary` | Wetterzusammenfassung | ai-advisor.js | app.js/Diagnose |
|
|
110
|
+
| `aiAdvisor.dailyPlanJson` | Tagesplan | ai-advisor.js | spätere UI |
|
|
111
|
+
|
|
112
|
+
## 8. System-States
|
|
113
|
+
|
|
114
|
+
| State | Bedeutung | Wichtig |
|
|
115
|
+
|---|---|---|
|
|
116
|
+
| `info.connection` | Adapter/Webserver erreichbar | wird von ioBroker/Admin genutzt |
|
|
117
|
+
| `license.*` | Lizenzstatus | keine maskierten Schlüssel speichern |
|
|
118
|
+
|
|
119
|
+
## 9. TypeScript-Ableitung
|
|
120
|
+
|
|
121
|
+
Aus dieser Datei sollen später Typen entstehen, z. B.:
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
interface EnergyFlowState {
|
|
125
|
+
productionTotalW: number;
|
|
126
|
+
gridBuyPowerW: number;
|
|
127
|
+
gridSellPowerW: number;
|
|
128
|
+
storageSocPct: number | null;
|
|
129
|
+
storageChargePowerW: number;
|
|
130
|
+
storageDischargePowerW: number;
|
|
131
|
+
}
|
|
132
|
+
```
|
package/ui/ems/engine.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/ems/engine.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:f5a6c6a5174e5994d0ec25941bfc484d599a985a7ba015115b9d27aa085b45f9
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -74,7 +74,8 @@ const { DatapointRegistry } = require('./datapoints');
|
|
|
74
74
|
const { ModuleManager } = require('./module-manager');
|
|
75
75
|
const { awaitEmsTransition } = require('../lib/installer-lifecycle');
|
|
76
76
|
const { normalizeOcppDiscovery } = require('../lib/ocpp-auto-discovery');
|
|
77
|
-
const { synchronizeChargingPointIdentity } = require('../lib/charging-point-identity');
|
|
77
|
+
const { configuredChargingPointRows, synchronizeChargingPointIdentity } = require('../lib/charging-point-identity');
|
|
78
|
+
const { equivalentDeviceAliasTargets } = require('./evcs-control-mapping');
|
|
78
79
|
const { applyStorageMeasurementOverrides } = require('./services/storage-override-bridge');
|
|
79
80
|
const { buildNvpSnapshotFromRegistry } = require('./services/measurement-freshness');
|
|
80
81
|
const { installActuatorShadowArbiter } = require('./services/actuator-shadow-arbiter');
|
|
@@ -1132,7 +1133,8 @@ class EmsEngine {
|
|
|
1132
1133
|
const adapter = this.adapter;
|
|
1133
1134
|
// A saved reordering may survive a process/power loss before its state
|
|
1134
1135
|
// transfer. Recover it before any module reads index-based wishes.
|
|
1135
|
-
|
|
1136
|
+
adapter._nwEvcsIdentityTransitionPending = true;
|
|
1137
|
+
await synchronizeChargingPointIdentity(adapter, configuredChargingPointRows(adapter.config?.settingsConfig, adapter.evcsList), equivalentDeviceAliasTargets);
|
|
1136
1138
|
await this._ensureInternalStates();
|
|
1137
1139
|
this._startSchedulerHeartbeat();
|
|
1138
1140
|
// Scheduler interval from config (Admin UI / jsonConfig)
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/ems/evcs-control-mapping.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:6fc66996d93e4c0a5c01f28d518bfb76bf5da3bc43abb594f17353edcd0051da
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -377,7 +377,19 @@ async function resolveEvcsControlMapping() {
|
|
|
377
377
|
}
|
|
378
378
|
|
|
379
379
|
// Statischer CommonJS-Export: benötigt keine Auswertung von Quelltext zur Laufzeit.
|
|
380
|
+
// Only the published aliases for one NexoWatt device may bridge a change of
|
|
381
|
+
// primary mapping. Arbitrary similarly-named ioBroker paths are separate devices.
|
|
382
|
+
function equivalentDeviceAliasTargets(target, ownerNamespace) {
|
|
383
|
+
const match = /^((nexowatt-devices\.\d+|eos-admin\.\d+)\.devices\.[^.]+)\./.exec(target);
|
|
384
|
+
if (!match || (match[2].startsWith('eos-admin.') && match[2] !== ownerNamespace)) return [];
|
|
385
|
+
const control = buildEvcsControlCandidates(match[1]);
|
|
386
|
+
const telemetry = buildEvcsTelemetryCandidates(match[1]);
|
|
387
|
+
const candidates = [...Object.values(control).flat(), ...Object.values(telemetry).flat()];
|
|
388
|
+
return candidates.includes(target) ? candidates : [];
|
|
389
|
+
}
|
|
390
|
+
|
|
380
391
|
module.exports = {
|
|
392
|
+
equivalentDeviceAliasTargets,
|
|
381
393
|
deriveNexowattDeviceBaseId,
|
|
382
394
|
buildEvcsControlCandidates,
|
|
383
395
|
buildEvcsTelemetryCandidates,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/ems/modules/charging-management.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:57736262108314931f0df166a7002ee7747fbacb0e6491bfd4348d3d840476a7
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -63,6 +63,7 @@ const {
|
|
|
63
63
|
resolveChargingStrategyOverlay,
|
|
64
64
|
} = require('../services/operating-strategy-runtime');
|
|
65
65
|
const { buildRuntimeGoalPlanMap, goalPlanStateRows, resolvePlanEffectiveMode, applyGoalPlan, applyStrategyOverlay, resolveGoalCommandStatus, resolveZeroExportChargingPolicy, runtimeChargingMaximumW } = require('../services/forecast-target-runtime-bridge');
|
|
66
|
+
const { deadlineChargingCapacityW } = require('../services/forecast-aware-target-planner');
|
|
66
67
|
|
|
67
68
|
/**
|
|
68
69
|
* Estimates the power the currently eligible EVCS fleet would request before
|
|
@@ -4992,6 +4993,12 @@ class ChargingManagementModule extends BaseModule {
|
|
|
4992
4993
|
try {
|
|
4993
4994
|
const sc = a && a.stateCache;
|
|
4994
4995
|
if (sc) {
|
|
4996
|
+
// A subscribed live update can arrive while the initial read is
|
|
4997
|
+
// pending. Prefer that observation over the older DB response.
|
|
4998
|
+
const live = sc[sid];
|
|
4999
|
+
if (live && Object.hasOwn(live, 'value')) {
|
|
5000
|
+
return checked({ val: live.value, ts: live.ts, lc: live.ts, ack: true });
|
|
5001
|
+
}
|
|
4995
5002
|
const ts = st && (typeof st.ts === 'number' ? st.ts : (typeof st.lc === 'number' ? st.lc : now));
|
|
4996
5003
|
sc[sid] = { value: st ? st.val : null, ts: ts || now };
|
|
4997
5004
|
}
|
|
@@ -5456,7 +5463,7 @@ class ChargingManagementModule extends BaseModule {
|
|
|
5456
5463
|
|
|
5457
5464
|
/** Code-Teil: Methode `_ensureWallboxChannel` – stellt Objekte/States/Strukturen sicher, ohne bestehende Konfiguration unnötig zu überschreiben. */
|
|
5458
5465
|
/** Code-Teil: _ensureWallboxChannel – Verarbeitet Wallbox-/Ladepunktdaten und Feature-Sichtbarkeit. */
|
|
5459
|
-
async _ensureWallboxChannel(key) {
|
|
5466
|
+
async _ensureWallboxChannel(key, wb) {
|
|
5460
5467
|
const safe = toSafeIdPart(key);
|
|
5461
5468
|
const ch = `chargingManagement.wallboxes.${safe}`;
|
|
5462
5469
|
if (this._known.has(ch)) return ch;
|
|
@@ -5511,6 +5518,7 @@ class ChargingManagementModule extends BaseModule {
|
|
|
5511
5518
|
'text',
|
|
5512
5519
|
true,
|
|
5513
5520
|
{
|
|
5521
|
+
def: normalizeWallboxModeOverride(wb?.userModeDefault || wb?.userMode || 'auto'),
|
|
5514
5522
|
states: {
|
|
5515
5523
|
auto: 'auto (global)',
|
|
5516
5524
|
pv: 'pv surplus only',
|
|
@@ -5520,16 +5528,6 @@ class ChargingManagementModule extends BaseModule {
|
|
|
5520
5528
|
},
|
|
5521
5529
|
);
|
|
5522
5530
|
|
|
5523
|
-
// Default value for the writable runtime state (do not overwrite user choice)
|
|
5524
|
-
try {
|
|
5525
|
-
const st = await this.adapter.getStateAsync(`${ch}.userMode`);
|
|
5526
|
-
if (!st || st.val === null || st.val === undefined || String(st.val).trim() === '') {
|
|
5527
|
-
await this.adapter.setStateAsync(`${ch}.userMode`, 'auto', true);
|
|
5528
|
-
}
|
|
5529
|
-
} catch {
|
|
5530
|
-
// ignore
|
|
5531
|
-
}
|
|
5532
|
-
|
|
5533
5531
|
// Auto bleibt der einzige Ladebetriebsmodus, in dem eine Betriebsstrategie
|
|
5534
5532
|
// die Zielplanung übernehmen darf. Standard bleibt der migrationssichere
|
|
5535
5533
|
// Default; alle anderen Ladebetriebsarten ignorieren diese Auswahl.
|
|
@@ -5540,21 +5538,13 @@ class ChargingManagementModule extends BaseModule {
|
|
|
5540
5538
|
'text',
|
|
5541
5539
|
true,
|
|
5542
5540
|
{
|
|
5543
|
-
def: 'standard',
|
|
5541
|
+
def: normalizeStrategyAutoSource(wb?.userAutoSource || wb?.autoSource || 'standard'),
|
|
5544
5542
|
states: {
|
|
5545
5543
|
standard: 'NexoWatt Standard-Automatik',
|
|
5546
5544
|
strategy: 'EOS Betriebsstrategie',
|
|
5547
5545
|
},
|
|
5548
5546
|
},
|
|
5549
5547
|
);
|
|
5550
|
-
try {
|
|
5551
|
-
const st = await this.adapter.getStateAsync(`${ch}.userAutoSource`);
|
|
5552
|
-
if (!st || st.val === null || st.val === undefined || String(st.val).trim() === '') {
|
|
5553
|
-
await this.adapter.setStateAsync(`${ch}.userAutoSource`, 'standard', true);
|
|
5554
|
-
}
|
|
5555
|
-
} catch {
|
|
5556
|
-
// ignore
|
|
5557
|
-
}
|
|
5558
5548
|
|
|
5559
5549
|
// Runtime, per-wallbox AC phase mode override (writable for VIS/LIVE UI)
|
|
5560
5550
|
// Values: fixed-1p | fixed-3p | auto-pv
|
|
@@ -5668,47 +5658,6 @@ class ChargingManagementModule extends BaseModule {
|
|
|
5668
5658
|
await mk('goalPlanPriceForecastUsed', 'Zeit-Ziel Preisprognose verwendet', 'boolean', 'indicator');
|
|
5669
5659
|
await mk('goalPlanFallbackMode', 'Zeit-Ziel Fallbackmodus', 'string', 'text');
|
|
5670
5660
|
|
|
5671
|
-
// Defaults for writable goal states (do not overwrite user choice)
|
|
5672
|
-
try {
|
|
5673
|
-
const st = await this.adapter.getStateAsync(`${ch}.goalEnabled`);
|
|
5674
|
-
const cur = st ? st.val : null;
|
|
5675
|
-
if (cur === null || cur === undefined || String(cur).trim() === '') {
|
|
5676
|
-
await this.adapter.setStateAsync(`${ch}.goalEnabled`, false, true);
|
|
5677
|
-
}
|
|
5678
|
-
} catch {
|
|
5679
|
-
// ignore
|
|
5680
|
-
}
|
|
5681
|
-
|
|
5682
|
-
try {
|
|
5683
|
-
const st = await this.adapter.getStateAsync(`${ch}.goalTargetSocPct`);
|
|
5684
|
-
const cur = st ? Number(st.val) : NaN;
|
|
5685
|
-
if (!Number.isFinite(cur)) {
|
|
5686
|
-
await this.adapter.setStateAsync(`${ch}.goalTargetSocPct`, 100, true);
|
|
5687
|
-
}
|
|
5688
|
-
} catch {
|
|
5689
|
-
// ignore
|
|
5690
|
-
}
|
|
5691
|
-
|
|
5692
|
-
try {
|
|
5693
|
-
const st = await this.adapter.getStateAsync(`${ch}.goalFinishTs`);
|
|
5694
|
-
const cur = st ? Number(st.val) : NaN;
|
|
5695
|
-
if (!Number.isFinite(cur)) {
|
|
5696
|
-
await this.adapter.setStateAsync(`${ch}.goalFinishTs`, 0, true);
|
|
5697
|
-
}
|
|
5698
|
-
} catch {
|
|
5699
|
-
// ignore
|
|
5700
|
-
}
|
|
5701
|
-
|
|
5702
|
-
try {
|
|
5703
|
-
const st = await this.adapter.getStateAsync(`${ch}.goalBatteryKwh`);
|
|
5704
|
-
const cur = st ? Number(st.val) : NaN;
|
|
5705
|
-
if (!Number.isFinite(cur)) {
|
|
5706
|
-
await this.adapter.setStateAsync(`${ch}.goalBatteryKwh`, 0, true);
|
|
5707
|
-
}
|
|
5708
|
-
} catch {
|
|
5709
|
-
// ignore
|
|
5710
|
-
}
|
|
5711
|
-
|
|
5712
5661
|
await mk('effectiveMode', 'Effective mode', 'string', 'text');
|
|
5713
5662
|
await mk('strategyEligible', 'Betriebsstrategie darf in Auto teilnehmen', 'boolean', 'indicator');
|
|
5714
5663
|
await mk('strategyActive', 'Betriebsstrategie-Anforderung aktiv', 'boolean', 'indicator');
|
|
@@ -6162,6 +6111,13 @@ class ChargingManagementModule extends BaseModule {
|
|
|
6162
6111
|
// Budget selection
|
|
6163
6112
|
const budgetMode = String(cfg.totalBudgetMode || 'unlimited'); // unlimited | static | fromPeakShaving | fromDatapoint
|
|
6164
6113
|
const staticBudgetW = clamp(num(cfg.staticMaxChargingPowerW, 0), 0, 1e12);
|
|
6114
|
+
// Eine wirtschaftliche Tarifsperre ist vorübergehend. Die wirksamen festen
|
|
6115
|
+
// Grenzen von Anlage und Station gelten auch im späteren Netzladefenster.
|
|
6116
|
+
const installedCapacityW = num(cfg.infrastructureCapacityW, 0);
|
|
6117
|
+
const goalSiteCapacityW = Math.min(
|
|
6118
|
+
installedCapacityW > 0 ? installedCapacityW : Number.POSITIVE_INFINITY,
|
|
6119
|
+
(budgetMode === 'engine' || budgetMode === 'static') && staticBudgetW > 0 ? staticBudgetW : Number.POSITIVE_INFINITY,
|
|
6120
|
+
);
|
|
6165
6121
|
const budgetPowerId = String(cfg.budgetPowerId || '').trim();
|
|
6166
6122
|
// Optional: provide grid power / PV surplus as explicit datapoints (avoids global Datapoints tab)
|
|
6167
6123
|
const gridPowerId = String(cfg.gridPowerId || '').trim();
|
|
@@ -6374,7 +6330,7 @@ class ChargingManagementModule extends BaseModule {
|
|
|
6374
6330
|
if (!key) continue;
|
|
6375
6331
|
|
|
6376
6332
|
const safe = toSafeIdPart(key);
|
|
6377
|
-
const ch = await this._ensureWallboxChannel(key);
|
|
6333
|
+
const ch = await this._ensureWallboxChannel(key, wb);
|
|
6378
6334
|
const nativeMappingRoots = [...new Set(Object.entries(wb)
|
|
6379
6335
|
.filter(([field, id]) => field.endsWith('Id') && typeof id === 'string')
|
|
6380
6336
|
.map(([_field, id]) => ocppStationRoot(id)).filter(Boolean))];
|
|
@@ -6420,7 +6376,8 @@ class ChargingManagementModule extends BaseModule {
|
|
|
6420
6376
|
}
|
|
6421
6377
|
|
|
6422
6378
|
// Runtime mode override (writable state, used by VIS)
|
|
6423
|
-
//
|
|
6379
|
+
// Read the configured default until a user choice exists. A queued
|
|
6380
|
+
// startup default could otherwise overwrite a concurrent customer write.
|
|
6424
6381
|
let userMode = 'auto';
|
|
6425
6382
|
try {
|
|
6426
6383
|
const st = await this._getStateCached(`${ch}.userMode`);
|
|
@@ -6428,11 +6385,6 @@ class ChargingManagementModule extends BaseModule {
|
|
|
6428
6385
|
const def = normalizeWallboxModeOverride(wb.userModeDefault || wb.userMode || 'auto');
|
|
6429
6386
|
|
|
6430
6387
|
if (cur === null || cur === undefined || String(cur).trim() === '') {
|
|
6431
|
-
try {
|
|
6432
|
-
await this._queueState(`${ch}.userMode`, def, true);
|
|
6433
|
-
} catch {
|
|
6434
|
-
// ignore
|
|
6435
|
-
}
|
|
6436
6388
|
userMode = def;
|
|
6437
6389
|
} else {
|
|
6438
6390
|
userMode = normalizeWallboxModeOverride(cur);
|
|
@@ -6448,7 +6400,6 @@ class ChargingManagementModule extends BaseModule {
|
|
|
6448
6400
|
const configuredDefault = normalizeStrategyAutoSource(wb.userAutoSource || wb.autoSource || 'standard');
|
|
6449
6401
|
if (cur === null || cur === undefined || String(cur).trim() === '') {
|
|
6450
6402
|
userAutoSource = configuredDefault;
|
|
6451
|
-
await this._queueState(`${ch}.userAutoSource`, configuredDefault, true);
|
|
6452
6403
|
} else {
|
|
6453
6404
|
userAutoSource = normalizeStrategyAutoSource(cur);
|
|
6454
6405
|
}
|
|
@@ -6932,6 +6883,8 @@ class ChargingManagementModule extends BaseModule {
|
|
|
6932
6883
|
if (ocppDatapointMappingMigrated) mappingIssues.push('ocpp21_native_mapping_migrated');
|
|
6933
6884
|
|
|
6934
6885
|
let meterAgeMs = 0;
|
|
6886
|
+
const sampleTs = actualPowerWId && this.dp?.getVerifiedMeasurementTimestampMs?.(`cm.wb.${safe}.pW`, now);
|
|
6887
|
+
const meterSampleAgeMs = Number.isFinite(sampleTs) && sampleTs > 0 && sampleTs <= now ? now - sampleTs : null;
|
|
6935
6888
|
let meterStale = false;
|
|
6936
6889
|
if (actualPowerWId && this.dp && typeof this.dp.getAgeMs === 'function') {
|
|
6937
6890
|
const age = this.dp.getAgeMs(`cm.wb.${safe}.pW`);
|
|
@@ -7511,7 +7464,7 @@ class ChargingManagementModule extends BaseModule {
|
|
|
7511
7464
|
|
|
7512
7465
|
try {
|
|
7513
7466
|
const st = await this._getStateCached(`${ch}.goalTargetSocPct`);
|
|
7514
|
-
const v = st
|
|
7467
|
+
const v = st?.val;
|
|
7515
7468
|
goalTargetSocPct = Number.isFinite(v) ? clamp(v, 0, 100) : 100;
|
|
7516
7469
|
} catch {
|
|
7517
7470
|
goalTargetSocPct = 100;
|
|
@@ -8020,6 +7973,8 @@ class ChargingManagementModule extends BaseModule {
|
|
|
8020
7973
|
meterStale: effectiveMeterStale,
|
|
8021
7974
|
meterRawStale: meterStale,
|
|
8022
7975
|
meterAgeMs,
|
|
7976
|
+
meterSampleAgeMs: pWRawNum === null ? null : meterSampleAgeMs,
|
|
7977
|
+
measuredPowerW: pWRawNum !== null && meterSampleAgeMs !== null && meterSampleAgeMs <= wbMeterStaleTimeoutMs && !meterStale ? Math.abs(pWRawNum) : null,
|
|
8023
7978
|
actualPowerWId,
|
|
8024
7979
|
telemetryProfile,
|
|
8025
7980
|
telemetryAutoDetected,
|
|
@@ -8526,7 +8481,7 @@ class ChargingManagementModule extends BaseModule {
|
|
|
8526
8481
|
const deltaSoc = Number(w.goalDeltaSocPct);
|
|
8527
8482
|
if (!Number.isFinite(deltaSoc) || deltaSoc <= 0) return { override: false, reason: 'no_need' };
|
|
8528
8483
|
|
|
8529
|
-
const maxP = runtimeChargingMaximumW(w);
|
|
8484
|
+
const maxP = deadlineChargingCapacityW(runtimeChargingMaximumW(w), goalSiteCapacityW, w.stationKey, w.stationMaxPowerW);
|
|
8530
8485
|
if (!Number.isFinite(maxP) || maxP <= 0) return { override: true, reason: 'no_power' };
|
|
8531
8486
|
|
|
8532
8487
|
const battUser = Number(w.goalBatteryKwhUser);
|
|
@@ -8640,6 +8595,7 @@ class ChargingManagementModule extends BaseModule {
|
|
|
8640
8595
|
}
|
|
8641
8596
|
|
|
8642
8597
|
// Boost runtime timer: starts when the chargepoint is actually charging in boost mode
|
|
8598
|
+
w.goalTariffOverrideReason = goalTariffOverrideReason;
|
|
8643
8599
|
let boostSince = this._boostSinceMs.get(w.safe) || 0;
|
|
8644
8600
|
let boostUntil = 0;
|
|
8645
8601
|
let boostRemainingMin = 0;
|
|
@@ -8736,6 +8692,9 @@ class ChargingManagementModule extends BaseModule {
|
|
|
8736
8692
|
eff = zeroPolicy.effectiveMode;
|
|
8737
8693
|
w.zeroExportGridMaxW = zeroPolicy.gridMaxW;
|
|
8738
8694
|
w.effectiveMode = eff;
|
|
8695
|
+
// Tarifentscheidung dieses Ladepunkts für die spätere Zielplanung
|
|
8696
|
+
// erhalten. Ein fremder Boost kann das gemeinsame Netzbudget öffnen.
|
|
8697
|
+
w.goalGridBlocked = eff === 'pv' && (pvSurplusOnlyCfg || forcePvForW);
|
|
8739
8698
|
w._boostTimedOut = boostTimedOut;
|
|
8740
8699
|
w._boostNotAllowed = boostNotAllowed;
|
|
8741
8700
|
w._boostTimeoutMinEffective = effBoostTimeoutMin;
|
|
@@ -11067,7 +11026,7 @@ if (components.length) {
|
|
|
11067
11026
|
|
|
11068
11027
|
const goalPlanBySafe = buildRuntimeGoalPlanMap({
|
|
11069
11028
|
now, wallboxes: sorted, budgetW, staticBudgetW,
|
|
11070
|
-
infrastructureCapacityW:
|
|
11029
|
+
infrastructureCapacityW: Number.isFinite(goalSiteCapacityW) ? goalSiteCapacityW : 0,
|
|
11071
11030
|
totalActualW: totalFreshActualPowerW,
|
|
11072
11031
|
loadRestW: this._getAdapterNumberFromCache('derived.core.building.loadRestW', null),
|
|
11073
11032
|
loadTotalW: this._getAdapterNumberFromCache('derived.core.building.loadTotalW', null),
|
|
@@ -11185,10 +11144,14 @@ if (components.length) {
|
|
|
11185
11144
|
const selectedMode = normalizeWallboxModeOverride(w.userMode);
|
|
11186
11145
|
const goalPlan = w.goalPlan && typeof w.goalPlan === 'object' ? w.goalPlan : null;
|
|
11187
11146
|
let effMode = resolvePlanEffectiveMode(w.userMode, w.effectiveMode, goalPlan, w.strategyOverlay, w.userAutoSource);
|
|
11147
|
+
if (goalPlan?.active === true && w.goalGridBlocked) effMode = 'pv';
|
|
11188
11148
|
if (zeroExportChargingActive && selectedMode === 'auto' && goalPlan?.action === 'charge' && goalPlan.source === 'pv') effMode = 'pv';
|
|
11189
|
-
//
|
|
11190
|
-
//
|
|
11191
|
-
if (zeroExportChargingActive
|
|
11149
|
+
// Bei Nulleinspeisung erhalten Diagnose und Writer den im Zielplan
|
|
11150
|
+
// aufgelösten Untermodus. Die gespeicherte Bedienvorgabe bleibt Auto.
|
|
11151
|
+
if (zeroExportChargingActive && effMode !== w.effectiveMode) {
|
|
11152
|
+
w.effectiveMode = effMode;
|
|
11153
|
+
await this._queueState(`${w.ch}.effectiveMode`, effMode, true);
|
|
11154
|
+
}
|
|
11192
11155
|
const isPvOnly = effMode === 'pv';
|
|
11193
11156
|
const isMinPv = effMode === 'minpv';
|
|
11194
11157
|
const isBoost = effMode === 'boost';
|
|
@@ -11458,6 +11421,7 @@ if (components.length) {
|
|
|
11458
11421
|
const planned = applyGoalPlan({
|
|
11459
11422
|
plan: goalPlan, userMode: w.userMode, effectiveMode: effMode,
|
|
11460
11423
|
targetW, targetA, minPowerW: w.minPW, maxPowerW: modeMaxW,
|
|
11424
|
+
availablePvW: pvAvailW,
|
|
11461
11425
|
totalAvailableW: fairTotalAvailW, stationAvailableW: fairStationAvailW,
|
|
11462
11426
|
});
|
|
11463
11427
|
targetW = planned.targetW; targetA = planned.targetA;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/ems/services/admin-overview-publisher.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:b13e20562f86bda73731f04330fd5b73c824a5ea21d14ab2b7eadd3890cd1896
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -845,6 +845,7 @@ class AdminOverviewPublisher {
|
|
|
845
845
|
this.cycleWriteErrors = 0;
|
|
846
846
|
this.cycleLastError = '';
|
|
847
847
|
this.adapter = adapter;
|
|
848
|
+
this.publishToHost = typeof adapter.publishAdminOverviewJson === 'function' && adapter.hostNamespace !== adapter.namespace;
|
|
848
849
|
this.intervalMs = Math.max(1000, Math.round(finite(options.intervalMs, DEFAULT_PUBLISH_INTERVAL_MS)));
|
|
849
850
|
this.heartbeatIntervalMs = Math.max(500, Math.round(finite(options.heartbeatIntervalMs, DEFAULT_HEARTBEAT_INTERVAL_MS)));
|
|
850
851
|
this.readTimeoutMs = Math.max(20, Math.round(finite(options.readTimeoutMs, DEFAULT_STATE_READ_TIMEOUT_MS)));
|
|
@@ -1106,9 +1107,6 @@ class AdminOverviewPublisher {
|
|
|
1106
1107
|
async readState(id) {
|
|
1107
1108
|
return this.runOperation('read', `state:${id}`, this.readTimeoutMs, async () => this.adapter.getStateAsync(id));
|
|
1108
1109
|
}
|
|
1109
|
-
async writeState(id, value) {
|
|
1110
|
-
return this.runOperation('write', `state:${id}`, this.writeTimeoutMs, async () => (this.adapter.setStateAsync(id, { val: value, ack: true })));
|
|
1111
|
-
}
|
|
1112
1110
|
async ensureObject(id, object) {
|
|
1113
1111
|
const result = await this.runOperation('write', `object:${id}`, this.objectTimeoutMs, async () => this.adapter.setObjectNotExistsAsync(id, object));
|
|
1114
1112
|
if (!result.ok)
|
|
@@ -1341,12 +1339,20 @@ class AdminOverviewPublisher {
|
|
|
1341
1339
|
const signature = typeof value === 'string' ? value : JSON.stringify(value);
|
|
1342
1340
|
if (!force && this.lastValues.get(id) === signature)
|
|
1343
1341
|
return true;
|
|
1344
|
-
const
|
|
1342
|
+
const localWrite = this.runOperation('write', `state:${id}`, this.writeTimeoutMs, () => this.adapter.setStateAsync(id, { val: value, ack: true }));
|
|
1343
|
+
const hostWrite = this.publishToHost && (id === 'info.adminOverview.summaryJson' || id === 'info.adminOverview.eventsJson')
|
|
1344
|
+
? this.runOperation('write', `admin:${id}`, this.writeTimeoutMs, () => this.adapter.publishAdminOverviewJson(id, value))
|
|
1345
|
+
: null;
|
|
1346
|
+
const write = await localWrite;
|
|
1345
1347
|
// Cache the signature only after a confirmed write. A timed-out write must
|
|
1346
1348
|
// be retried later instead of being mistaken for an already published value.
|
|
1347
|
-
|
|
1349
|
+
const hostResult = hostWrite ? await hostWrite : null;
|
|
1350
|
+
const confirmed = write.ok && !write.reused && (!hostResult || (hostResult.ok && !hostResult.reused));
|
|
1351
|
+
if (confirmed)
|
|
1348
1352
|
this.lastValues.set(id, signature);
|
|
1349
|
-
|
|
1353
|
+
else
|
|
1354
|
+
this.lastValues.delete(id);
|
|
1355
|
+
return confirmed;
|
|
1350
1356
|
}
|
|
1351
1357
|
}
|
|
1352
1358
|
module.exports = {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/ems/services/charging-management-audit.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:3f5d3655f69e5853b9bf3748e8d66916457fcacef1202bfe45e44fa8ce56c0dc
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -193,6 +193,7 @@ function buildChargingAuditSnapshot(input = {}) {
|
|
|
193
193
|
charging: row.charging === true,
|
|
194
194
|
meterStale: row.meterStale === true || row.staleAny === true,
|
|
195
195
|
statusClass: compactChargingAuditText(row.statusClass || '', 80),
|
|
196
|
+
statusFresh: rt.statusFresh === true,
|
|
196
197
|
statusEffective: compactChargingAuditText(row.statusEffective || '', 120),
|
|
197
198
|
faultActive: row.faultActive === true,
|
|
198
199
|
faultReason: compactChargingAuditText(row.faultReason || '', 180),
|
|
@@ -201,6 +202,16 @@ function buildChargingAuditSnapshot(input = {}) {
|
|
|
201
202
|
minimumPowerW: Math.max(0, finiteChargingAuditNumber(row.minPW, finiteChargingAuditNumber(row.minPowerW, 0))),
|
|
202
203
|
phaseCount: Math.max(1, Math.min(3, finiteChargingAuditNumber(row.phases, finiteChargingAuditNumber(row.phaseCount, 1)))),
|
|
203
204
|
actualPowerW: Math.round(actualW),
|
|
205
|
+
// The regulator may hold a previous value or assume zero. Only the
|
|
206
|
+
// independently timestamped meter sample belongs in the measured column.
|
|
207
|
+
measuredPowerW: Number.isFinite(rt.measuredPowerW) ? Math.round(rt.measuredPowerW) : null,
|
|
208
|
+
measurementQuality: Number.isFinite(rt.measuredPowerW) ? 'measured' : (Number.isFinite(rt.meterSampleAgeMs) ? 'stale' : 'missing'),
|
|
209
|
+
meterSampleAgeMs: Number.isFinite(rt.meterSampleAgeMs) ? rt.meterSampleAgeMs : null,
|
|
210
|
+
goalEnabled: typeof rt.goalEnabled === 'boolean' ? rt.goalEnabled : null,
|
|
211
|
+
goalFinishTs: Number.isSafeInteger(rt.goalFinishTs) && rt.goalFinishTs > 0 ? rt.goalFinishTs : null,
|
|
212
|
+
goalVehicleSocPct: Number.isFinite(rt.goalVehicleSocPct) ? rt.goalVehicleSocPct : null,
|
|
213
|
+
goalTargetSocPct: Number.isFinite(rt.goalTargetSocPct) ? rt.goalTargetSocPct : null,
|
|
214
|
+
goalTariffOverrideReason: compactChargingAuditText(rt.goalTariffOverrideReason, 80),
|
|
204
215
|
requestedPowerW: Math.max(0, Math.round(requestedW || 0)),
|
|
205
216
|
requestedCurrentA: Math.max(0, Math.round((requestedA || 0) * 10) / 10),
|
|
206
217
|
targetPowerW: Math.round(targetW),
|
|
@@ -228,8 +239,12 @@ function buildChargingAuditSnapshot(input = {}) {
|
|
|
228
239
|
record.limiter = deriveChargingAuditLimiter(record, globalBase);
|
|
229
240
|
return record;
|
|
230
241
|
});
|
|
242
|
+
const measuredTotalW = wallboxes.length && wallboxes.every(point => point.measuredPowerW !== null)
|
|
243
|
+
? wallboxes.reduce((sum, point) => sum + point.measuredPowerW, 0) : null;
|
|
231
244
|
const snapshot = {
|
|
232
245
|
schemaVersion: 1,
|
|
246
|
+
measuredPowerW: measuredTotalW,
|
|
247
|
+
measurementQuality: measuredTotalW === null ? 'incomplete' : 'measured',
|
|
233
248
|
ts,
|
|
234
249
|
context: compactChargingAuditText(input.context || 'normal', 80),
|
|
235
250
|
mode: compactChargingAuditText(input.mode || '', 64),
|
|
@@ -322,6 +337,9 @@ function chargingAuditEventSignature(snapshot) {
|
|
|
322
337
|
row.online ? 1 : 0,
|
|
323
338
|
row.connected ? 1 : 0,
|
|
324
339
|
row.vehicleDemandConfirmed ? 1 : 0,
|
|
340
|
+
row.measurementQuality,
|
|
341
|
+
row.measuredPowerW === null ? '' : Math.round(row.measuredPowerW / 100),
|
|
342
|
+
row.goalEnabled, row.goalFinishTs, row.goalTargetSocPct, row.goalVehicleSocPct, row.goalTariffOverrideReason,
|
|
325
343
|
Math.round(Number(row.actualPowerW || 0) / 100) * 100,
|
|
326
344
|
Math.round(Number(row.requestedPowerW || 0) / 50) * 50,
|
|
327
345
|
Math.round(Number(row.targetPowerW || 0) / 50) * 50,
|
|
@@ -380,6 +398,8 @@ function buildChargingAuditEvents(previousSnapshot, snapshot, options = {}) {
|
|
|
380
398
|
name: 'Lademanagement',
|
|
381
399
|
mode: snapshot.mode,
|
|
382
400
|
actualPowerW: snapshot.actualPowerW,
|
|
401
|
+
measuredPowerW: snapshot.measuredPowerW,
|
|
402
|
+
measurementQuality: snapshot.measurementQuality,
|
|
383
403
|
requestedPowerW: snapshot.targetPowerW,
|
|
384
404
|
targetPowerW: snapshot.targetPowerW,
|
|
385
405
|
targetCurrentA: 0,
|
|
@@ -399,6 +419,7 @@ function buildChargingAuditEvents(previousSnapshot, snapshot, options = {}) {
|
|
|
399
419
|
const changed = !previous || [
|
|
400
420
|
'mode', 'userMode', 'vehicleDemandReason', 'statusEffective', 'online', 'enabled', 'connected', 'vehicleDemandConfirmed', 'charging',
|
|
401
421
|
'actualPowerW', 'requestedPowerW', 'targetPowerW', 'targetCurrentA',
|
|
422
|
+
'measuredPowerW', 'measurementQuality', 'goalEnabled', 'goalFinishTs', 'goalVehicleSocPct', 'goalTargetSocPct', 'goalTariffOverrideReason',
|
|
402
423
|
'reservedPowerW', 'pvShareW', 'storageShareW', 'limiter', 'reason',
|
|
403
424
|
'applyStatus', 'safetyBinding', 'safetyReason', 'stationRemainingW',
|
|
404
425
|
].some((key) => previous[key] !== row[key]);
|
|
@@ -431,6 +452,14 @@ function buildChargingAuditEvents(previousSnapshot, snapshot, options = {}) {
|
|
|
431
452
|
vehicleDemandReason: row.vehicleDemandReason,
|
|
432
453
|
statusEffective: row.statusEffective,
|
|
433
454
|
actualPowerW: row.actualPowerW,
|
|
455
|
+
measuredPowerW: row.measuredPowerW,
|
|
456
|
+
measurementQuality: row.measurementQuality,
|
|
457
|
+
meterSampleAgeMs: row.meterSampleAgeMs,
|
|
458
|
+
goalEnabled: row.goalEnabled,
|
|
459
|
+
goalFinishTs: row.goalFinishTs,
|
|
460
|
+
goalVehicleSocPct: row.goalVehicleSocPct,
|
|
461
|
+
goalTargetSocPct: row.goalTargetSocPct,
|
|
462
|
+
goalTariffOverrideReason: row.goalTariffOverrideReason,
|
|
434
463
|
requestedPowerW: row.requestedPowerW,
|
|
435
464
|
targetPowerW: row.targetPowerW,
|
|
436
465
|
targetCurrentA: row.targetCurrentA,
|
|
@@ -458,6 +487,8 @@ function buildChargingAuditEvents(previousSnapshot, snapshot, options = {}) {
|
|
|
458
487
|
name: 'Lademanagement',
|
|
459
488
|
mode: snapshot.mode,
|
|
460
489
|
actualPowerW: snapshot.actualPowerW,
|
|
490
|
+
measuredPowerW: snapshot.measuredPowerW,
|
|
491
|
+
measurementQuality: snapshot.measurementQuality,
|
|
461
492
|
requestedPowerW: snapshot.targetPowerW,
|
|
462
493
|
targetPowerW: snapshot.targetPowerW,
|
|
463
494
|
targetCurrentA: 0,
|