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
package/ui/www/evcs.js CHANGED
@@ -7,7 +7,7 @@
7
7
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
8
8
  *
9
9
  * Quelle: src-ts/runtime-executables/www/evcs.ts
10
- * Quell-Hash: sha256:e0b1f16597d3ea2467f77c0a06773299c36e35238bff59b028a2be38297752ac
10
+ * Quell-Hash: sha256:608bef5f002ec4cd6c6c21582eec678b6c7e61c0b0350840d75095e723ece722
11
11
  * Erzeugung: npm run sync:ts-runtime-executables
12
12
  *
13
13
  * Zweck:
@@ -142,7 +142,7 @@ function _clearPendingWrite(key, expectedValue) {
142
142
 
143
143
  /** Prüft bestätigte Modus-/Quellen-Serverzeitstempel auf Rückschritte. */
144
144
  function _isOlderEvcsModeEntry(key, incoming, current) {
145
- if (!/^chargingManagement\.wallboxes\.lp\d+\.(?:userMode|userAutoSource)$/.test(key)) return false;
145
+ if (!/^chargingManagement\.wallboxes\.lp\d+\.(?:userMode|userAutoSource|goalEnabled|goalTargetSocPct|goalFinishTs|goalBatteryKwh)$/.test(key)) return false;
146
146
  const currentTs = Number(current && current.ts);
147
147
  const incomingTs = Number(incoming && incoming.ts);
148
148
  return Number.isFinite(currentTs) && currentTs > 0
@@ -466,18 +466,7 @@ function emsModeToUi(mode) {
466
466
  if (s === 'boost') return 2;
467
467
  if (s === 'minpv' || s === 'min+pv') return 3;
468
468
  if (s === 'pv') return 4;
469
- return 1; // auto
470
- }
471
- /**
472
- * Code-Teil: clampEmsUi
473
- * Zweck: Kapselt einen lokalen Verarbeitungsschritt, damit Aufrufer nicht direkt in Detaildaten eingreifen.
474
- * Zusammenhang: Teil von Adapter-/Frontend-Code; Aufrufstellen und abhängige States/APIs beim Ändern mitprüfen.
475
- * TypeScript: Parameter, Rückgabewert und verwendete Config-/State-Objekte später explizit typisieren.
476
- */
477
- function clampEmsUi(v) {
478
- const n = Number(v);
479
- if (!isFinite(n)) return 1;
480
- return Math.max(1, Math.min(4, Math.round(n)));
469
+ return s === 'auto' ? 1 : null;
481
470
  }
482
471
 
483
472
  function normalizeEvcsPhaseMode(raw) {
@@ -915,6 +904,9 @@ function buildEvcsModalBodyHtml(i) {
915
904
  const canActive = hasEms || !!m.activeId;
916
905
 
917
906
  const emsUserMode = d(`${cm}.userMode`);
907
+ const emsUiVal = emsModeToUi(emsUserMode);
908
+ /** @param {string} field */
909
+ const goalBusyAttr = field => _modeWriteRequests.has(`${cm}.${field}`) ? 'disabled' : '';
918
910
  const emsEffectiveMode = d(`${cm}.effectiveMode`);
919
911
  const emsUserAutoSource = String(d(`${cm}.userAutoSource`) || 'standard').trim().toLowerCase() === 'strategy' ? 'strategy' : 'standard';
920
912
  const emsStrategyEligible = _evcsBoolOrNull(d(`${cm}.strategyEligible`)) === true;
@@ -967,7 +959,7 @@ function buildEvcsModalBodyHtml(i) {
967
959
  const regOff = regAvail && !regOn;
968
960
 
969
961
  // Zeit-Ziel Laden (Depot-/Deadline-Laden)
970
- const emsGoalEnabled = hasEms ? !!d(`${cm}.goalEnabled`) : false;
962
+ const emsGoalEnabled = hasEms && _evcsBoolOrNull(d(`${cm}.goalEnabled`)) === true;
971
963
  const emsGoalTargetSoc = Number.isFinite(Number(d(`${cm}.goalTargetSocPct`))) ? Math.round(Number(d(`${cm}.goalTargetSocPct`))) : 100;
972
964
  const emsGoalFinishTs = Number.isFinite(Number(d(`${cm}.goalFinishTs`))) ? Math.round(Number(d(`${cm}.goalFinishTs`))) : 0;
973
965
  const emsGoalBatteryKwh = Number.isFinite(Number(d(`${cm}.goalBatteryKwh`))) ? Number(d(`${cm}.goalBatteryKwh`)) : 0;
@@ -1003,6 +995,12 @@ function buildEvcsModalBodyHtml(i) {
1003
995
  let emsGoalHint = '';
1004
996
  if (!emsGoalEnabled) {
1005
997
  emsGoalHint = 'Aus';
998
+ } else if (emsUiVal === null) {
999
+ emsGoalHint = 'Lademodus noch nicht bestätigt.';
1000
+ } else if (emsUiVal !== 1) {
1001
+ emsGoalHint = 'Zielladen pausiert. Für das gespeicherte Ziel den Lademodus Auto wählen.';
1002
+ } else if (emsGoalStatus === 'vehicle_not_requesting') {
1003
+ emsGoalHint = 'Fahrzeug verbunden, fordert aktuell keine Ladung an.';
1006
1004
  } else if (emsGoalStatus === 'no_vehicle') {
1007
1005
  emsGoalHint = 'Fahrzeug nicht verbunden – Zielladen pausiert.';
1008
1006
  } else if (emsGoalStatus === 'waiting_soc') {
@@ -1069,8 +1067,7 @@ function buildEvcsModalBodyHtml(i) {
1069
1067
 
1070
1068
  const ct = String(emsChargerType ?? m.chargerType ?? '').toUpperCase();
1071
1069
  const ctBadge = (ct === 'DC' || ct === 'AC') ? ct : '';
1072
- const userModeLower = String(emsUserMode || 'auto').trim().toLowerCase();
1073
- const showAutoSourceUi = hasEms && userModeLower === 'auto';
1070
+ const showAutoSourceUi = hasEms && emsUiVal === 1;
1074
1071
  const strategyRequestedText = Number.isFinite(emsStrategyRequestedPowerW) && emsStrategyRequestedPowerW > 0
1075
1072
  ? ` · Wunsch ${fmtW(emsStrategyRequestedPowerW)}`
1076
1073
  : '';
@@ -1110,10 +1107,9 @@ function buildEvcsModalBodyHtml(i) {
1110
1107
  else if (storageAssistEffective) storageAssistHint = `Speicher darf unterstützen${Number.isFinite(emsBatteryContributionW) && emsBatteryContributionW > 0 ? ' · Anteil ' + Math.round(emsBatteryContributionW) + ' W' : ''}.`;
1111
1108
  else storageAssistHint = emsStorageAssistReason ? `Freigegeben, aktuell nicht aktiv: ${emsStorageAssistReason}` : 'Freigegeben, aktuell nicht aktiv.';
1112
1109
 
1113
- const emsUiVal = clampEmsUi(emsModeToUi(emsUserMode ?? 'auto'));
1114
1110
  const effTxt = String(emsEffectiveMode ?? '').trim();
1115
1111
  const effLower = effTxt.toLowerCase();
1116
- const userLower = String(emsUserMode ?? 'auto').trim().toLowerCase();
1112
+ const userLower = String(emsUserMode ?? '').trim().toLowerCase();
1117
1113
 
1118
1114
  const hint = reasonHint(emsReason, emsApplyStatus);
1119
1115
  const allowBoost = (emsAllowBoost !== false);
@@ -1124,7 +1120,7 @@ function buildEvcsModalBodyHtml(i) {
1124
1120
  const modeWriteError = _modeWriteErrors.get(`${cm}.userMode`) || '';
1125
1121
  const autoSourceWritePending = _modeWriteRequests.has(`${cm}.userAutoSource`);
1126
1122
  const autoSourceWriteError = _modeWriteErrors.get(`${cm}.userAutoSource`) || '';
1127
- const modeBtnAttr = regOff ? regBtnAttr : (modeWritePending || autoSourceWritePending ? 'disabled' : '');
1123
+ const modeBtnAttr = regOff ? regBtnAttr : (emsUiVal === null || modeWritePending || autoSourceWritePending ? 'disabled' : '');
1128
1124
  const showEff = !!effTxt && ((userLower === 'auto' && effLower !== 'normal') || (userLower !== 'auto' && userLower !== effLower && !(userLower === 'minpv' && effLower === 'minpv')));
1129
1125
 
1130
1126
  const bq = _boostQueueRank[i] || 0;
@@ -1264,27 +1260,28 @@ function buildEvcsModalBodyHtml(i) {
1264
1260
  <div style="display:flex; justify-content:space-between; align-items:center; gap:12px;">
1265
1261
  <span>Ziel‑Laden</span>
1266
1262
  <div class="nw-evcs-mode-buttons nw-evcs-mode-buttons-2 nw-toggle" data-toggle-for="emsGoalEn_${i}">
1267
- <button type="button" data-value="false" class="${!emsGoalEnabled ? 'active' : ''}">Aus</button>
1268
- <button type="button" data-value="true" class="${emsGoalEnabled ? 'active' : ''}">An</button>
1263
+ <button type="button" ${goalBusyAttr('goalEnabled')} data-value="false" class="${!emsGoalEnabled ? 'active' : ''}">Aus</button>
1264
+ <button type="button" ${goalBusyAttr('goalEnabled')} data-value="true" class="${emsGoalEnabled ? 'active' : ''}">An</button>
1269
1265
  </div>
1270
- <input type="checkbox" class="nw-toggle-hidden" id="emsGoalEn_${i}" data-ems-goal-enabled="${i}" ${emsGoalEnabled ? 'checked' : ''}>
1266
+ <input type="checkbox" class="nw-toggle-hidden" id="emsGoalEn_${i}" ${goalBusyAttr('goalEnabled')} data-ems-goal-enabled="${i}" ${emsGoalEnabled ? 'checked' : ''}>
1271
1267
  </div>
1272
1268
 
1269
+ ${['goalEnabled', 'goalTargetSocPct', 'goalFinishTs', 'goalBatteryKwh'].some(field => _modeWriteErrors.has(`${cm}.${field}`)) ? '<div class="nw-hint nw-hint-warn" role="alert">Änderung am Ladeziel nicht bestätigt. Bitte Uhrzeit und Einstellungen prüfen.</div>' : ''}
1273
1270
  ${emsGoalEnabled ? `
1274
1271
  <div style="display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:8px;">
1275
1272
  <div>
1276
1273
  <div class="muted" style="font-size:12px; opacity:.85; margin-bottom:4px;">Ziel SoC (%)</div>
1277
- <input class="nw-input" type="number" min="0" max="100" step="1" data-ems-goal-soc="${i}" value="${emsGoalTargetSoc}">
1274
+ <input class="nw-input" type="number" min="0" max="100" step="1" ${goalBusyAttr('goalTargetSocPct')} data-ems-goal-soc="${i}" value="${emsGoalTargetSoc}">
1278
1275
  </div>
1279
1276
  <div>
1280
1277
  <div class="muted" style="font-size:12px; opacity:.85; margin-bottom:4px;">Fertig um</div>
1281
- <input class="nw-input" type="time" step="900" data-ems-goal-time="${i}" value="${emsGoalTimeValue}">
1278
+ <input class="nw-input" type="time" step="900" ${goalBusyAttr('goalFinishTs')} data-ems-goal-time="${i}" value="${emsGoalTimeValue}">
1282
1279
  </div>
1283
1280
  </div>
1284
1281
 
1285
1282
  <div style="display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:8px;">
1286
1283
  <span class="muted" style="font-size:12px; opacity:.85;">Akkukapazität (kWh)</span>
1287
- <input class="nw-input" style="max-width:140px; text-align:right;" type="number" min="0" max="2000" step="0.1" data-ems-goal-kwh="${i}" value="${emsGoalBatteryKwh > 0 ? emsGoalBatteryKwh : ''}" placeholder="auto">
1284
+ <input class="nw-input" style="max-width:140px; text-align:right;" type="number" min="0" max="2000" step="0.1" ${goalBusyAttr('goalBatteryKwh')} data-ems-goal-kwh="${i}" value="${emsGoalBatteryKwh > 0 ? emsGoalBatteryKwh : ''}" placeholder="auto">
1288
1285
  </div>
1289
1286
 
1290
1287
  <div class="muted" style="font-size:12px; opacity:.85; margin-top:6px;">${esc(emsGoalHint)}</div>
@@ -1414,7 +1411,7 @@ function render() {
1414
1411
  });
1415
1412
 
1416
1413
  const socTxt = (soc != null) ? ('SoC ' + fmtPct(soc)) : 'SoC --';
1417
- const modeTxt = hasEms ? (_modeBadge(emsUserMode) || 'AUTO') : '—';
1414
+ const modeTxt = _modeBadge(emsUserMode) || '—';
1418
1415
 
1419
1416
  html += `
1420
1417
  <div class="nw-tile nw-tile--size-m ${tileCls}" style="cursor:pointer" data-evcs-tile="${i}" tabindex="0" role="button" aria-label="${esc(name)}">
@@ -1513,6 +1510,46 @@ function initMenu() {
1513
1510
  }
1514
1511
  }
1515
1512
 
1513
+ /**
1514
+ * @param {number} idx
1515
+ * @param {'goalEnabled'|'goalTargetSocPct'|'goalFinishTs'|'goalBatteryKwh'} field
1516
+ * @param {number|boolean} value
1517
+ * @param {HTMLInputElement} input
1518
+ */
1519
+ async function writeGoalSetting(idx, field, value, input) {
1520
+ const stateKey = `chargingManagement.wallboxes.lp${idx}.${field}`;
1521
+ if (_modeWriteRequests.has(stateKey)) return;
1522
+ _modeWriteRequests.set(stateKey, true);
1523
+ input.disabled = true;
1524
+ scheduleRender();
1525
+ _modeWriteErrors.delete(stateKey);
1526
+ try {
1527
+ const result = await _fetchEvcsModeJson('/api/set', {
1528
+ method: 'POST', headers: { 'Content-Type': 'application/json' },
1529
+ body: JSON.stringify({ scope: 'ems', key: `evcs.${idx}.${field}`, value }),
1530
+ });
1531
+ if (result?.ok !== true) throw new Error('goal_write_rejected');
1532
+ } catch {
1533
+ _modeWriteErrors.set(stateKey, true);
1534
+ }
1535
+ try {
1536
+ const snapshot = await _fetchEvcsModeJson('/api/state', { cache: 'no-store' });
1537
+ const entry = snapshot?.[stateKey];
1538
+ if (typeof entry?.value !== typeof value || !(typeof entry.value === 'boolean' || Number.isFinite(entry.value))) {
1539
+ throw new Error('goal_state_missing');
1540
+ }
1541
+ _mergeUpdatePayload({ [stateKey]: entry });
1542
+ if (d(stateKey) === value) _modeWriteErrors.delete(stateKey);
1543
+ else _modeWriteErrors.set(stateKey, true);
1544
+ } catch {
1545
+ _modeWriteErrors.set(stateKey, true);
1546
+ } finally {
1547
+ _modeWriteRequests.delete(stateKey);
1548
+ input.disabled = false;
1549
+ scheduleRender();
1550
+ }
1551
+ }
1552
+
1516
1553
  // --- Controls (tiles + modal) ------------------------------------------------
1517
1554
  /**
1518
1555
  * Code-Teil: bindControls
@@ -1786,23 +1823,7 @@ function bindControls() {
1786
1823
  const idx = Number(t.getAttribute('data-ems-goal-enabled'));
1787
1824
  if (!Number.isFinite(idx) || idx <= 0) return;
1788
1825
  const b = !!t.checked;
1789
- const k = `chargingManagement.wallboxes.lp${idx}.goalEnabled`;
1790
-
1791
- _setPendingWrite(k, b, 2000);
1792
- state[k] = { value: b, ts: Date.now() };
1793
- scheduleRender();
1794
-
1795
- chargingControlFetch('/api/set', {
1796
- method: 'POST',
1797
- headers: { 'Content-Type': 'application/json' },
1798
- body: JSON.stringify({ scope: 'ems', key: `evcs.${idx}.goalEnabled`, value: b })
1799
- }).then(() => {
1800
- setTimeout(() => _clearPendingWrite(k, b), 2600);
1801
- }).catch(() => {
1802
- _clearPendingWrite(k);
1803
- scheduleRender();
1804
- });
1805
-
1826
+ await writeGoalSetting(idx, 'goalEnabled', b, t);
1806
1827
  return;
1807
1828
  }
1808
1829
 
@@ -1814,23 +1835,7 @@ function bindControls() {
1814
1835
  if (!Number.isFinite(n)) return;
1815
1836
 
1816
1837
  const v = Math.max(0, Math.min(100, Math.round(n)));
1817
- const k = `chargingManagement.wallboxes.lp${idx}.goalTargetSocPct`;
1818
-
1819
- _setPendingWrite(k, v, 2500);
1820
- state[k] = { value: v, ts: Date.now() };
1821
- scheduleRender();
1822
-
1823
- chargingControlFetch('/api/set', {
1824
- method: 'POST',
1825
- headers: { 'Content-Type': 'application/json' },
1826
- body: JSON.stringify({ scope: 'ems', key: `evcs.${idx}.goalTargetSocPct`, value: v })
1827
- }).then(() => {
1828
- setTimeout(() => _clearPendingWrite(k, v), 2600);
1829
- }).catch(() => {
1830
- _clearPendingWrite(k);
1831
- scheduleRender();
1832
- });
1833
-
1838
+ await writeGoalSetting(idx, 'goalTargetSocPct', v, t);
1834
1839
  return;
1835
1840
  }
1836
1841
 
@@ -1844,23 +1849,7 @@ function bindControls() {
1844
1849
  try { if (snapped && snapped !== t.value) t.value = snapped; } catch (_e) {}
1845
1850
 
1846
1851
  const ts = nextTsFromTimeInput(snapped);
1847
- const k = `chargingManagement.wallboxes.lp${idx}.goalFinishTs`;
1848
-
1849
- _setPendingWrite(k, ts, 2500);
1850
- state[k] = { value: ts, ts: Date.now() };
1851
- scheduleRender();
1852
-
1853
- chargingControlFetch('/api/set', {
1854
- method: 'POST',
1855
- headers: { 'Content-Type': 'application/json' },
1856
- body: JSON.stringify({ scope: 'ems', key: `evcs.${idx}.goalFinishTs`, value: ts })
1857
- }).then(() => {
1858
- setTimeout(() => _clearPendingWrite(k, ts), 2600);
1859
- }).catch(() => {
1860
- _clearPendingWrite(k);
1861
- scheduleRender();
1862
- });
1863
-
1852
+ await writeGoalSetting(idx, 'goalFinishTs', ts, t);
1864
1853
  return;
1865
1854
  }
1866
1855
 
@@ -1871,23 +1860,7 @@ function bindControls() {
1871
1860
 
1872
1861
  const n = Number(t.value);
1873
1862
  const v = Number.isFinite(n) ? Math.max(0, Math.min(2000, Math.round(n * 10) / 10)) : 0;
1874
- const k = `chargingManagement.wallboxes.lp${idx}.goalBatteryKwh`;
1875
-
1876
- _setPendingWrite(k, v, 2500);
1877
- state[k] = { value: v, ts: Date.now() };
1878
- scheduleRender();
1879
-
1880
- chargingControlFetch('/api/set', {
1881
- method: 'POST',
1882
- headers: { 'Content-Type': 'application/json' },
1883
- body: JSON.stringify({ scope: 'ems', key: `evcs.${idx}.goalBatteryKwh`, value: v })
1884
- }).then(() => {
1885
- setTimeout(() => _clearPendingWrite(k, v), 2600);
1886
- }).catch(() => {
1887
- _clearPendingWrite(k);
1888
- scheduleRender();
1889
- });
1890
-
1863
+ await writeGoalSetting(idx, 'goalBatteryKwh', v, t);
1891
1864
  return;
1892
1865
  }
1893
1866
  });
@@ -1903,7 +1876,7 @@ function bindControls() {
1903
1876
  */
1904
1877
  function _syncModeButtonsUi(idx, mode) {
1905
1878
  try {
1906
- const m = String(mode || 'auto').trim().toLowerCase();
1879
+ const m = String(mode ?? '').trim().toLowerCase().replace('min+pv', 'minpv');
1907
1880
  const bs = Array.from(document.querySelectorAll(`button[data-ems-mode-btn="${idx}"]`));
1908
1881
  bs.forEach(b => {
1909
1882
  let bm = String(b.getAttribute('data-mode') || 'auto').trim().toLowerCase();
@@ -1936,9 +1909,9 @@ function bindControls() {
1936
1909
  if (!Number.isInteger(idx) || idx <= 0 || btn.disabled) return;
1937
1910
  const k = `chargingManagement.wallboxes.lp${idx}.userMode`;
1938
1911
  if (_hasPendingEvcsControlWrite(idx)) return;
1939
- let mode = String(btn.getAttribute('data-mode') || 'auto').trim().toLowerCase();
1912
+ let mode = String(btn.getAttribute('data-mode') ?? '').trim().toLowerCase();
1940
1913
  if (mode === 'min+pv') mode = 'minpv';
1941
- if (!['auto', 'boost', 'minpv', 'pv'].includes(mode)) mode = 'auto';
1914
+ if (emsModeToUi(mode) === null || emsModeToUi(d(k)) === null) return;
1942
1915
 
1943
1916
  // UX: allow manual boost cancel by clicking the active Boost button again.
1944
1917
  try {
@@ -20,6 +20,21 @@
20
20
  "Sicherheitsstopp aktiv": "Safety stop active",
21
21
  "EMS gestoppt": "EMS stopped",
22
22
  "EMS pausiert": "EMS paused",
23
+ "Speicherabweichung: {name} · {watts} W": "Storage deviation: {name} · {watts} W",
24
+ "NVP-Bestätigung fehlt": "Grid measurement confirmation missing",
25
+ "NVP-Bestätigung veraltet": "Grid measurement confirmation stale",
26
+ "NVP-Bestätigung ungültig": "Grid measurement confirmation invalid",
27
+ "EMS-Betriebsmeldung fehlt": "EMS operating signal missing",
28
+ "EMS-Betriebsmeldung veraltet": "EMS operating signal stale",
29
+ "EMS-Betriebsmeldung ungültig": "EMS operating signal invalid",
30
+ "EMS-Herzschlag fehlt": "EMS heartbeat missing",
31
+ "EMS-Herzschlag veraltet": "EMS heartbeat stale",
32
+ "EMS-Herzschlag ungültig": "EMS heartbeat invalid",
33
+ "Messwert vorhanden · Bestätigung fehlt": "Measurement available · confirmation missing",
34
+ "Betriebsdiagnose nicht verfügbar": "Operating diagnostics unavailable",
35
+ "Messung aktuell": "Measurement current",
36
+ "Messung fehlt / veraltet": "Measurement missing / stale",
37
+ "Gestoppt": "Stopped",
23
38
  "Betriebsstatus prüfen": "Check operating status",
24
39
  "Netzmessung fehlt oder ist veraltet": "Grid measurement missing or stale",
25
40
  "§14a-Kommunikationsfallback aktiv": "§14a communication fallback active",
@@ -31,6 +31,21 @@
31
31
  "Sicherheitsstopp aktiv": "Veiligheidsstop actief",
32
32
  "EMS gestoppt": "EMS gestopt",
33
33
  "EMS pausiert": "EMS gepauzeerd",
34
+ "Speicherabweichung: {name} · {watts} W": "Opslagafwijking: {name} · {watts} W",
35
+ "NVP-Bestätigung fehlt": "Bevestiging netmeting ontbreekt",
36
+ "NVP-Bestätigung veraltet": "Bevestiging netmeting verouderd",
37
+ "NVP-Bestätigung ungültig": "Bevestiging netmeting ongeldig",
38
+ "EMS-Betriebsmeldung fehlt": "EMS-bedrijfsmelding ontbreekt",
39
+ "EMS-Betriebsmeldung veraltet": "EMS-bedrijfsmelding verouderd",
40
+ "EMS-Betriebsmeldung ungültig": "EMS-bedrijfsmelding ongeldig",
41
+ "EMS-Herzschlag fehlt": "EMS-heartbeat ontbreekt",
42
+ "EMS-Herzschlag veraltet": "EMS-heartbeat verouderd",
43
+ "EMS-Herzschlag ungültig": "EMS-heartbeat ongeldig",
44
+ "Messwert vorhanden · Bestätigung fehlt": "Meetwaarde beschikbaar · bevestiging ontbreekt",
45
+ "Betriebsdiagnose nicht verfügbar": "Bedrijfsdiagnose niet beschikbaar",
46
+ "Messung aktuell": "Meting actueel",
47
+ "Messung fehlt / veraltet": "Meting ontbreekt / verouderd",
48
+ "Gestoppt": "Gestopt",
34
49
  "Betriebsstatus prüfen": "Bedrijfsstatus controleren",
35
50
  "Netzmessung fehlt oder ist veraltet": "Netmeting ontbreekt of is verouderd",
36
51
  "§14a-Kommunikationsfallback aktiv": "§14a-communicatieterugval actief",
@@ -7,7 +7,7 @@
7
7
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
8
8
  *
9
9
  * Quelle: src-ts/runtime-executables/www/live-display.ts
10
- * Quell-Hash: sha256:8526f2adf4071d0d91a5962fbcf786d215ed1dc893783e5408a283e22bf96acc
10
+ * Quell-Hash: sha256:ce0c757ad7a26ec5347cf1954a8b7949be4c5af625c09f3c6158f1987ba95a53
11
11
  * Erzeugung: npm run sync:ts-runtime-executables
12
12
  *
13
13
  * Zweck:
@@ -21,13 +21,6 @@
21
21
  * 3. npm run test:runtime-executables prüfen.
22
22
  */
23
23
  "use strict";
24
- /**
25
- * NexoWatt Quellcode-Erklärung (DE)
26
- * Aufgabe: Validiert ausschließlich sichtbare LIVE-Messwerte und Betriebsstatus.
27
- * Daten und Wirkung: Liest lokale Snapshot-Werte ohne API-/Schreibwirkung. Fehlend,
28
- * veraltet und offline bleiben unbekannt; die echte Zahl 0 bleibt eine Messung.
29
- * Bei Änderungen: Null, konstant bestätigte Werte, Zukunftszeit und Ausfälle prüfen.
30
- */
31
24
  (() => {
32
25
  const record = (value) => !!value && typeof value === 'object' && !Array.isArray(value);
33
26
  function entry(snapshot, key) {
@@ -131,31 +124,148 @@
131
124
  return missing;
132
125
  }
133
126
  }
127
+ const farmPowerWarningLimitW = 200;
128
+ const finite = (value) => typeof value === 'number' && Number.isFinite(value);
129
+ const stamp = (value) => finite(value) && Number.isSafeInteger(value) && value > 0;
130
+ /** Diagnose eines einzelnen, zeitlich belegten Batterieauftrags. Positiv bedeutet Entladen. */
131
+ function compareFarmPower(targetW, measuredW, commandAt, sampledAt, validUntil, now, domain) {
132
+ if (domain !== undefined && domain !== 'ess-ac')
133
+ return null;
134
+ if (!finite(targetW) || !finite(measuredW) || !finite(commandAt) || !finite(sampledAt) || !finite(validUntil) || !finite(now))
135
+ return null;
136
+ const expiry = Math.min(validUntil, sampledAt + 30000);
137
+ if (commandAt <= 0 || sampledAt <= commandAt || sampledAt > now || now > expiry)
138
+ return null;
139
+ const differenceW = Math.abs(targetW - measuredW);
140
+ if (!finite(differenceW))
141
+ return null;
142
+ return { v: 1, ...(domain ? { domain } : {}), targetW, measuredW, differenceW, commandAt, sampledAt, validUntil: expiry, warning: differenceW > farmPowerWarningLimitW };
143
+ }
144
+ function farmKey(row) {
145
+ return record(row) && typeof row.dispatchKey === 'string' && row.dispatchKey.length <= 512 ? row.dispatchKey.trim() : '';
146
+ }
147
+ // The EMS owns command acceptance, sign and warning threshold. The same reader
148
+ // validates its timed evidence for the dashboard, farm page and mail service.
149
+ function farmPowerComparison(row, now) {
150
+ if (!record(row) || row.online !== true || !farmKey(row) || !finite(now))
151
+ return null;
152
+ const report = row.powerComparison;
153
+ if (!record(report) || report.v !== 1 || typeof report.warning !== 'boolean')
154
+ return null;
155
+ const { targetW, measuredW, differenceW, commandAt, sampledAt, validUntil, domain } = report;
156
+ if (domain !== undefined && domain !== 'ess-ac')
157
+ return null;
158
+ if (!finite(targetW) || !finite(measuredW) || !finite(differenceW) || differenceW !== Math.abs(targetW - measuredW)
159
+ || report.warning !== (differenceW > farmPowerWarningLimitW)
160
+ || !stamp(sampledAt) || !stamp(commandAt) || !stamp(validUntil) || commandAt >= sampledAt
161
+ || sampledAt > now || now > validUntil || validUntil - sampledAt > 30000)
162
+ return null;
163
+ return { v: 1, targetW, measuredW, differenceW, commandAt, sampledAt, validUntil, warning: report.warning,
164
+ ...(domain === 'ess-ac' ? { domain } : {}) };
165
+ }
166
+ // The atomic farm payload is immutable between SSE updates. Retain only small
167
+ // warning candidates; duplicate device keys never produce an attributable alarm.
168
+ const farmCandidates = new WeakMap();
169
+ function farmWarnings(state, now) {
170
+ if (!record(state) || !stamp(state.ts) || state.ts > now || !confirmed(state, now, 30000)
171
+ || typeof state.value !== 'string' || state.value.length > 262144)
172
+ return [];
173
+ let candidates = farmCandidates.get(state);
174
+ if (!candidates) {
175
+ candidates = [];
176
+ try {
177
+ const rows = JSON.parse(state.value);
178
+ if (Array.isArray(rows) && rows.length <= 128) {
179
+ const seen = new Set(), duplicates = new Set();
180
+ for (const row of rows) {
181
+ const key = farmKey(row);
182
+ if (!key)
183
+ continue;
184
+ if (seen.has(key))
185
+ duplicates.add(key);
186
+ seen.add(key);
187
+ if (record(row) && record(row.powerComparison) && row.powerComparison.warning === true) {
188
+ candidates.push({ dispatchKey: key, name: row.name, online: row.online, powerComparison: row.powerComparison });
189
+ }
190
+ }
191
+ candidates = candidates.filter(row => !duplicates.has(farmKey(row)));
192
+ }
193
+ }
194
+ catch { /* Incomplete or malformed evidence cannot establish a deviation. */ }
195
+ farmCandidates.set(state, candidates);
196
+ }
197
+ const result = [];
198
+ for (const row of candidates) {
199
+ const report = farmPowerComparison(row, now);
200
+ if (report?.warning)
201
+ result.push({ key: farmKey(row), name: typeof row.name === 'string' ? row.name.trim().slice(0, 64) : '', differenceW: report.differenceW });
202
+ }
203
+ return result;
204
+ }
205
+ // Ordinary power updates belong to the ten-second display frame. A change
206
+ // of affected storage units gets an immediate diagnostic refresh.
207
+ function farmWarningChanged(before, after, now) {
208
+ const a = farmWarnings(before, now), b = farmWarnings(after, now);
209
+ return a.length !== b.length || a.some((warning, i) => warning.key !== b[i]?.key);
210
+ }
134
211
  const processIds = ['ui', 'ems', 'devices', 'eebus', 'backup', 'ocpp'];
135
212
  // Older snapshots omit ack. An explicit unconfirmed value cannot establish operational health.
136
213
  function confirmed(row, now, maxAge) {
137
214
  return current(row, now, maxAge, true) && (row?.ack === undefined || row.ack === true);
138
215
  }
216
+ const aliveIssue = { missing: 'EMS-Betriebsmeldung fehlt', invalid: 'EMS-Betriebsmeldung ungültig', stale: 'EMS-Betriebsmeldung veraltet' };
217
+ const beatIssue = { missing: 'EMS-Herzschlag fehlt', invalid: 'EMS-Herzschlag ungültig', stale: 'EMS-Herzschlag veraltet' };
218
+ const gridIssue = { missing: 'NVP-Bestätigung fehlt', invalid: 'NVP-Bestätigung ungültig', stale: 'NVP-Bestätigung veraltet' };
219
+ function reportIssue(row, now, isHeartbeat) {
220
+ if (row === null || row === undefined)
221
+ return 'missing';
222
+ if (!record(row) || (row.ack !== undefined && row.ack !== true) || (row.q !== undefined && row.q !== 0))
223
+ return 'invalid';
224
+ const ts = number(row.ts);
225
+ if (ts === null || ts <= 0 || ts > now + 5000)
226
+ return 'invalid';
227
+ let observedAt = ts;
228
+ if (isHeartbeat) {
229
+ const beat = number(row.value);
230
+ if (beat === null || beat <= 0 || beat > now + 5000)
231
+ return 'invalid';
232
+ observedAt = Math.min(ts, beat);
233
+ }
234
+ else if (typeof row.value !== 'boolean')
235
+ return 'invalid';
236
+ return now - observedAt > 30000 ? 'stale' : null;
237
+ }
238
+ // An ordinary heartbeat advances the timestamp without changing what the operator sees.
239
+ function reportChanged(previous, next, now, isHeartbeat) {
240
+ const before = reportIssue(previous, now, isHeartbeat), after = reportIssue(next, now, isHeartbeat);
241
+ return before !== after || (!after && !isHeartbeat && record(previous) && record(next) && previous.value !== next.value);
242
+ }
139
243
  function status(snapshot, online, now, gridMaxAge = 30000) {
140
244
  if (!online)
141
245
  return { ems: 'Verbindung unterbrochen', grid: 'Messstatus unbekannt', summary: 'Verbindung unterbrochen', phase: 'offline' };
142
246
  const alive = entry(snapshot, 'ems.core.schedulerAlive');
143
247
  const beat = entry(snapshot, 'ems.core.schedulerHeartbeatAt');
144
- const heartbeat = confirmed(beat, now, 30000) ? number(beat?.value) : null;
145
- const aliveKnown = confirmed(alive, now, 30000);
146
- const running = aliveKnown && alive?.value === true && heartbeat !== null && heartbeat > 0 && heartbeat <= now + 5000 && now - heartbeat <= 30000;
147
- const stopped = aliveKnown && alive?.value === false;
148
248
  const nvp = entry(snapshot, 'ems.gridMeasurementFresh');
149
- const gridKnown = confirmed(nvp, now, 30000) && typeof nvp?.value === 'boolean';
150
- const gridFresh = gridKnown && nvp?.value === true;
151
- const grid = entry(snapshot, 'derived.core.grid.netW');
152
- const legacyGrid = record(snapshot) && !Object.hasOwn(snapshot, 'ems.gridMeasurementFresh');
153
- const gridObserved = legacyGrid && confirmed(grid, now, gridMaxAge) && number(grid?.value) !== null;
154
- const phase = stopped ? 'stopped' : gridKnown && !gridFresh ? 'grid-unavailable'
155
- : running && gridFresh ? 'healthy' : 'unknown';
156
- return { ems: running ? 'Aktiv' : stopped ? 'Gestoppt' : 'Status unbekannt',
157
- grid: gridFresh || gridObserved ? 'Messung aktuell' : gridKnown ? 'Messung fehlt / veraltet' : 'Messstatus unbekannt',
158
- summary: running && gridFresh ? 'EMS aktiv · NVP-Messung aktuell' : stopped ? 'EMS gestoppt' : 'Betriebsstatus prüfen', phase };
249
+ const aliveProblem = reportIssue(alive, now, false), beatProblem = reportIssue(beat, now, true);
250
+ const gridProblem = reportIssue(nvp, now, false);
251
+ const stopped = !aliveProblem && alive?.value === false;
252
+ const emsProblem = aliveProblem ? aliveIssue[aliveProblem] : beatProblem ? beatIssue[beatProblem] : '';
253
+ const gridUnavailable = !gridProblem && nvp?.value === false;
254
+ const gridDiagnosis = gridProblem ? gridIssue[gridProblem] : '';
255
+ let grid = gridUnavailable ? 'Messung fehlt / veraltet' : gridDiagnosis || 'Messung aktuell';
256
+ if (gridProblem === 'missing' && record(snapshot) && !Object.hasOwn(snapshot, 'ems.gridMeasurementFresh')) {
257
+ const measurement = entry(snapshot, 'derived.core.grid.netW');
258
+ if (confirmed(measurement, now, gridMaxAge) && number(measurement?.value) !== null)
259
+ grid = 'Messwert vorhanden · Bestätigung fehlt';
260
+ }
261
+ const ems = stopped ? 'Gestoppt' : emsProblem || 'Aktiv';
262
+ if (stopped)
263
+ return { ems, grid, summary: 'EMS gestoppt', phase: 'stopped' };
264
+ if (gridUnavailable)
265
+ return { ems, grid, summary: 'Netzmessung fehlt oder ist veraltet', phase: 'grid-unavailable' };
266
+ if (emsProblem || gridDiagnosis)
267
+ return { ems, grid, summary: emsProblem || gridDiagnosis, phase: 'unknown' };
268
+ return { ems, grid, summary: 'EMS aktiv · NVP-Messung aktuell', phase: 'healthy' };
159
269
  }
160
270
  function validIds(value) {
161
271
  return Array.isArray(value) && value.length <= processIds.length &&
@@ -206,20 +316,20 @@
206
316
  return { text: 'Netzmessung fehlt oder ist veraltet', level: 'warn' };
207
317
  if (processes?.waiting.length)
208
318
  return { text: 'Wartet auf Übernahme · {names}', level: 'warn', processIds: processes.waiting };
209
- if (!emsPaused && health?.phase !== 'healthy')
210
- return { text: 'Betriebsstatus prüfen', level: 'warn' };
211
319
  if (p14Fallback)
212
320
  return { text: '§14a-Kommunikationsfallback aktiv', level: 'warn' };
213
321
  if (chargeModel && chargeModel.total > 0 && chargeModel.overallLevel === 'warn') {
214
322
  return { text: chargeModel.systemText, level: 'warn' };
215
323
  }
324
+ if (!emsPaused && health?.phase !== 'healthy')
325
+ return { text: health?.summary || 'Betriebsdiagnose nicht verfügbar', level: 'warn' };
216
326
  if (processes?.state !== 'ok')
217
327
  return { text: 'Prozessstatus unbekannt', level: 'warn' };
218
328
  if (emsPaused)
219
329
  return { text: 'EMS pausiert', level: 'info' };
220
330
  return { text: 'Alle Systeme normal', level: 'ok' };
221
331
  }
222
- function dashboardStatus(health, connection, chargeModel, safetyStop, p14Fallback, processSnapshot, now = Date.now()) {
332
+ function dashboardStatus(health, connection, chargeModel, safetyStop, p14Fallback, processSnapshot, now = Date.now(), farmState) {
223
333
  const processes = processHealth(processSnapshot, now);
224
334
  const primary = operatingStatus(health, connection, chargeModel, safetyStop, p14Fallback, processes);
225
335
  const devices = processes && record(processSnapshot) ? processSnapshot.deviceHealth : null;
@@ -241,8 +351,16 @@
241
351
  devices.totalOffline === 0 && Array.isArray(devices.offline) && devices.offline.length === 0)) {
242
352
  return { text: 'Gerätestatus unbekannt', level: 'warn' };
243
353
  }
354
+ if (primary.level === 'ok') {
355
+ const storageWarnings = farmWarnings(farmState, now);
356
+ if (storageWarnings.length)
357
+ return { text: 'Speicherabweichung: {name} · {watts} W', level: 'warn', storageWarnings };
358
+ }
244
359
  return primary;
245
360
  }
246
- const host = window;
247
- host.NexoWattLiveDisplay = Object.freeze({ read, farm, status, dashboardStatus, buildingQuality });
361
+ const view = Object.freeze({ read, farm, status, dashboardStatus, reportChanged, buildingQuality, farmPowerComparison, farmWarningChanged });
362
+ if (typeof window !== 'undefined')
363
+ window.NexoWattLiveDisplay = view;
364
+ if (typeof module !== 'undefined' && module.exports)
365
+ module.exports = { compareFarmPower, farmPowerComparison, farmPowerWarningLimitW };
248
366
  })();
@@ -50,8 +50,8 @@
50
50
  "purpose": "any"
51
51
  }
52
52
  ],
53
- "version": "9.0.36",
54
- "appVersion": "9.0.36",
53
+ "version": "9.0.39",
54
+ "appVersion": "9.0.39",
55
55
  "id": "/",
56
56
  "lang": "de",
57
57
  "description": "NexoWatt EOS – Energie und SmartHome auf deinem Gerät."