iobroker.eos-admin 9.0.36 → 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 (202) hide show
  1. package/NEXOWATT_EOS_BUILD_INFO.json +12 -10
  2. package/README.md +23 -3
  3. package/adminWww/.vite/manifest.json +39 -39
  4. package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +107 -107
  5. package/adminWww/assets/{AdapterUpdateDialog-D2nDWE_N.js → AdapterUpdateDialog-DDmYbnK4.js} +1 -1
  6. package/adminWww/assets/{Adapters-D0sVqNBU.js → Adapters-73Uo4VUy.js} +1 -1
  7. package/adminWww/assets/{ConfigManager-Zm7UoaaN.js → ConfigManager-DoFx_j4o.js} +1 -1
  8. package/adminWww/assets/{Enums-BGL7pR-O.js → Enums-BRQSAW9I.js} +1 -1
  9. package/adminWww/assets/{Fields-A8J3u1yq.js → Fields-pcmISvLk.js} +1 -1
  10. package/adminWww/assets/{Files-CQPjCvW6.js → Files-E8-7c9Ab.js} +1 -1
  11. package/adminWww/assets/{Hosts-CxzkkNBj.js → Hosts-D4a3shrq.js} +1 -1
  12. package/adminWww/assets/{Instances-eEbEukDh.js → Instances-ByxEHRoo.js} +1 -1
  13. package/adminWww/assets/{Intro-I_Tknp0E.js → Intro-DFriWa6g.js} +1 -1
  14. package/adminWww/assets/{Logs-C3GPz61Q.js → Logs-BXR0h5Sz.js} +1 -1
  15. package/adminWww/assets/{Objects-DDnisxNB.js → Objects-h6jg_6uT.js} +1 -1
  16. package/adminWww/assets/{Overview-BpZFdEmp.js → Overview-B39PiMGJ.js} +1 -1
  17. package/adminWww/assets/{State-DY6Nw0SB.js → State-CqF2ARx_.js} +1 -1
  18. package/adminWww/assets/{UsedResources-CtUpdP2b.js → UsedResources-CnbnoF3d.js} +1 -1
  19. package/adminWww/assets/{Users-DcqlSfc5.js → Users-BQik0rIi.js} +1 -1
  20. package/adminWww/assets/{bootstrap-Didkuj-F.js → bootstrap-Dllnekqb.js} +3 -3
  21. package/adminWww/assets/{hostInit-Chrs-wsg.js → hostInit-CQbS-SCS.js} +1 -1
  22. package/adminWww/assets/{icons-material-SqwOQW6y.js → icons-material-rYFYu2DM.js} +1 -1
  23. package/adminWww/assets/{index-CpDo61Mz.js → index-BzbVZbb2.js} +2 -2
  24. package/adminWww/assets/{installSVGRenderer-DZMZ3pJw.js → installSVGRenderer-DbH6B8B8.js} +1 -1
  25. package/adminWww/assets/{mf-entry-bootstrap-0-b0c4981a.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/build/lib/eosLegacyMigration.js +351 -60
  32. package/build/lib/eosLegacyMigration.js.map +1 -1
  33. package/build/lib/eosLegacySource.js +172 -0
  34. package/build/lib/eosLegacySource.js.map +1 -0
  35. package/build/lib/eosModuleHost.js +38 -1
  36. package/build/lib/eosModuleHost.js.map +1 -1
  37. package/build/lib/eosModuleHttp.js +55 -8
  38. package/build/lib/eosModuleHttp.js.map +1 -1
  39. package/build/lib/eosRuntimeControl.js +3 -1
  40. package/build/lib/eosRuntimeControl.js.map +1 -1
  41. package/build/main.js +1 -1
  42. package/build/main.js.map +1 -1
  43. package/docs/README.md +3 -0
  44. package/docs/reports/EMS_ZIELLADEN_2026-11-28.md +45 -0
  45. package/docs/reports/unified-9.0.37/PRUEFBERICHT.md +59 -0
  46. package/docs/reports/unified-9.0.37/PRUEFERGEBNISSE.json +112 -0
  47. package/docs/reports/unified-9.0.37/raw/INDEX.json +232 -0
  48. package/docs/reports/unified-9.0.37/raw/backend.log +5 -0
  49. package/docs/reports/unified-9.0.37/raw/core-final-node22.log +1439 -0
  50. package/docs/reports/unified-9.0.37/raw/core-final-node24.log +1381 -0
  51. package/docs/reports/unified-9.0.37/raw/dashboard-935-screenshot.json +15 -0
  52. package/docs/reports/unified-9.0.37/raw/dashboard-de-en-nl.json +1059 -0
  53. package/docs/reports/unified-9.0.37/raw/ems-ui-nvp-integration.json +245 -0
  54. package/docs/reports/unified-9.0.37/raw/farm-and-dashboard-935.json +11 -0
  55. package/docs/reports/unified-9.0.37/raw/farm-tracking-source-tests.log +80 -0
  56. package/docs/reports/unified-9.0.37/raw/fixtures-verification.log +39 -0
  57. package/docs/reports/unified-9.0.37/raw/frontend.log +160 -0
  58. package/docs/reports/unified-9.0.37/raw/installer.log +26 -0
  59. package/docs/reports/unified-9.0.37/raw/lint.log +45 -0
  60. package/docs/reports/unified-9.0.37/raw/measure-storage-display.cjs +47 -0
  61. package/docs/reports/unified-9.0.37/raw/modules.log +5 -0
  62. package/docs/reports/unified-9.0.37/raw/node22-isolated-start-deadlines.log +28 -0
  63. package/docs/reports/unified-9.0.37/raw/node22-migration.log +1329 -0
  64. package/docs/reports/unified-9.0.37/raw/node22-mira.log +222 -0
  65. package/docs/reports/unified-9.0.37/raw/node22-parallel-initial.log +13278 -0
  66. package/docs/reports/unified-9.0.37/raw/node22-startzeiten.json +21 -0
  67. package/docs/reports/unified-9.0.37/raw/node22-system-status.log +639 -0
  68. package/docs/reports/unified-9.0.37/raw/node22-tests-final.log +18494 -0
  69. package/docs/reports/unified-9.0.37/raw/node22-version.log +1 -0
  70. package/docs/reports/unified-9.0.37/raw/node24-migration.log +1301 -0
  71. package/docs/reports/unified-9.0.37/raw/node24-mira.log +41 -0
  72. package/docs/reports/unified-9.0.37/raw/node24-system-status.log +111 -0
  73. package/docs/reports/unified-9.0.37/raw/node24-tests-final.log +3080 -0
  74. package/docs/reports/unified-9.0.37/raw/node24-version.log +1 -0
  75. package/docs/reports/unified-9.0.37/raw/npm-runtime-audit.json +77 -0
  76. package/docs/reports/unified-9.0.37/raw/platform-acl-node22.log +98 -0
  77. package/docs/reports/unified-9.0.37/raw/platform-acl-node24.log +22 -0
  78. package/docs/reports/unified-9.0.37/raw/platform-nginx-node22.json +21 -0
  79. package/docs/reports/unified-9.0.37/raw/platform-nginx-node24.json +21 -0
  80. package/docs/reports/unified-9.0.37/raw/qa-source-check.log +2 -0
  81. package/docs/reports/unified-9.0.37/raw/release-metadata.log +13 -0
  82. package/docs/reports/unified-9.0.37/raw/sbom.log +8 -0
  83. package/docs/reports/unified-9.0.37/raw/speicher-warnschwelle-integration.json +172 -0
  84. package/docs/reports/unified-9.0.37/raw/sse-backpressure-9.0.35.log +1 -0
  85. package/docs/reports/unified-9.0.37/raw/sse-backpressure-9.0.37.log +1 -0
  86. package/docs/reports/unified-9.0.37/raw/storage-display-memory-node22.json +19 -0
  87. package/docs/reports/unified-9.0.37/raw/storage-display-memory-node24.json +19 -0
  88. package/docs/reports/unified-9.0.37/raw/typecheck.log +5 -0
  89. package/docs/reports/unified-9.0.37/raw/ui-runtime.log +7 -0
  90. package/docs/reports/unified-9.0.38/PRUEFBERICHT.md +51 -0
  91. package/docs/reports/unified-9.0.38/PRUEFERGEBNISSE.json +112 -0
  92. package/docs/reports/unified-9.0.38/raw/INDEX.json +272 -0
  93. package/docs/reports/unified-9.0.38/raw/backend.log +5 -0
  94. package/docs/reports/unified-9.0.38/raw/core-final-node22.log +1439 -0
  95. package/docs/reports/unified-9.0.38/raw/core-final-node24.log +1381 -0
  96. package/docs/reports/unified-9.0.38/raw/dashboard-de-en-nl.json +1044 -0
  97. package/docs/reports/unified-9.0.38/raw/field-upgrade-936-node22.log +21 -0
  98. package/docs/reports/unified-9.0.38/raw/field-upgrade-936-node24.log +10 -0
  99. package/docs/reports/unified-9.0.38/raw/fixtures-verification.log +39 -0
  100. package/docs/reports/unified-9.0.38/raw/frontend.log +152 -0
  101. package/docs/reports/unified-9.0.38/raw/installer.log +26 -0
  102. package/docs/reports/unified-9.0.38/raw/legacy-historian-provenance.json +44 -0
  103. package/docs/reports/unified-9.0.38/raw/legacy-history-built-influx.log +10 -0
  104. package/docs/reports/unified-9.0.38/raw/legacy-history-misbinding-937.log +1 -0
  105. package/docs/reports/unified-9.0.38/raw/legacy-history-providers-node22.log +326 -0
  106. package/docs/reports/unified-9.0.38/raw/legacy-history-providers-node24.log +58 -0
  107. package/docs/reports/unified-9.0.38/raw/legacy-history-real-influx.log +10 -0
  108. package/docs/reports/unified-9.0.38/raw/legacy-history-source-comparison.json +12 -0
  109. package/docs/reports/unified-9.0.38/raw/legacy-template-interfaces.json +21 -0
  110. package/docs/reports/unified-9.0.38/raw/lint.log +45 -0
  111. package/docs/reports/unified-9.0.38/raw/migration-admin-browser-node22.log +86 -0
  112. package/docs/reports/unified-9.0.38/raw/migration-admin-browser-node24.log +84 -0
  113. package/docs/reports/unified-9.0.38/raw/migration-live-children-node22.log +20 -0
  114. package/docs/reports/unified-9.0.38/raw/migration-live-children-node24.log +9 -0
  115. package/docs/reports/unified-9.0.38/raw/migration-process-admin-node22.log +831 -0
  116. package/docs/reports/unified-9.0.38/raw/migration-process-admin-node24.log +144 -0
  117. package/docs/reports/unified-9.0.38/raw/modules.log +5 -0
  118. package/docs/reports/unified-9.0.38/raw/node22-initial-destination-channel.log +13298 -0
  119. package/docs/reports/unified-9.0.38/raw/node22-migration.log +1443 -0
  120. package/docs/reports/unified-9.0.38/raw/node22-mira.log +222 -0
  121. package/docs/reports/unified-9.0.38/raw/node22-system-status.log +639 -0
  122. package/docs/reports/unified-9.0.38/raw/node22-tests-final.log +18620 -0
  123. package/docs/reports/unified-9.0.38/raw/node22-version.log +1 -0
  124. package/docs/reports/unified-9.0.38/raw/node24-migration.log +1411 -0
  125. package/docs/reports/unified-9.0.38/raw/node24-mira.log +41 -0
  126. package/docs/reports/unified-9.0.38/raw/node24-system-status.log +111 -0
  127. package/docs/reports/unified-9.0.38/raw/node24-tests-final.log +3102 -0
  128. package/docs/reports/unified-9.0.38/raw/node24-version.log +1 -0
  129. package/docs/reports/unified-9.0.38/raw/npm-runtime-audit.json +77 -0
  130. package/docs/reports/unified-9.0.38/raw/platform-acl-node22.log +98 -0
  131. package/docs/reports/unified-9.0.38/raw/platform-acl-node24.log +22 -0
  132. package/docs/reports/unified-9.0.38/raw/platform-nginx-node22.json +21 -0
  133. package/docs/reports/unified-9.0.38/raw/platform-nginx-node24.json +21 -0
  134. package/docs/reports/unified-9.0.38/raw/qa-source-check.log +2 -0
  135. package/docs/reports/unified-9.0.38/raw/release-metadata.log +13 -0
  136. package/docs/reports/unified-9.0.38/raw/sbom.log +8 -0
  137. package/docs/reports/unified-9.0.38/raw/source-shape-node22.log +438 -0
  138. package/docs/reports/unified-9.0.38/raw/source-shape-node24.log +78 -0
  139. package/docs/reports/unified-9.0.38/raw/target-owner-bootstrap-node22.log +509 -0
  140. package/docs/reports/unified-9.0.38/raw/target-owner-bootstrap-node24.log +92 -0
  141. package/docs/reports/unified-9.0.38/raw/typecheck.log +5 -0
  142. package/docs/reports/unified-9.0.38/raw/ui-runtime.log +7 -0
  143. package/docs/reports/unified-9.0.39/PRUEFBERICHT.md +48 -0
  144. package/docs/reports/unified-9.0.39/raw/INDEX.json +51 -0
  145. package/docs/reports/unified-9.0.39/raw/node22-tests-final.log +18189 -0
  146. package/docs/reports/unified-9.0.39/raw/node22-version.log +1 -0
  147. package/docs/reports/unified-9.0.39/raw/node24-tests-final.log +3129 -0
  148. package/docs/reports/unified-9.0.39/raw/node24-version.log +1 -0
  149. package/docs/reports/unified-9.0.39/raw/npm-runtime-audit.json +77 -0
  150. package/docs/reports/unified-9.0.39/raw/overnight-simulation.json +117 -0
  151. package/docs/start/START_HIER_9.0.37.md +38 -0
  152. package/docs/start/START_HIER_9.0.38.md +21 -0
  153. package/docs/start/START_HIER_9.0.39.md +14 -0
  154. package/docs/unified/BESTANDSUEBERNAHME_9_0_7.md +2 -0
  155. package/docs/unified/DEVELOPMENT_FINDINGS.md +3 -1
  156. package/docs/unified/SECURITY_CRA.md +6 -0
  157. package/io-package.json +16 -16
  158. package/modules/ocpp/README.md +2 -0
  159. package/modules/ocpp/ocpp/common.js +64 -40
  160. package/modules/ocpp/ocpp/eos-contract.js +8 -3
  161. package/modules/ocpp/runtime.js +10 -5
  162. package/modules/ocpp/test/eos-contract.test.js +67 -0
  163. package/modules/ocpp/test/hosted.test.cjs +29 -1
  164. package/package.json +12 -4
  165. package/public/eos-migration/index.html +11 -4
  166. package/public/eos-migration/index.js +156 -18
  167. package/release-manifests/unified/build-environment.cdx.json +6 -6
  168. package/release-manifests/unified/files.json +290 -164
  169. package/release-manifests/unified/frontend.cdx.json +6 -6
  170. package/release-manifests/unified/installer.cdx.json +6 -6
  171. package/release-manifests/unified/obsolete-admin-assets.json +249 -0
  172. package/release-manifests/unified/runtime.cdx.json +27 -27
  173. package/release-manifests/unified/validation.json +17 -17
  174. package/tools/eos-release-manifest.cjs +3 -1
  175. package/ui/docs/STATES_AND_DATAPOINTS_DE.md +132 -0
  176. package/ui/ems/engine.js +5 -3
  177. package/ui/ems/evcs-control-mapping.js +13 -1
  178. package/ui/ems/modules/charging-management.js +40 -76
  179. package/ui/ems/modules/para14a.js +8 -3
  180. package/ui/ems/modules/storage-control.js +10 -5
  181. package/ui/ems/services/admin-overview-publisher.js +13 -7
  182. package/ui/ems/services/charging-management-audit.js +32 -1
  183. package/ui/ems/services/forecast-aware-target-planner.js +12 -5
  184. package/ui/ems/services/forecast-target-runtime-bridge.js +12 -5
  185. package/ui/io-package.json +13 -1
  186. package/ui/lib/charging-point-identity.js +91 -16
  187. package/ui/lib/hosted-adapter.js +35 -1
  188. package/ui/lib/notification-mail.js +95 -8
  189. package/ui/main.js +407 -61
  190. package/ui/package.json +1 -1
  191. package/ui/www/app.js +104 -89
  192. package/ui/www/charging-diagnostics-appcenter.js +12 -7
  193. package/ui/www/dashboard-lp-status.js +19 -12
  194. package/ui/www/evcs.js +71 -98
  195. package/ui/www/i18n/en.json +15 -0
  196. package/ui/www/i18n/nl.json +15 -0
  197. package/ui/www/live-display.js +145 -27
  198. package/ui/www/manifest.webmanifest +2 -2
  199. package/ui/www/storagefarm-dispatch.js +59 -8
  200. package/ui/www/storagefarm-summary.css +3 -1
  201. package/ui/www/storagefarm.html +2 -0
  202. package/adminWww/remoteEntry-eos-9.0.36.js +0 -12
@@ -1,8 +1,20 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "nexowatt-ui",
4
- "version": "9.0.36",
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
+ },
10
+ "9.0.38": {
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.",
12
+ "en": "Administrators can start or recheck migration. EOS checks the configuration and history connection even when the legacy adapters have already stopped."
13
+ },
14
+ "9.0.37": {
15
+ "de": "Das Dashboard benennt offene Betriebszustände. Die Speicherfarm zeigt die aktuelle Reglerentscheidung und meldet Leistungsabweichungen über 200 W je beauftragtem Speicher.",
16
+ "en": "The dashboard identifies pending operating states. The storage farm shows the current control decision and reports power deviations above 200 W per dispatched storage unit."
17
+ },
6
18
  "9.0.36": {
7
19
  "de": "EOS übernimmt eine bestätigte, bereits deaktivierte Alt-UI automatisch. Die Startdiagnose und der Wiederanlauf der Module wurden überarbeitet.",
8
20
  "en": "EOS automatically migrates a verified legacy UI that was already disabled. Module startup diagnostics and recovery have been revised."
@@ -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);
@@ -7,7 +7,7 @@
7
7
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
8
8
  *
9
9
  * Quelle: src-ts/runtime-executables/lib/notification-mail.ts
10
- * Quell-Hash: sha256:289e8a310154f01dcdada49e2e11b9a9ddfb27b89c9240af64afcb2eece56795
10
+ * Quell-Hash: sha256:9ca4a9c1841097cdba03a1ad87463905dfdc437c016d514de2af5cfee4253177
11
11
  * Erzeugung: npm run sync:ts-runtime-executables
12
12
  *
13
13
  * Zweck:
@@ -371,7 +371,10 @@ class NotificationMail {
371
371
  const recoveries = a._notifyGetSettingBool('notifyRecovery', true);
372
372
  // No device reads while holding the delivery lock; a stopped collector cannot monopolize delivery.
373
373
  await this.reloadLedger();
374
- const observed = this.options.supervision ? await this.options.observations() : await this.collect(categories);
374
+ let farmObservation;
375
+ const storageAliases = new Map();
376
+ const observed = this.options.supervision ? await this.options.observations()
377
+ : await this.collect(categories, value => { farmObservation = value; }, storageAliases);
375
378
  const legacyRefs = new Map();
376
379
  if (this.options.supervision) {
377
380
  const rows = observed?.chargingManagement?.wallboxes;
@@ -415,7 +418,19 @@ class NotificationMail {
415
418
  if (confirmed.has(canonical)) migrateIncident(this.policy.records, id, canonical);
416
419
  }
417
420
  } else {
418
- events = [];
421
+ // Revalidate the existing farm observation after any lock wait. A lease
422
+ // or meter sample may have expired since the collector read the state.
423
+ events = categories.has('system') ? this.farmPowerEvents(farmObservation, this.now()) : [];
424
+ for (const [oldId, current] of storageAliases) {
425
+ const previous = this.policy.records.get(oldId);
426
+ // A normalized collision has no single previous physical identity.
427
+ if (!previous || current.has(oldId)) continue;
428
+ if (current.size === 1) {
429
+ const [id] = current;
430
+ if (!this.policy.records.has(id)) this.policy.records.set(id, { ...previous, meta:{ ...previous.meta, id } });
431
+ }
432
+ this.policy.records.delete(oldId);
433
+ }
419
434
  for (const event of observed) {
420
435
  const refs = this.overlapRefs?.get(event.id) || [];
421
436
  const canonical = supervisedId(this.policy.supervisedNamespaces, refs);
@@ -455,7 +470,7 @@ class NotificationMail {
455
470
  /**
456
471
  * Ablauf und Zusammenhang: Übersetzt EMS-, Modul-, Geräte- und Ladepunkt-Diagnosen in Ereignisse mit stabilen IDs. Reguläre Ladepausen sollen keine Störung werden; bei einer ausgefallenen übergeordneten Quelle werden Folgeereignisse unterdrückt statt falsche Entwarnungen erzeugt.
457
472
  */
458
- async collect(categories) {
473
+ async collect(categories, observeFarm, storageAliases) {
459
474
  const a = this.adapter, now = this.now(), events = [];
460
475
  this.overlapRefs = new Map();
461
476
  const read = async id => { const s = await a.getStateAsync(id); return s?.val; };
@@ -525,11 +540,25 @@ class NotificationMail {
525
540
  if (!engineStalled && (categories.has('system') || categories.has('communications'))) {
526
541
  const state = await a.getStateAsync('storageFarm.storagesStatusJson');
527
542
  if (state && now - Number(state.ts) < 120000) {
528
- let rows = [];
529
- try { rows = JSON.parse(String(state.val || '[]')); } catch (_error) { retain('storage:'); }
543
+ let rows;
544
+ try { rows = JSON.parse(String(state.val || '')); } catch (_error) {}
545
+ if (!Array.isArray(rows)) retain('storage:');
546
+ if (observeFarm && categories.has('system') && state.ack === true && (state.q === undefined || state.q === 0)
547
+ && typeof state.val === 'string' && state.val.length <= 262144 && Array.isArray(rows) && rows.length <= 128) observeFarm({ ts:state.ts, rows, sourceDown });
530
548
  for (const row of (Array.isArray(rows) ? rows : []).slice(0, 128)) {
531
- const id = `storage:${safeId(row.dispatchKey || row.name)}`;
532
- if (sourceDown(row.signedPowerId || row.chargePowerId || row.socId)) { retain(id); continue; }
549
+ if (!row || typeof row !== 'object') continue;
550
+ const raw = String(row.dispatchKey || row.name || '');
551
+ const oldId = 'storage:' + safeId(raw);
552
+ const id = raw === safeId(raw) ? oldId : 'storage:device:' + crypto.createHash('sha256').update(raw).digest('hex');
553
+ if (storageAliases && this.policy.records.has(oldId)) {
554
+ if (!storageAliases.has(oldId)) storageAliases.set(oldId, new Set());
555
+ storageAliases.get(oldId).add(id);
556
+ }
557
+ if (sourceDown(row.signedPowerId || row.chargePowerId || row.socId)) {
558
+ const previous = this.policy.records.get(id) || this.policy.records.get(oldId);
559
+ if (previous) events.push({ id, category:previous.meta.category, hold:true });
560
+ continue;
561
+ }
533
562
  if (categories.has('system') && row.dispatchBlockedReasons?.includes('fault_active')) {
534
563
  add(id, 'system', `Speicher meldet eine Störung: ${row.name}`, 'Der konfigurierte Speicher meldet einen aktiven Gerätefehler.', 0, 'critical');
535
564
  } else if (categories.has('communications') && (row.state === 'offline' || row.degradedReason === 'stale')) {
@@ -583,6 +612,64 @@ class NotificationMail {
583
612
  }
584
613
  return events;
585
614
  }
615
+ // Runs inside the existing delivery lock. A complete configuration can retire
616
+ // a removed member; missing evidence never confirms a physical recovery.
617
+ farmPowerEvents(observation, now) {
618
+ const prefix = 'farm-power:';
619
+ const prior = new Set();
620
+ for (const id of this.policy.records.keys()) if (id.startsWith(prefix)) prior.add(id);
621
+ if (!prior.size && !observation?.rows.some(row => row?.powerComparison)) return [];
622
+ const events = [];
623
+ const farm = this.adapter._nwGetStorageFarmRuntimeInfo?.();
624
+ const ready = this.adapter._hostedStartup?.state === 'ready' && Array.isArray(farm?.rows);
625
+ const identifiable = key => typeof key === 'string' && key.length <= 512 && !!key && key === key.trim();
626
+ const idOf = key => prefix + crypto.createHash('sha256').update(key).digest('hex');
627
+ const configured = new Set(), ambiguous = new Set();
628
+ if (ready && farm.active === true) {
629
+ for (const [index, row] of farm.rows.entries()) {
630
+ if (!row || row.enabled === false) continue;
631
+ const key = this.adapter._sfGetStorageDispatchKey(row, index);
632
+ if (!identifiable(key)) continue;
633
+ if (configured.has(key)) ambiguous.add(key);
634
+ configured.add(key);
635
+ }
636
+ }
637
+ if (ready) {
638
+ const memberIds = new Set([...configured].map(idOf));
639
+ for (const id of prior) if (!memberIds.has(id)) {
640
+ // Disabling/removing a configured member ends monitoring silently.
641
+ prior.delete(id);
642
+ this.policy.records.delete(id);
643
+ }
644
+ }
645
+ if (ready && Number.isSafeInteger(observation?.ts) && observation.ts > 0 && observation.ts <= now
646
+ && now - observation.ts <= 30000) {
647
+ const unique = new Set();
648
+ for (const row of observation.rows) {
649
+ const key = row?.dispatchKey;
650
+ if (unique.has(key)) ambiguous.add(key);
651
+ unique.add(key);
652
+ }
653
+ const { farmPowerComparison } = require('../www/live-display');
654
+ for (const row of observation.rows) {
655
+ const key = row?.dispatchKey;
656
+ if (!configured.has(key) || ambiguous.has(key) || row.enabled === false || row.licenseBlocked === true
657
+ || row.state === 'offline' || row.degradedReason === 'stale' || row.dispatchBlockedReasons?.includes('fault_active')
658
+ || [row.signedPowerId, row.chargePowerId, row.dischargePowerId, row.socId].some(observation.sourceDown)) continue;
659
+ const comparison = farmPowerComparison(row, now);
660
+ if (!comparison) continue;
661
+ const id = idOf(key);
662
+ prior.delete(id); // confirmed <= 200 W enters normal steady recovery
663
+ if (!comparison.warning) continue;
664
+ const label = String(row.name || 'Speicher').replace(/[\r\n]/g, ' ').slice(0, 96);
665
+ const watts = value => String(value).replace('.', ',') + ' W';
666
+ events.push({ id, category:'system', severity:'warning', title:'Leistungsabweichung bei ' + label,
667
+ message:`Soll ${watts(comparison.targetW)}, Ist ${watts(comparison.measuredW)}, Abweichung ${watts(comparison.differenceW)}.` });
668
+ }
669
+ }
670
+ for (const id of prior) events.push({ id, category:'system', hold:true });
671
+ return events;
672
+ }
586
673
  /**
587
674
  * Ablauf und Zusammenhang: Markiert den Dienst als beendet und schließt den SMTP-Transport beim Adapter-Unload. Spätere Versandversuche werden dadurch abgewehrt.
588
675
  */