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.
Files changed (77) hide show
  1. package/NEXOWATT_EOS_BUILD_INFO.json +12 -10
  2. package/README.md +10 -2
  3. package/adminWww/.vite/manifest.json +114 -114
  4. package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +13759 -13759
  5. package/adminWww/assets/{AdapterUpdateDialog-D4gUYZep.js → AdapterUpdateDialog-DDmYbnK4.js} +1 -1
  6. package/adminWww/assets/{Adapters-DLxiJc3y.js → Adapters-73Uo4VUy.js} +1 -1
  7. package/adminWww/assets/{ConfigManager-D_YTKUdP.js → ConfigManager-DoFx_j4o.js} +1 -1
  8. package/adminWww/assets/{Enums-D79rON6b.js → Enums-BRQSAW9I.js} +1 -1
  9. package/adminWww/assets/{Fields-CTOv49EU.js → Fields-pcmISvLk.js} +1 -1
  10. package/adminWww/assets/{Files-DNLzjEG5.js → Files-E8-7c9Ab.js} +1 -1
  11. package/adminWww/assets/{Hosts-DHNboUMq.js → Hosts-D4a3shrq.js} +1 -1
  12. package/adminWww/assets/{Instances-BJxYNJAC.js → Instances-ByxEHRoo.js} +1 -1
  13. package/adminWww/assets/{Intro-8R-Q7CR_.js → Intro-DFriWa6g.js} +1 -1
  14. package/adminWww/assets/{Logs-CjAPhWuK.js → Logs-BXR0h5Sz.js} +1 -1
  15. package/adminWww/assets/{Objects-cvdqooGe.js → Objects-h6jg_6uT.js} +1 -1
  16. package/adminWww/assets/{Overview-JPfBOuKv.js → Overview-B39PiMGJ.js} +1 -1
  17. package/adminWww/assets/{State-CGnvMceJ.js → State-CqF2ARx_.js} +1 -1
  18. package/adminWww/assets/{UsedResources-FBd9jThR.js → UsedResources-CnbnoF3d.js} +1 -1
  19. package/adminWww/assets/{Users-BbUu3hZj.js → Users-BQik0rIi.js} +1 -1
  20. package/adminWww/assets/{bootstrap-Df_WTIJg.js → bootstrap-Dllnekqb.js} +3 -3
  21. package/adminWww/assets/{hostInit-BQCRqFay.js → hostInit-CQbS-SCS.js} +1 -1
  22. package/adminWww/assets/{icons-material-DS82xOs8.js → icons-material-rYFYu2DM.js} +1 -1
  23. package/adminWww/assets/{index-BlBZd8r8.js → index-BzbVZbb2.js} +2 -2
  24. package/adminWww/assets/{installSVGRenderer-BtlXF9y3.js → installSVGRenderer-DbH6B8B8.js} +1 -1
  25. package/adminWww/assets/{mf-entry-bootstrap-0-8bb11ea2.js → mf-entry-bootstrap-0-4dee1225.js} +2 -2
  26. package/adminWww/index.html +23 -23
  27. package/adminWww/mf-manifest.json +1 -1
  28. package/adminWww/mf-stats.json +1 -1
  29. package/adminWww/remoteEntry-eos-9.0.39.js +12 -0
  30. package/adminWww/remoteEntry.js +1 -1
  31. package/docs/README.md +1 -0
  32. package/docs/reports/EMS_ZIELLADEN_2026-11-28.md +45 -0
  33. package/docs/reports/unified-9.0.39/PRUEFBERICHT.md +48 -0
  34. package/docs/reports/unified-9.0.39/raw/INDEX.json +51 -0
  35. package/docs/reports/unified-9.0.39/raw/node22-tests-final.log +18189 -0
  36. package/docs/reports/unified-9.0.39/raw/node22-version.log +1 -0
  37. package/docs/reports/unified-9.0.39/raw/node24-tests-final.log +3129 -0
  38. package/docs/reports/unified-9.0.39/raw/node24-version.log +1 -0
  39. package/docs/reports/unified-9.0.39/raw/npm-runtime-audit.json +77 -0
  40. package/docs/reports/unified-9.0.39/raw/overnight-simulation.json +117 -0
  41. package/docs/start/START_HIER_9.0.39.md +14 -0
  42. package/io-package.json +8 -8
  43. package/modules/ocpp/README.md +2 -0
  44. package/modules/ocpp/ocpp/common.js +64 -40
  45. package/modules/ocpp/ocpp/eos-contract.js +8 -3
  46. package/modules/ocpp/runtime.js +10 -5
  47. package/modules/ocpp/test/eos-contract.test.js +67 -0
  48. package/modules/ocpp/test/hosted.test.cjs +29 -1
  49. package/package.json +7 -3
  50. package/release-manifests/unified/build-environment.cdx.json +6 -6
  51. package/release-manifests/unified/files.json +123 -109
  52. package/release-manifests/unified/frontend.cdx.json +6 -6
  53. package/release-manifests/unified/installer.cdx.json +6 -6
  54. package/release-manifests/unified/obsolete-admin-assets.json +83 -0
  55. package/release-manifests/unified/runtime.cdx.json +27 -27
  56. package/release-manifests/unified/validation.json +17 -17
  57. package/tools/eos-release-manifest.cjs +2 -0
  58. package/ui/docs/STATES_AND_DATAPOINTS_DE.md +132 -0
  59. package/ui/ems/engine.js +5 -3
  60. package/ui/ems/evcs-control-mapping.js +13 -1
  61. package/ui/ems/modules/charging-management.js +40 -76
  62. package/ui/ems/services/admin-overview-publisher.js +13 -7
  63. package/ui/ems/services/charging-management-audit.js +32 -1
  64. package/ui/ems/services/forecast-aware-target-planner.js +12 -5
  65. package/ui/ems/services/forecast-target-runtime-bridge.js +12 -5
  66. package/ui/io-package.json +5 -1
  67. package/ui/lib/charging-point-identity.js +91 -16
  68. package/ui/lib/hosted-adapter.js +35 -1
  69. package/ui/main.js +69 -41
  70. package/ui/package.json +1 -1
  71. package/ui/www/app.js +57 -72
  72. package/ui/www/charging-diagnostics-appcenter.js +12 -7
  73. package/ui/www/dashboard-lp-status.js +19 -12
  74. package/ui/www/evcs.js +71 -98
  75. package/ui/www/licenses/smarthome-markdown-components.json +156 -156
  76. package/ui/www/manifest.webmanifest +2 -2
  77. package/adminWww/remoteEntry-eos-9.0.38.js +0 -12
@@ -7,7 +7,7 @@
7
7
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
8
8
  *
9
9
  * Quelle: src-ts/runtime-executables/ems/services/forecast-aware-target-planner.ts
10
- * Quell-Hash: sha256:b4554e95c51e6ce27126e465b3c862db16aca544587f50c47eef2ab21ca5bb42
10
+ * Quell-Hash: sha256:586652fb51a5dc793358c8da4d468730126e3d23cd8e57a147e748572fa71425
11
11
  * Erzeugung: npm run sync:ts-runtime-executables
12
12
  *
13
13
  * Zweck:
@@ -30,6 +30,7 @@
30
30
  */
31
31
  'use strict';
32
32
  Object.defineProperty(exports, "__esModule", { value: true });
33
+ exports.deadlineChargingCapacityW = deadlineChargingCapacityW;
33
34
  exports.buildForecastAwareTargetPlans = buildForecastAwareTargetPlans;
34
35
  const HOUR_MS = 3600000;
35
36
  function finite(value, fallback = 0) {
@@ -140,6 +141,12 @@ function stationRemaining(slot, goal) {
140
141
  ? Number.POSITIVE_INFINITY
141
142
  : Math.max(0, cap - (slot.stationUsedW.get(key) || 0));
142
143
  }
144
+ /** Maximal für ein Fahrzeug planbare W bis zur Abfahrt, vor zeitabhängigen Netz-/Gerätesperren. */
145
+ function deadlineChargingCapacityW(deviceMaxW, siteCapW, stationKey, stationCapW) {
146
+ const stationLimitW = stationKey && typeof stationCapW === 'number' && stationCapW > 0
147
+ ? stationCapW : Number.POSITIVE_INFINITY;
148
+ return Math.max(0, Math.min(deviceMaxW, siteCapW, stationLimitW));
149
+ }
143
150
  function availablePower(slot, goal, source) {
144
151
  const siteRemaining = Math.max(0, slot.siteCapW - slot.siteUsedW);
145
152
  const stationCap = stationRemaining(slot, goal);
@@ -354,15 +361,14 @@ function buildForecastAwareTargetPlans(input) {
354
361
  // PV ist bereits in den Slots eingeplant. Die verbleibende Netzenergie
355
362
  // muss mit dem kleineren LP-Netzanteil rechtzeitig beginnen können.
356
363
  const latestStartEnergyWh = gridLimited ? Math.max(0, goal.requiredWh - goal.plannedPvWh) : goal.requiredWh;
357
- const latestStartPowerW = gridLimited ? Math.min(goal.request.maxPowerW, goal.request.maxGridPowerW) : goal.request.maxPowerW;
364
+ const gridLimitW = typeof goal.request.maxGridPowerW === 'number' ? Math.max(0, goal.request.maxGridPowerW) : goal.request.maxPowerW;
365
+ const latestStartPowerW = deadlineChargingCapacityW(Math.min(goal.request.maxPowerW, gridLimitW), slots[0]?.siteCapW ?? 0, goal.request.stationKey, goal.request.stationCapW);
358
366
  const latestStartMs = goal.request.deadlineMs - Math.ceil((latestStartEnergyWh / Math.max(1, latestStartPowerW)) * HOUR_MS) - reserveMs;
359
367
  const deadlineOverride = nowMs >= latestStartMs || !targetReachable;
360
- const fallbackMaxW = gridLimited
361
- ? Math.min(goal.request.maxPowerW, Math.max(0, goal.request.maxGridPowerW)) : goal.request.maxPowerW;
362
368
  const plannedNowW = current.totalW > 0
363
369
  ? current.totalW
364
370
  : deadlineOverride && gridPlanningAllowed
365
- ? (gridLimited && fallbackMaxW + 1e-6 < goal.request.minPowerW ? 0 : Math.min(fallbackMaxW, Math.max(goal.request.minPowerW, goal.requiredWh / Math.max(0.05, (goal.request.deadlineMs - nowMs) / HOUR_MS))))
371
+ ? (latestStartPowerW + 1e-6 < goal.request.minPowerW ? 0 : Math.min(latestStartPowerW, Math.max(goal.request.minPowerW, goal.requiredWh / Math.max(0.05, (goal.request.deadlineMs - nowMs) / HOUR_MS))))
366
372
  : 0;
367
373
  const action = goal.requiredWh <= 1
368
374
  ? 'complete'
@@ -392,6 +398,7 @@ function buildForecastAwareTargetPlans(input) {
392
398
  reason,
393
399
  source,
394
400
  plannedNowW: Math.round(Math.max(0, plannedNowW)),
401
+ plannedNowPvW: Math.floor(current.pvW),
395
402
  requiredWh: Math.round(goal.requiredWh),
396
403
  plannedWh: Math.round(goal.plannedWh),
397
404
  plannedPvWh: Math.round(goal.plannedPvWh),
@@ -7,7 +7,7 @@
7
7
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
8
8
  *
9
9
  * Quelle: src-ts/runtime-executables/ems/services/forecast-target-runtime-bridge.ts
10
- * Quell-Hash: sha256:b3fa680266f755dea6a6618d356da16e711836d7fedf4fb3d8a8636699d4e793
10
+ * Quell-Hash: sha256:730134655b085f11065b65e38c6973960cf47a19dee5c62e0d3c84fd8dd5f36c
11
11
  * Erzeugung: npm run sync:ts-runtime-executables
12
12
  *
13
13
  * Zweck:
@@ -225,17 +225,24 @@ function applyGoalPlan(input) {
225
225
  return { targetW: 0, targetA: 0, reasonHint: 'no-setpoint' };
226
226
  if (action !== 'charge')
227
227
  return { targetW: 0, targetA: 0, reasonHint: 'budget' };
228
- if (String(input.effectiveMode || '') === 'pv' && String(plan.source || '') !== 'pv') {
229
- return { targetW: 0, targetA: 0, reasonHint: 'no-setpoint' };
228
+ let pvLimitW = Number.POSITIVE_INFINITY;
229
+ if (input.effectiveMode === 'pv' && plan.source !== 'pv') {
230
+ // A mixed slot can retain this connector's own PV share while grid is
231
+ // blocked. Only the ordinary live PV allocation may supply this power.
232
+ if (plan.source !== 'mixed' || !Number.isFinite(input.availablePvW) || !Number.isFinite(plan.plannedNowPvW)) {
233
+ return { targetW: 0, targetA: 0, reasonHint: 'no-setpoint' };
234
+ }
235
+ pvLimitW = Math.max(0, Math.min(input.availablePvW, plan.plannedNowPvW, finite(input.targetW, 0)));
230
236
  }
231
237
  const maxPowerW = Math.max(0, finite(input.maxPowerW, 0));
232
238
  const minPowerW = Math.max(0, finite(input.minPowerW, 0));
233
239
  const requestedW = Math.min(maxPowerW, Math.max(minPowerW, finite(plan.plannedNowW, 0)));
234
- const hardCapW = Math.max(0, Math.min(finite(input.totalAvailableW, Number.POSITIVE_INFINITY), finite(input.stationAvailableW, Number.POSITIVE_INFINITY), maxPowerW || Number.POSITIVE_INFINITY));
240
+ const hardCapW = Math.max(0, Math.min(finite(input.totalAvailableW, Number.POSITIVE_INFINITY), finite(input.stationAvailableW, Number.POSITIVE_INFINITY), pvLimitW, maxPowerW || Number.POSITIVE_INFINITY));
235
241
  const targetW = Math.min(requestedW, hardCapW);
236
242
  if (targetW <= 0)
237
243
  return { targetW: 0, targetA: 0, reasonHint: 'budget' };
238
- if (minPowerW > 0 && targetW + 1 < minPowerW)
244
+ const roundingToleranceW = Number.isFinite(pvLimitW) ? 0 : 1;
245
+ if (minPowerW > 0 && targetW + roundingToleranceW < minPowerW)
239
246
  return { targetW: 0, targetA: 0, reasonHint: 'below-min' };
240
247
  return { targetW, targetA: 0, reasonHint: 'allocated' };
241
248
  }
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "nexowatt-ui",
4
- "version": "9.0.38",
4
+ "version": "9.0.39",
5
5
  "news": {
6
+ "9.0.39": {
7
+ "de": "EOS erhält Modus und Ladeziel derselben Wallbox und berücksichtigt feste Leistungsgrenzen beim Ladestart. Im Energiefluss zählen gemessene OCPP-Leistung und gemeinsame Stationszähler mit ihrer Messzeit. Im Ladeprotokoll sind Anforderung und Istleistung unterscheidbar. Die EMS-Diagnose steht nach der Bestandsübernahme auch im Admin bereit.",
8
+ "en": "EOS preserves the charging mode and departure target for the same connector and accounts for fixed power limits when scheduling. The energy flow uses timestamped OCPP measurements and counts shared meters once. The charging log distinguishes requested and measured power. Admin shows EMS diagnostics after migration."
9
+ },
6
10
  "9.0.38": {
7
11
  "de": "Die Bestandsübernahme lässt sich im Admin starten oder erneut prüfen. Auch bei bereits beendeten Altadaptern prüft EOS Konfiguration und Historienanbindung.",
8
12
  "en": "Administrators can start or recheck migration. EOS checks the configuration and history connection even when the legacy adapters have already stopped."
@@ -2,7 +2,7 @@
2
2
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
3
3
  *
4
4
  * Quelle: src-ts/runtime-executables/lib/charging-point-identity.ts
5
- * Quell-Hash: sha256:6db008926f84201dda3c8ef6f3391e56fcda0f771eb61fda7b14bf210b6c3f93
5
+ * Quell-Hash: sha256:5e994f818deb4033eed93a48c26f68b35285d7f27e899b4e985e3fbfcfe7ff29
6
6
  * Erzeugung: npm run sync:ts-runtime-executables
7
7
  *
8
8
  * Zweck:
@@ -19,6 +19,7 @@
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
20
  exports.getChargingControlIdentity = exports.CHARGING_IDENTITY_STATE = void 0;
21
21
  exports.beginChargingControlWrite = beginChargingControlWrite;
22
+ exports.configuredChargingPointRows = configuredChargingPointRows;
22
23
  exports.chargingPointLayout = chargingPointLayout;
23
24
  exports.remapChargingPointDefaultModes = remapChargingPointDefaultModes;
24
25
  exports.chargingPointLayoutChanged = chargingPointLayoutChanged;
@@ -69,8 +70,30 @@ function rowsOf(input) {
69
70
  throw fail('EOS_EVCS_IDENTITY_LAYOUT_INVALID');
70
71
  return input;
71
72
  }
73
+ /** Operator-configured slots outlive a temporarily reduced license. Use resolved
74
+ * runtime mappings where available and preserve the rest of the configured list. */
75
+ function configuredChargingPointRows(settings, active) {
76
+ const live = active === undefined ? [] : rowsOf(active);
77
+ if (settings == null)
78
+ return live;
79
+ if (!record(settings))
80
+ throw fail('EOS_EVCS_IDENTITY_LAYOUT_INVALID');
81
+ if (settings.evcsList === undefined && settings.evcsCount == null)
82
+ return live;
83
+ // Even a currently unlicensed slot must have a valid saved row. Runtime
84
+ // normalization can turn malformed input into an empty placeholder.
85
+ const saved = settings.evcsList === undefined ? [] : rowsOf(settings.evcsList);
86
+ const raw = settings.evcsCount;
87
+ const countText = typeof raw === 'string' ? raw.trim() : raw;
88
+ const count = countText == null || countText === '' ? saved.length
89
+ : typeof countText === 'string' && /^\d+$/.test(countText) ? Number(countText) : countText;
90
+ if (typeof count !== 'number' || !Number.isSafeInteger(count) || count < 0 || count > MAX_ROWS) {
91
+ throw fail('EOS_EVCS_IDENTITY_LAYOUT_INVALID');
92
+ }
93
+ return Array.from({ length: count }, (_, index) => live[index] ?? saved[index] ?? {});
94
+ }
72
95
  /** No names, array positions or credentials are stored as physical identity. */
73
- function identity(row, slot, namespace) {
96
+ function physicalAddress(row, slot, namespace) {
74
97
  for (const key of ['setPowerWId', 'setCurrentAId', 'enableWriteId', 'powerId', 'energyTotalId', 'statusId', 'onlineId', 'activeId', 'lockWriteId', 'phaseSwitchId', 'modeId']) {
75
98
  const value = row[key];
76
99
  if (value === undefined || value === null || value === '')
@@ -85,10 +108,15 @@ function identity(row, slot, namespace) {
85
108
  const connector = row.connectorNo === undefined || row.connectorNo === null || row.connectorNo === '' || Number(row.connectorNo) === 0 ? 1 : Number(row.connectorNo);
86
109
  if (!Number.isSafeInteger(connector) || connector < 1 || connector > 1024)
87
110
  throw fail('EOS_EVCS_IDENTITY_LAYOUT_INVALID');
88
- return (0, node_crypto_1.createHash)('sha256').update(JSON.stringify([target, connector])).digest('hex');
111
+ return { target, connector };
89
112
  }
90
113
  return null;
91
114
  }
115
+ const physicalHash = (target, connector) => (0, node_crypto_1.createHash)('sha256').update(JSON.stringify([target, connector])).digest('hex');
116
+ function identity(row, slot, namespace) {
117
+ const address = physicalAddress(row, slot, namespace);
118
+ return address ? physicalHash(address.target, address.connector) : null;
119
+ }
92
120
  function commandIdentity(row, slot, namespace, bridges) {
93
121
  const targets = [];
94
122
  for (const key of ['setPowerWId', 'setCurrentAId', 'enableWriteId', 'activeId', 'lockWriteId', 'phaseSwitchId', 'modeId']) {
@@ -199,16 +227,17 @@ function publicChargingControlIdentity(adapter, rows) {
199
227
  const value = confirmed.get(adapter);
200
228
  if (!value || adapter._nwEvcsIdentityTransitionPending)
201
229
  return { revision: '', slots: {} };
230
+ const visible = Array.isArray(adapter.evcsList) ? value.layout.slice(0, adapter.evcsList.length) : value.layout;
202
231
  if (rows !== undefined) {
203
232
  try {
204
- if (!sameLayout(value.layout, chargingPointLayout(rows, adapter.config?.chargeKiosk, adapter.namespace)))
233
+ if (!sameLayout(visible, chargingPointLayout(rows, adapter.config?.chargeKiosk, adapter.namespace)))
205
234
  return { revision: '', slots: {} };
206
235
  }
207
236
  catch {
208
237
  return { revision: '', slots: {} };
209
238
  }
210
239
  }
211
- return { revision: value.revision, slots: Object.fromEntries(value.layout.flatMap(slot => slot.token ? [[`lp${slot.slot}`, slot.token]] : [])) };
240
+ return { revision: value.revision, slots: Object.fromEntries(visible.flatMap(slot => slot.token ? [[`lp${slot.slot}`, slot.token]] : [])) };
212
241
  }
213
242
  exports.getChargingControlIdentity = publicChargingControlIdentity;
214
243
  /** Old clients remain compatible only where their index has never been reused. */
@@ -226,6 +255,8 @@ function assertChargingControlIdentity(adapter, slot, request) {
226
255
  }
227
256
  const match = /^lp([1-9]\d?)$/.exec(slot);
228
257
  const index = match ? Number(match[1]) : 0;
258
+ if (Array.isArray(adapter.evcsList) && index > adapter.evcsList.length)
259
+ throw fail('EOS_EVCS_IDENTITY_CHANGED');
229
260
  const target = value.layout[index - 1];
230
261
  if (!target?.token || !target.identity)
231
262
  throw fail('EOS_EVCS_IDENTITY_CHANGED');
@@ -378,13 +409,31 @@ async function copyJournal(adapter, registry) {
378
409
  if (failed?.status === 'rejected')
379
410
  throw failed.reason;
380
411
  }
381
- const protectedSlots = [...new Set([...registry.protectedSlots,
382
- ...changedSlots(registry.layout, journal.target).filter(slot => !!registry.layout[slot - 1])])].sort((a, b) => a - b);
383
- await saveRegistry(adapter, { schema: 1, revision: journal.targetRevision, layout: journal.target, protectedSlots, layoutChanged: true });
412
+ await commitLayout(adapter, registry, journal.target, journal.targetRevision);
413
+ }
414
+ async function commitLayout(adapter, previous, layout, revision) {
415
+ const protectedSlots = [...new Set([...previous.protectedSlots,
416
+ ...changedSlots(previous.layout, layout).filter(slot => !!previous.layout[slot - 1])])].sort((a, b) => a - b);
417
+ await saveRegistry(adapter, { schema: 1, revision, layout, protectedSlots, layoutChanged: true });
384
418
  }
385
- async function synchronize(adapter, input, state, baseline, desired, desiredKiosk) {
419
+ async function synchronize(adapter, input, state, baseline, desired, desiredKiosk, aliasTargets) {
386
420
  await drained(state);
387
421
  const rows = rowsOf(input), target = chargingPointLayout(rows, adapter.config?.chargeKiosk, adapter.namespace);
422
+ if (!baseline && aliasTargets) {
423
+ const seen = new Set();
424
+ for (const [index, row] of rows.entries()) {
425
+ const address = physicalAddress(row, index + 1, adapter.namespace);
426
+ if (!address)
427
+ continue;
428
+ const family = aliasTargets(address.target, adapter.hostNamespace || adapter.namespace);
429
+ if (!family[0])
430
+ continue;
431
+ const key = physicalHash(family[0], address.connector);
432
+ if (seen.has(key))
433
+ throw fail('EOS_EVCS_IDENTITY_AMBIGUOUS');
434
+ seen.add(key);
435
+ }
436
+ }
388
437
  await adapter.setObjectNotExistsAsync(exports.CHARGING_IDENTITY_STATE, { type: 'state', common: {
389
438
  name: 'Ladepunkt-Bedienwerte: Identitätsregister', type: 'string', role: 'json', read: true, write: false
390
439
  }, native: {},
@@ -415,12 +464,38 @@ async function synchronize(adapter, input, state, baseline, desired, desiredKios
415
464
  confirmed.set(adapter, registry);
416
465
  return true;
417
466
  }
418
- const writes = [];
467
+ const moves = [];
419
468
  for (let slot = 1; slot <= Math.max(registry.layout.length, target.length); slot++) {
420
469
  const previous = registry.layout[slot - 1], next = target[slot - 1];
421
470
  if (previous && next && previous.identity === next.identity && previous.commands === next.commands)
422
471
  continue;
423
- const source = next?.identity ? registry.layout.find(item => item.identity === next.identity) : undefined;
472
+ let source = next?.identity ? registry.layout.find(item => item.identity === next.identity) : undefined;
473
+ const row = rows[slot - 1];
474
+ if (!source && next?.identity && row && aliasTargets) {
475
+ const address = physicalAddress(row, slot, adapter.namespace);
476
+ if (address) {
477
+ // A resolver may select another capability of the same device
478
+ // after reboot. Preserve wishes only with a unique old and new
479
+ // physical connector; the changed actuator still gets a new token.
480
+ const family = new Set(aliasTargets(address.target, adapter.hostNamespace || adapter.namespace).map(id => physicalHash(id, address.connector)));
481
+ const old = registry.layout.filter(item => item.identity && family.has(item.identity));
482
+ if (old.length && (old.length !== 1 || target.filter(item => item.identity && family.has(item.identity)).length !== 1)) {
483
+ throw fail('EOS_EVCS_IDENTITY_AMBIGUOUS');
484
+ }
485
+ source = old[0];
486
+ }
487
+ }
488
+ moves.push(source ? { slot, source } : { slot });
489
+ }
490
+ const revision = (0, node_crypto_1.randomUUID)(), layout = bindLayout(target, registry.layout);
491
+ if (moves.every(move => move.source?.slot === move.slot)) {
492
+ // Only command destinations changed. No desired value moved to another
493
+ // index: preserve original values, update times and acknowledgments.
494
+ await commitLayout(adapter, registry, layout, revision);
495
+ return true;
496
+ }
497
+ const writes = [];
498
+ for (const { slot, source } of moves) {
424
499
  const values = defaults(rows[slot - 1]);
425
500
  if (source) {
426
501
  for (const field of fields) {
@@ -434,19 +509,19 @@ async function synchronize(adapter, input, state, baseline, desired, desiredKios
434
509
  }
435
510
  writes.push({ slot, values });
436
511
  }
437
- const prepared = { ...registry, journal: { sourceRevision: registry.revision, targetRevision: (0, node_crypto_1.randomUUID)(), target: bindLayout(target, registry.layout), writes } };
512
+ const prepared = { ...registry, journal: { sourceRevision: registry.revision, targetRevision: revision, target: layout, writes } };
438
513
  await saveRegistry(adapter, prepared);
439
514
  await copyJournal(adapter, prepared);
440
515
  return true;
441
516
  }
442
517
  /** Called after old engine drain, before any replacement module initializes. */
443
- function run(adapter, rows, baseline, desired, desiredKiosk) {
518
+ function run(adapter, rows, baseline, desired, desiredKiosk, aliasTargets) {
444
519
  const state = reservation(adapter);
445
520
  adapter._nwEvcsIdentityTransitionPending = true;
446
521
  const target = JSON.stringify([baseline, chargingPointLayout(rows, adapter.config?.chargeKiosk, adapter.namespace), desired === undefined ? null : chargingPointLayout(desired, desiredKiosk, adapter.namespace)]);
447
522
  if (state.operation)
448
523
  return state.target === target ? state.operation : Promise.reject(fail('EOS_EVCS_IDENTITY_BUSY'));
449
- const operation = synchronize(adapter, rows, state, baseline, desired, desiredKiosk).then(completed => { adapter._nwEvcsIdentityTransitionPending = !completed; });
524
+ const operation = synchronize(adapter, rows, state, baseline, desired, desiredKiosk, aliasTargets).then(completed => { adapter._nwEvcsIdentityTransitionPending = !completed; });
450
525
  state.operation = operation;
451
526
  state.target = target;
452
527
  const complete = () => { if (state.operation === operation) {
@@ -456,8 +531,8 @@ function run(adapter, rows, baseline, desired, desiredKiosk) {
456
531
  void operation.then(complete, complete);
457
532
  return operation;
458
533
  }
459
- function synchronizeChargingPointIdentity(adapter, rows) {
460
- return run(adapter, rows, false);
534
+ function synchronizeChargingPointIdentity(adapter, rows, aliasTargets) {
535
+ return run(adapter, rows, false, undefined, undefined, aliasTargets);
461
536
  }
462
537
  /** Seed only a previously missing registry before the first configuration commit. */
463
538
  function bindChargingPointIdentityBaseline(adapter, rows, desired, desiredKiosk) {
@@ -7,7 +7,7 @@
7
7
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
8
8
  *
9
9
  * Quelle: src-ts/runtime-executables/lib/hosted-adapter.ts
10
- * Quell-Hash: sha256:b17e810e87a0c223a1a906b5d68ddbdde7be60bbb67546b8c1f8690e96d2f654
10
+ * Quell-Hash: sha256:43539a64d54bb33d6ad83f3521c95987bd7c260ea2537086d7a44452415464a6
11
11
  * Erzeugung: npm run sync:ts-runtime-executables
12
12
  *
13
13
  * Zweck:
@@ -79,6 +79,7 @@ function thenable(value) {
79
79
  class HostedAdapter {
80
80
  constructor({ owner, bridge }) {
81
81
  this.pendingHostWrites = new Set();
82
+ this.adminOverviewObjects = new Map();
82
83
  this.hostWritesStopped = false;
83
84
  if (!owner || !/^eos-admin\.\d+$/.test(owner.namespace || '') || !bridge
84
85
  || typeof bridge.resolveAccess !== 'function' || typeof bridge.getLicense !== 'function'
@@ -221,6 +222,39 @@ class HostedAdapter {
221
222
  }
222
223
  }
223
224
  ownsLocalNamespace() { return this.namespace === retainedNamespace(this._owner); }
225
+ /** Stellt dem verbundenen EOS Admin die beiden fertigen Diagnose-JSONs seiner eigenen
226
+ * übernommenen UI bereit. Keine Steuer-IDs oder Objektdefinitionen vom Aufrufer übernehmen. */
227
+ async publishAdminOverviewJson(id, json) {
228
+ if ((id !== 'info.adminOverview.summaryJson' && id !== 'info.adminOverview.eventsJson') ||
229
+ typeof json !== 'string' || this.namespace === this.hostNamespace)
230
+ throw new Error('EOS_UI_OVERVIEW_PAYLOAD');
231
+ const complete = this.beginHostWrite();
232
+ try {
233
+ for (const key of ['info.adminOverview', id]) {
234
+ let ready = this.adminOverviewObjects.get(key);
235
+ if (!ready) {
236
+ const object = key === 'info.adminOverview'
237
+ ? { type: 'channel', common: { name: 'NexoWatt EMS Live-Diagnose' }, native: {} }
238
+ : { type: 'state', common: { name: key.endsWith('.summaryJson') ? 'EMS-Übersicht' : 'EMS-Ereignisse',
239
+ type: 'string', role: 'json', read: true, write: false }, native: {} };
240
+ ready = this._owner.setForeignObjectNotExistsAsync(`${this.hostNamespace}.${key}`, object);
241
+ this.adminOverviewObjects.set(key, ready);
242
+ }
243
+ try {
244
+ await ready;
245
+ }
246
+ catch (error) {
247
+ if (this.adminOverviewObjects.get(key) === ready)
248
+ this.adminOverviewObjects.delete(key);
249
+ throw error;
250
+ }
251
+ }
252
+ await this.setForeignStateAsync(`${this.hostNamespace}.${id}`, { val: json, ack: true });
253
+ }
254
+ finally {
255
+ complete();
256
+ }
257
+ }
224
258
  async getForeignObjectAsync(id, ...args) {
225
259
  const own = id === `system.adapter.${this.namespace}`;
226
260
  const object = await this._owner.getForeignObjectAsync(own ? `system.adapter.${this._owner.namespace}` : id, ...args);
package/ui/main.js CHANGED
@@ -7,7 +7,7 @@
7
7
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
8
8
  *
9
9
  * Quelle: src-ts/runtime-executables/main.ts
10
- * Quell-Hash: sha256:7c9927317c3f19ba2a761e5ade005ba6d705e4d24ebd17fe079ca2030ab94395
10
+ * Quell-Hash: sha256:4545287807d1439b1405fc6fa06c7f8532bbde620e8fabd8c1563c9f5d763773
11
11
  * Erzeugung: npm run sync:ts-runtime-executables
12
12
  *
13
13
  * Zweck:
@@ -31,6 +31,7 @@
31
31
  // Canonical main.js runtime source; generate with `npm run sync:ts-runtime-executables`.
32
32
  'use strict';
33
33
  const { emsControlField, validEmsControlValue } = require('./lib/ems-control-values');
34
+ const { isDeepStrictEqual } = require('node:util');
34
35
  const { HostedAdapter, centralLicenseSnapshot, centralAccess } = require('./lib/hosted-adapter');
35
36
  const { stopHostedRuntime, createHostedCleanup } = require('./lib/hosted-runtime-stop');
36
37
  const { readHostedStartup } = require('./lib/hosted-startup-status');
@@ -85,7 +86,7 @@ const tariffProviderRegistry = require('./ems/services/tariff-provider-registry'
85
86
  const { normalizeEvcsEnergyTotalKwh } = require('./ems/services/evcs-unit-conversion');
86
87
  const { validateEvcsElectricalConfig } = require('./lib/evcs-electrical-limits');
87
88
  const { OcppAutoDiscovery, collectOcppStations, filterOcppDiscoverySources, planOcppDiscovery, prepareOcppDiscoveryExclusions, normalizeOcppDiscovery, ocppDiscoveryPatterns } = require('./lib/ocpp-auto-discovery');
88
- const { beginChargingControlWrite, bindChargingPointIdentityBaseline, chargingPointLayoutChanged, remapChargingPointDefaultModes, publicChargingControlIdentity, assertChargingControlIdentity } = require('./lib/charging-point-identity');
89
+ const { beginChargingControlWrite, bindChargingPointIdentityBaseline, chargingPointLayoutChanged, configuredChargingPointRows, remapChargingPointDefaultModes, publicChargingControlIdentity, assertChargingControlIdentity } = require('./lib/charging-point-identity');
89
90
  const { remapChargingStationAssignments } = require('./lib/charging-station-identity');
90
91
  const { NotificationMail, validAddress } = require('./lib/notification-mail');
91
92
  const { startOpenMeteoPvForecastRuntime, requestOpenMeteoJson, validateOpenMeteoWeather, safeOpenMeteoError, configuredOpenMeteoApiKey } = require('./ems/services/open-meteo-pv-forecast'), { AdminOverviewPublisher } = require('./ems/services/admin-overview-publisher');
@@ -2581,23 +2582,6 @@ class NexoWattVis extends HostedAdapter {
2581
2582
  p.emsApps = this._nwApplyLicenseLimitsToEmsApps(p.emsApps);
2582
2583
  }
2583
2584
  } catch (_e) {}
2584
- try {
2585
- const maxWb = this._nwLicenseMaxWallboxes();
2586
- if (maxWb > 0 && p.settingsConfig && typeof p.settingsConfig === 'object') {
2587
- const rawCount = Number(p.settingsConfig.evcsCount);
2588
- const count = Number.isFinite(rawCount) ? Math.max(0, Math.min(maxWb, Math.round(rawCount))) : 0;
2589
- p.settingsConfig.evcsCount = count;
2590
- if (Array.isArray(p.settingsConfig.evcsList)) p.settingsConfig.evcsList = p.settingsConfig.evcsList.slice(0, count);
2591
- if (Array.isArray(p.settingsConfig.stationGroups)) {
2592
- p.settingsConfig.stationGroups = p.settingsConfig.stationGroups.map((g) => {
2593
- const row = (g && typeof g === 'object') ? Object.assign({}, g) : {};
2594
- if (Array.isArray(row.members)) row.members = row.members.filter((x) => Number(x) >= 1 && Number(x) <= count);
2595
- if (Array.isArray(row.connectors)) row.connectors = row.connectors.filter((x) => Number(x) >= 1 && Number(x) <= count);
2596
- return row;
2597
- });
2598
- }
2599
- }
2600
- } catch (_e) {}
2601
2585
  try {
2602
2586
  const edition = this._nwCurrentLicenseEdition();
2603
2587
  const profile = (nwFeatureFlagsService && typeof nwFeatureFlagsService.storagePerformanceProfile === 'function')
@@ -4922,15 +4906,8 @@ class NexoWattVis extends HostedAdapter {
4922
4906
  * The old engine and accepted customer writes are drained before snapshots;
4923
4907
  * Engine.init recovers/copies the journal before new controllers can start. */
4924
4908
  async _nwPrepareChargingPointReconfigure(nextConfig, restartEms) {
4925
- const configuredRows = config => {
4926
- const settings = config?.settingsConfig || {};
4927
- const list = Array.isArray(settings.evcsList) ? settings.evcsList : [];
4928
- const configuredCount = settings.evcsCount === undefined ? list.length : Number(settings.evcsCount);
4929
- const count = Number.isFinite(configuredCount) ? Math.max(0, Math.min(50, Math.round(configuredCount))) : list.length;
4930
- return Array.from({ length: count }, (_, index) => list[index] && typeof list[index] === 'object' ? list[index] : {});
4931
- };
4932
- const previous = Array.isArray(this.evcsList) ? this.evcsList : configuredRows(this.config);
4933
- const desired = remapChargingPointDefaultModes(previous, configuredRows(nextConfig), this.namespace);
4909
+ const previous = configuredChargingPointRows(this.config?.settingsConfig, this.evcsList);
4910
+ const desired = remapChargingPointDefaultModes(previous, configuredChargingPointRows(nextConfig?.settingsConfig), this.namespace);
4934
4911
  const changed = chargingPointLayoutChanged(previous, desired, this.config?.chargeKiosk, nextConfig?.chargeKiosk, this.namespace);
4935
4912
  let stopped = false;
4936
4913
  const stopPrevious = async () => {
@@ -9618,7 +9595,8 @@ class NexoWattVis extends HostedAdapter {
9618
9595
  }
9619
9596
  const name = (row && typeof row.name === 'string' && row.name.trim()) ? row.name.trim() : `Ladepunkt ${i+1}`;
9620
9597
  const note = (row && typeof row.note === 'string' && row.note.trim()) ? row.note.trim() : '';
9621
- const powerId = (row && typeof row.powerId === 'string' && row.powerId.trim()) ? row.powerId.trim() : '';
9598
+ const powerId = (typeof row?.powerId === 'string' ? row.powerId.trim() : '')
9599
+ || (typeof row?.actualPowerWId === 'string' ? row.actualPowerWId.trim() : '');
9622
9600
  const energyTotalId = (row && typeof row.energyTotalId === 'string' && row.energyTotalId.trim()) ? row.energyTotalId.trim() : '';
9623
9601
  // Interner EVCS-Energievertrag: energyTotalKwh ist immer kWh. Einige
9624
9602
  // Wallboxen bzw. der NexoWatt-Aliasvertrag liefern den kumulierten Zaehler
@@ -9726,6 +9704,15 @@ class NexoWattVis extends HostedAdapter {
9726
9704
  if (discovery) normalized.ocppDiscovery = discovery;
9727
9705
  }
9728
9706
  this.evcsList = evcsList;
9707
+ // Connectors can share one station-wide meter. Keep a slot with no meter
9708
+ // in the list so it cannot silently turn an incomplete sum into a measurement.
9709
+ const evcsPowerSources = new Set();
9710
+ this._nwEvcsPowerSumKeys = [];
9711
+ for (const wb of evcsList) {
9712
+ if (wb.powerId && evcsPowerSources.has(wb.powerId)) continue;
9713
+ if (wb.powerId) evcsPowerSources.add(wb.powerId);
9714
+ this._nwEvcsPowerSumKeys.push(`evcs.${wb.index}.powerW`);
9715
+ }
9729
9716
  // Stationsgruppen (für DC-Stationen mit mehreren Ladepunkten)
9730
9717
  const sgRaw = Array.isArray(cfg.stationGroups) ? cfg.stationGroups : [];
9731
9718
  const stationGroups = [];
@@ -9917,7 +9904,7 @@ class NexoWattVis extends HostedAdapter {
9917
9904
  const ts = (typeof state.ts === 'number' && Number.isFinite(state.ts))
9918
9905
  ? state.ts
9919
9906
  : ((typeof state.lc === 'number' && Number.isFinite(state.lc)) ? state.lc : null);
9920
- const normalized = this._nwScaleMappedValue(binding.key, configuredId, state.val);
9907
+ const normalized = this._nwScaleMappedValue(binding.key, configuredId, state.val, state.ack);
9921
9908
  const prev = (this.stateCache && this.stateCache[binding.key]) ? this.stateCache[binding.key] : null;
9922
9909
  const cacheChanged = !(prev && prev.ts === ts && Object.is(prev.value, normalized) && prev.q === state.q);
9923
9910
  if (cacheChanged) this.updateValue(binding.key, normalized, ts, { q: state.q });
@@ -12820,8 +12807,9 @@ async onReady() {
12820
12807
  const primeKey = async (key) => {
12821
12808
  if (!key) return;
12822
12809
  try {
12810
+ const before = this.stateCache?.[key];
12823
12811
  const st = await this.getStateAsync(key);
12824
- if (st && st.val !== undefined) {
12812
+ if (before === this.stateCache?.[key] && st && st.val !== undefined) {
12825
12813
  this.updateValue(key, st.val, st.ts || Date.now());
12826
12814
  }
12827
12815
  } catch (_e) {
@@ -16539,6 +16527,43 @@ app.get('/api/smarthome/type-detect', requireDpDiscovery, async (req, res) => {
16539
16527
  // Persist (state-based) + apply to runtime config.
16540
16528
  // We merge into the already persisted patch (loaded on startup) to keep full configuration.
16541
16529
  const basePatch = (this._nwInstallerConfigPatch && typeof this._nwInstallerConfigPatch === 'object') ? this._nwInstallerConfigPatch : {};
16530
+ // A reduced license limits the active runtime. Never trim the persisted
16531
+ // station list when another installer setting is saved. Explicit point
16532
+ // edits may retain previously configured rows beyond the current limit.
16533
+ const pointEdit = safePatch.settingsConfig;
16534
+ if (pointEdit && (Object.hasOwn(pointEdit, 'evcsList') || Object.hasOwn(pointEdit, 'evcsCount'))) {
16535
+ const prior = this.nwApplyInstallerPatchToRuntimeConfig(this.config || {}, basePatch).settingsConfig || {};
16536
+ const priorRows = Array.isArray(prior.evcsList) ? prior.evcsList : [];
16537
+ const rows = Object.hasOwn(pointEdit, 'evcsList') ? pointEdit.evcsList : priorRows;
16538
+ const rawCount = Object.hasOwn(pointEdit, 'evcsCount') ? pointEdit.evcsCount : rows?.length;
16539
+ const count = typeof rawCount === 'number' || (typeof rawCount === 'string' && /^\d+$/.test(rawCount)) ? Number(rawCount) : NaN;
16540
+ if (!Array.isArray(rows) || !Number.isSafeInteger(count) || count < 0 || count > 50 || rows.length > 50) {
16541
+ return res.status(400).json({ ok: false, error: 'evcs_layout_invalid' });
16542
+ }
16543
+ const max = this._nwLicenseMaxWallboxes();
16544
+ const previousCount = configuredChargingPointRows(prior).length;
16545
+ const retained = rows.slice(0, count);
16546
+ const previous = priorRows.slice();
16547
+ if (count > max) {
16548
+ if (count > previousCount) return res.status(400).json({ ok: false, error: 'evcs_license_limit' });
16549
+ for (const row of retained.slice(max)) {
16550
+ const index = previous.findIndex(old => isDeepStrictEqual(old, row));
16551
+ if (index < 0) return res.status(400).json({ ok: false, error: 'evcs_license_limit' });
16552
+ previous.splice(index, 1);
16553
+ }
16554
+ }
16555
+ safePatch.settingsConfig = { ...pointEdit, evcsCount: count, evcsList: retained };
16556
+ const groups = pointEdit.stationGroups ?? prior.stationGroups;
16557
+ if (count < previousCount && Array.isArray(groups)) {
16558
+ safePatch.settingsConfig.stationGroups = groups.map(group => {
16559
+ const copy = { ...group };
16560
+ for (const key of ['members', 'connectors']) {
16561
+ if (Array.isArray(copy[key])) copy[key] = copy[key].filter(n => Number(n) >= 1 && Number(n) <= count);
16562
+ }
16563
+ return copy;
16564
+ });
16565
+ }
16566
+ }
16542
16567
  if (safePatch.tariffProvider && typeof safePatch.tariffProvider === 'object') {
16543
16568
  safePatch.tariffProvider = _nwMergeTariffProviderSecrets(safePatch.tariffProvider, basePatch.tariffProvider);
16544
16569
  }
@@ -27192,7 +27217,8 @@ return res.json(out);
27192
27217
  * Zusammenhang: Teil von Adapterkern: Lifecycle, Webserver, API, States, EMS-Engine; Aufrufstellen und abhängige States/APIs beim Ändern mitprüfen.
27193
27218
  * TypeScript: Parameter, Rückgabewert und verwendete Config-/State-Objekte später explizit typisieren.
27194
27219
  */
27195
- _nwScaleMappedValue(key, objectId, val) {
27220
+ _nwScaleMappedValue(key, objectId, val, ack) {
27221
+ if (ack === false && (key === 'consumptionEvcs' || /^evcs\.\d+\.powerW$/.test(key))) return null;
27196
27222
  // EVCS-Energie wird intern immer in kWh gefuehrt. Die Umrechnung ist
27197
27223
  // bewusst pro Ladepunkt konfigurierbar, weil Hersteller sowohl Wh- als auch
27198
27224
  // kWh-Zaehler ausgeben. Leistung (W/kW) und Energie (Wh/kWh) werden nicht
@@ -27455,7 +27481,7 @@ return res.json(out);
27455
27481
  const keys = Array.isArray(entry.keys) ? entry.keys : [];
27456
27482
  for (const key of keys) {
27457
27483
  if (!key || handledEvcsKeys.has(key)) continue;
27458
- const scaled = this._nwScaleMappedValue(key, entry.id, st.val);
27484
+ const scaled = this._nwScaleMappedValue(key, entry.id, st.val, st.ack);
27459
27485
  const prev = (this.stateCache && this.stateCache[key]) ? this.stateCache[key] : null;
27460
27486
  const sameScaled = !!(prev && prev.ts === ts && Object.is(prev.value, scaled) && prev.q === st.q);
27461
27487
  if (sameScaled) continue;
@@ -27744,7 +27770,7 @@ return res.json(out);
27744
27770
  this._nwObserveFarmDisplay(key, state);
27745
27771
  }
27746
27772
  if (state && state.val !== undefined) {
27747
- this.updateValue(key, this._nwScaleMappedValue(key, id, state.val), state.ts, { q: state.q });
27773
+ this.updateValue(key, this._nwScaleMappedValue(key, id, state.val, state.ack), state.ts, { q: state.q });
27748
27774
  }
27749
27775
  } catch (e) {
27750
27776
  this.log.warn(`Cannot read initial state for ${key} (${id}): ${e.message}`);
@@ -27775,7 +27801,7 @@ return res.json(out);
27775
27801
  await this._nwPrimeForeignPowerScale(id);
27776
27802
  const st = await this.getForeignStateAsync(id);
27777
27803
  if (st && st.val !== undefined) {
27778
- this.updateValue(slot.stateKey, this._nwScaleMappedValue(slot.stateKey, id, st.val), st.ts, { q: st.q });
27804
+ this.updateValue(slot.stateKey, this._nwScaleMappedValue(slot.stateKey, id, st.val, st.ack), st.ts, { q: st.q });
27779
27805
  }
27780
27806
  } catch (e) {
27781
27807
  this.log.warn(`Cannot read initial flow slot state for ${slot.stateKey} (${id}): ${e.message}`);
@@ -27921,7 +27947,7 @@ return res.json(out);
27921
27947
  && this._nwIsReadOnlyEvcsMirrorKey(key));
27922
27948
  let normalizedMappedValue = state.val;
27923
27949
  if (key && !evcsMappedAlreadyHandled && !ownReadOnlyEvcsMirrorAck) {
27924
- normalizedMappedValue = this._nwScaleMappedValue(key, id, state.val);
27950
+ normalizedMappedValue = this._nwScaleMappedValue(key, id, state.val, state.ack);
27925
27951
  this.updateValue(key, normalizedMappedValue, state.ts, { q: state.q });
27926
27952
 
27927
27953
  // Bedienzustände der Ladepunkte werden sofort im stateCache sichtbar und
@@ -31517,8 +31543,9 @@ return res.json(out);
31517
31543
  : (selectedStorageTopologyHist === 'single'
31518
31544
  ? readHistory('storageSoc')
31519
31545
  : null);
31520
- const evW = readHistory('evcs.totalPowerW');
31521
- const historyEvAbsent = Number(this.evcsCount) === 0 && !String(historyDps.consumptionEvcs || '').trim();
31546
+ const historyEvMapped = !!String(historyDps.consumptionEvcs || '').trim();
31547
+ const evW = (historyEvMapped ? readHistory('consumptionEvcs') : null) ?? readHistory('evcs.totalPowerW');
31548
+ const historyEvAbsent = Number(this.evcsCount) === 0 && !historyEvMapped;
31522
31549
 
31523
31550
  const gridBuy = hasGrid === true && Number.isFinite(gridBuyW) ? Math.max(0, gridBuyW) : null;
31524
31551
  const gridSell = hasGrid === true && Number.isFinite(gridSellW) ? Math.max(0, gridSellW) : null;
@@ -33259,8 +33286,9 @@ return res.json(out);
33259
33286
  if (!this._derivedFlow.last) this._derivedFlow.last = {};
33260
33287
 
33261
33288
  const restTimes = [];
33262
- const evAbsent = Number(this.evcsCount) === 0 && !this._nwHasMappedDatapoint('consumptionEvcs');
33263
- const evRaw = this._nwHasMappedDatapoint('consumptionEvcs') ? readLive('consumptionEvcs', restTimes) : readLive('evcs.totalPowerW', restTimes);
33289
+ const evMapped = this._nwHasMappedDatapoint('consumptionEvcs');
33290
+ const evAbsent = Number(this.evcsCount) === 0 && !evMapped;
33291
+ const evRaw = (evMapped ? readLive('consumptionEvcs', restTimes) : null) ?? readLive('evcs.totalPowerW', restTimes);
33264
33292
  const evW = evRaw !== null ? Math.abs(evRaw) : (evAbsent ? 0 : null);
33265
33293
  let consumersW = 0;
33266
33294
  let consumersObserved = true;
@@ -34665,7 +34693,7 @@ return res.json(out);
34665
34693
  if (/^evcs\.\d+\.powerW$/.test(key)) {
34666
34694
  const count = Math.max(0, Math.round(Number(this.evcsCount || 0) || 0));
34667
34695
  const maxAgeMs = this._nwLiveInputMaxAgeMs();
34668
- const keys = Array.from({ length: Math.min(count, 1024) }, (_, index) => `evcs.${index + 1}.powerW`);
34696
+ const keys = this._nwEvcsPowerSumKeys ?? Array.from({ length: Math.min(count, 1024) }, (_, index) => `evcs.${index + 1}.powerW`);
34669
34697
  const observation = sumFlowMeasurements(this.stateCache, keys, Date.now(), maxAgeMs);
34670
34698
  const aggregate = observation || { value: null, ts: Date.now() };
34671
34699
  this.stateCache['evcs.totalPowerW'] = aggregate;
package/ui/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexowatt-eos-ui-internal",
3
- "version": "9.0.38",
3
+ "version": "9.0.39",
4
4
  "description": "Internal UI and EMS module hosted by iobroker.eos-admin; not an ioBroker adapter entry point.",
5
5
  "author": "NexoWatt",
6
6
  "license": "UNLICENSED",