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
@@ -7,7 +7,7 @@
7
7
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
8
8
  *
9
9
  * Quelle: src-ts/runtime-executables/ems/modules/charging-management.ts
10
- * Quell-Hash: sha256:52f80d763e27fa9547b52142ae16a79e63485d77d4f8b693a2f625c98966bd15
10
+ * Quell-Hash: sha256:57736262108314931f0df166a7002ee7747fbacb0e6491bfd4348d3d840476a7
11
11
  * Erzeugung: npm run sync:ts-runtime-executables
12
12
  *
13
13
  * Zweck:
@@ -63,6 +63,7 @@ const {
63
63
  resolveChargingStrategyOverlay,
64
64
  } = require('../services/operating-strategy-runtime');
65
65
  const { buildRuntimeGoalPlanMap, goalPlanStateRows, resolvePlanEffectiveMode, applyGoalPlan, applyStrategyOverlay, resolveGoalCommandStatus, resolveZeroExportChargingPolicy, runtimeChargingMaximumW } = require('../services/forecast-target-runtime-bridge');
66
+ const { deadlineChargingCapacityW } = require('../services/forecast-aware-target-planner');
66
67
 
67
68
  /**
68
69
  * Estimates the power the currently eligible EVCS fleet would request before
@@ -4992,6 +4993,12 @@ class ChargingManagementModule extends BaseModule {
4992
4993
  try {
4993
4994
  const sc = a && a.stateCache;
4994
4995
  if (sc) {
4996
+ // A subscribed live update can arrive while the initial read is
4997
+ // pending. Prefer that observation over the older DB response.
4998
+ const live = sc[sid];
4999
+ if (live && Object.hasOwn(live, 'value')) {
5000
+ return checked({ val: live.value, ts: live.ts, lc: live.ts, ack: true });
5001
+ }
4995
5002
  const ts = st && (typeof st.ts === 'number' ? st.ts : (typeof st.lc === 'number' ? st.lc : now));
4996
5003
  sc[sid] = { value: st ? st.val : null, ts: ts || now };
4997
5004
  }
@@ -5456,7 +5463,7 @@ class ChargingManagementModule extends BaseModule {
5456
5463
 
5457
5464
  /** Code-Teil: Methode `_ensureWallboxChannel` – stellt Objekte/States/Strukturen sicher, ohne bestehende Konfiguration unnötig zu überschreiben. */
5458
5465
  /** Code-Teil: _ensureWallboxChannel – Verarbeitet Wallbox-/Ladepunktdaten und Feature-Sichtbarkeit. */
5459
- async _ensureWallboxChannel(key) {
5466
+ async _ensureWallboxChannel(key, wb) {
5460
5467
  const safe = toSafeIdPart(key);
5461
5468
  const ch = `chargingManagement.wallboxes.${safe}`;
5462
5469
  if (this._known.has(ch)) return ch;
@@ -5511,6 +5518,7 @@ class ChargingManagementModule extends BaseModule {
5511
5518
  'text',
5512
5519
  true,
5513
5520
  {
5521
+ def: normalizeWallboxModeOverride(wb?.userModeDefault || wb?.userMode || 'auto'),
5514
5522
  states: {
5515
5523
  auto: 'auto (global)',
5516
5524
  pv: 'pv surplus only',
@@ -5520,16 +5528,6 @@ class ChargingManagementModule extends BaseModule {
5520
5528
  },
5521
5529
  );
5522
5530
 
5523
- // Default value for the writable runtime state (do not overwrite user choice)
5524
- try {
5525
- const st = await this.adapter.getStateAsync(`${ch}.userMode`);
5526
- if (!st || st.val === null || st.val === undefined || String(st.val).trim() === '') {
5527
- await this.adapter.setStateAsync(`${ch}.userMode`, 'auto', true);
5528
- }
5529
- } catch {
5530
- // ignore
5531
- }
5532
-
5533
5531
  // Auto bleibt der einzige Ladebetriebsmodus, in dem eine Betriebsstrategie
5534
5532
  // die Zielplanung übernehmen darf. Standard bleibt der migrationssichere
5535
5533
  // Default; alle anderen Ladebetriebsarten ignorieren diese Auswahl.
@@ -5540,21 +5538,13 @@ class ChargingManagementModule extends BaseModule {
5540
5538
  'text',
5541
5539
  true,
5542
5540
  {
5543
- def: 'standard',
5541
+ def: normalizeStrategyAutoSource(wb?.userAutoSource || wb?.autoSource || 'standard'),
5544
5542
  states: {
5545
5543
  standard: 'NexoWatt Standard-Automatik',
5546
5544
  strategy: 'EOS Betriebsstrategie',
5547
5545
  },
5548
5546
  },
5549
5547
  );
5550
- try {
5551
- const st = await this.adapter.getStateAsync(`${ch}.userAutoSource`);
5552
- if (!st || st.val === null || st.val === undefined || String(st.val).trim() === '') {
5553
- await this.adapter.setStateAsync(`${ch}.userAutoSource`, 'standard', true);
5554
- }
5555
- } catch {
5556
- // ignore
5557
- }
5558
5548
 
5559
5549
  // Runtime, per-wallbox AC phase mode override (writable for VIS/LIVE UI)
5560
5550
  // Values: fixed-1p | fixed-3p | auto-pv
@@ -5668,47 +5658,6 @@ class ChargingManagementModule extends BaseModule {
5668
5658
  await mk('goalPlanPriceForecastUsed', 'Zeit-Ziel Preisprognose verwendet', 'boolean', 'indicator');
5669
5659
  await mk('goalPlanFallbackMode', 'Zeit-Ziel Fallbackmodus', 'string', 'text');
5670
5660
 
5671
- // Defaults for writable goal states (do not overwrite user choice)
5672
- try {
5673
- const st = await this.adapter.getStateAsync(`${ch}.goalEnabled`);
5674
- const cur = st ? st.val : null;
5675
- if (cur === null || cur === undefined || String(cur).trim() === '') {
5676
- await this.adapter.setStateAsync(`${ch}.goalEnabled`, false, true);
5677
- }
5678
- } catch {
5679
- // ignore
5680
- }
5681
-
5682
- try {
5683
- const st = await this.adapter.getStateAsync(`${ch}.goalTargetSocPct`);
5684
- const cur = st ? Number(st.val) : NaN;
5685
- if (!Number.isFinite(cur)) {
5686
- await this.adapter.setStateAsync(`${ch}.goalTargetSocPct`, 100, true);
5687
- }
5688
- } catch {
5689
- // ignore
5690
- }
5691
-
5692
- try {
5693
- const st = await this.adapter.getStateAsync(`${ch}.goalFinishTs`);
5694
- const cur = st ? Number(st.val) : NaN;
5695
- if (!Number.isFinite(cur)) {
5696
- await this.adapter.setStateAsync(`${ch}.goalFinishTs`, 0, true);
5697
- }
5698
- } catch {
5699
- // ignore
5700
- }
5701
-
5702
- try {
5703
- const st = await this.adapter.getStateAsync(`${ch}.goalBatteryKwh`);
5704
- const cur = st ? Number(st.val) : NaN;
5705
- if (!Number.isFinite(cur)) {
5706
- await this.adapter.setStateAsync(`${ch}.goalBatteryKwh`, 0, true);
5707
- }
5708
- } catch {
5709
- // ignore
5710
- }
5711
-
5712
5661
  await mk('effectiveMode', 'Effective mode', 'string', 'text');
5713
5662
  await mk('strategyEligible', 'Betriebsstrategie darf in Auto teilnehmen', 'boolean', 'indicator');
5714
5663
  await mk('strategyActive', 'Betriebsstrategie-Anforderung aktiv', 'boolean', 'indicator');
@@ -6162,6 +6111,13 @@ class ChargingManagementModule extends BaseModule {
6162
6111
  // Budget selection
6163
6112
  const budgetMode = String(cfg.totalBudgetMode || 'unlimited'); // unlimited | static | fromPeakShaving | fromDatapoint
6164
6113
  const staticBudgetW = clamp(num(cfg.staticMaxChargingPowerW, 0), 0, 1e12);
6114
+ // Eine wirtschaftliche Tarifsperre ist vorübergehend. Die wirksamen festen
6115
+ // Grenzen von Anlage und Station gelten auch im späteren Netzladefenster.
6116
+ const installedCapacityW = num(cfg.infrastructureCapacityW, 0);
6117
+ const goalSiteCapacityW = Math.min(
6118
+ installedCapacityW > 0 ? installedCapacityW : Number.POSITIVE_INFINITY,
6119
+ (budgetMode === 'engine' || budgetMode === 'static') && staticBudgetW > 0 ? staticBudgetW : Number.POSITIVE_INFINITY,
6120
+ );
6165
6121
  const budgetPowerId = String(cfg.budgetPowerId || '').trim();
6166
6122
  // Optional: provide grid power / PV surplus as explicit datapoints (avoids global Datapoints tab)
6167
6123
  const gridPowerId = String(cfg.gridPowerId || '').trim();
@@ -6374,7 +6330,7 @@ class ChargingManagementModule extends BaseModule {
6374
6330
  if (!key) continue;
6375
6331
 
6376
6332
  const safe = toSafeIdPart(key);
6377
- const ch = await this._ensureWallboxChannel(key);
6333
+ const ch = await this._ensureWallboxChannel(key, wb);
6378
6334
  const nativeMappingRoots = [...new Set(Object.entries(wb)
6379
6335
  .filter(([field, id]) => field.endsWith('Id') && typeof id === 'string')
6380
6336
  .map(([_field, id]) => ocppStationRoot(id)).filter(Boolean))];
@@ -6420,7 +6376,8 @@ class ChargingManagementModule extends BaseModule {
6420
6376
  }
6421
6377
 
6422
6378
  // Runtime mode override (writable state, used by VIS)
6423
- // If the runtime state is empty, initialize it ONCE from config default (userModeDefault).
6379
+ // Read the configured default until a user choice exists. A queued
6380
+ // startup default could otherwise overwrite a concurrent customer write.
6424
6381
  let userMode = 'auto';
6425
6382
  try {
6426
6383
  const st = await this._getStateCached(`${ch}.userMode`);
@@ -6428,11 +6385,6 @@ class ChargingManagementModule extends BaseModule {
6428
6385
  const def = normalizeWallboxModeOverride(wb.userModeDefault || wb.userMode || 'auto');
6429
6386
 
6430
6387
  if (cur === null || cur === undefined || String(cur).trim() === '') {
6431
- try {
6432
- await this._queueState(`${ch}.userMode`, def, true);
6433
- } catch {
6434
- // ignore
6435
- }
6436
6388
  userMode = def;
6437
6389
  } else {
6438
6390
  userMode = normalizeWallboxModeOverride(cur);
@@ -6448,7 +6400,6 @@ class ChargingManagementModule extends BaseModule {
6448
6400
  const configuredDefault = normalizeStrategyAutoSource(wb.userAutoSource || wb.autoSource || 'standard');
6449
6401
  if (cur === null || cur === undefined || String(cur).trim() === '') {
6450
6402
  userAutoSource = configuredDefault;
6451
- await this._queueState(`${ch}.userAutoSource`, configuredDefault, true);
6452
6403
  } else {
6453
6404
  userAutoSource = normalizeStrategyAutoSource(cur);
6454
6405
  }
@@ -6932,6 +6883,8 @@ class ChargingManagementModule extends BaseModule {
6932
6883
  if (ocppDatapointMappingMigrated) mappingIssues.push('ocpp21_native_mapping_migrated');
6933
6884
 
6934
6885
  let meterAgeMs = 0;
6886
+ const sampleTs = actualPowerWId && this.dp?.getVerifiedMeasurementTimestampMs?.(`cm.wb.${safe}.pW`, now);
6887
+ const meterSampleAgeMs = Number.isFinite(sampleTs) && sampleTs > 0 && sampleTs <= now ? now - sampleTs : null;
6935
6888
  let meterStale = false;
6936
6889
  if (actualPowerWId && this.dp && typeof this.dp.getAgeMs === 'function') {
6937
6890
  const age = this.dp.getAgeMs(`cm.wb.${safe}.pW`);
@@ -7511,7 +7464,7 @@ class ChargingManagementModule extends BaseModule {
7511
7464
 
7512
7465
  try {
7513
7466
  const st = await this._getStateCached(`${ch}.goalTargetSocPct`);
7514
- const v = st ? Number(st.val) : NaN;
7467
+ const v = st?.val;
7515
7468
  goalTargetSocPct = Number.isFinite(v) ? clamp(v, 0, 100) : 100;
7516
7469
  } catch {
7517
7470
  goalTargetSocPct = 100;
@@ -8020,6 +7973,8 @@ class ChargingManagementModule extends BaseModule {
8020
7973
  meterStale: effectiveMeterStale,
8021
7974
  meterRawStale: meterStale,
8022
7975
  meterAgeMs,
7976
+ meterSampleAgeMs: pWRawNum === null ? null : meterSampleAgeMs,
7977
+ measuredPowerW: pWRawNum !== null && meterSampleAgeMs !== null && meterSampleAgeMs <= wbMeterStaleTimeoutMs && !meterStale ? Math.abs(pWRawNum) : null,
8023
7978
  actualPowerWId,
8024
7979
  telemetryProfile,
8025
7980
  telemetryAutoDetected,
@@ -8526,7 +8481,7 @@ class ChargingManagementModule extends BaseModule {
8526
8481
  const deltaSoc = Number(w.goalDeltaSocPct);
8527
8482
  if (!Number.isFinite(deltaSoc) || deltaSoc <= 0) return { override: false, reason: 'no_need' };
8528
8483
 
8529
- const maxP = runtimeChargingMaximumW(w);
8484
+ const maxP = deadlineChargingCapacityW(runtimeChargingMaximumW(w), goalSiteCapacityW, w.stationKey, w.stationMaxPowerW);
8530
8485
  if (!Number.isFinite(maxP) || maxP <= 0) return { override: true, reason: 'no_power' };
8531
8486
 
8532
8487
  const battUser = Number(w.goalBatteryKwhUser);
@@ -8640,6 +8595,7 @@ class ChargingManagementModule extends BaseModule {
8640
8595
  }
8641
8596
 
8642
8597
  // Boost runtime timer: starts when the chargepoint is actually charging in boost mode
8598
+ w.goalTariffOverrideReason = goalTariffOverrideReason;
8643
8599
  let boostSince = this._boostSinceMs.get(w.safe) || 0;
8644
8600
  let boostUntil = 0;
8645
8601
  let boostRemainingMin = 0;
@@ -8736,6 +8692,9 @@ class ChargingManagementModule extends BaseModule {
8736
8692
  eff = zeroPolicy.effectiveMode;
8737
8693
  w.zeroExportGridMaxW = zeroPolicy.gridMaxW;
8738
8694
  w.effectiveMode = eff;
8695
+ // Tarifentscheidung dieses Ladepunkts für die spätere Zielplanung
8696
+ // erhalten. Ein fremder Boost kann das gemeinsame Netzbudget öffnen.
8697
+ w.goalGridBlocked = eff === 'pv' && (pvSurplusOnlyCfg || forcePvForW);
8739
8698
  w._boostTimedOut = boostTimedOut;
8740
8699
  w._boostNotAllowed = boostNotAllowed;
8741
8700
  w._boostTimeoutMinEffective = effBoostTimeoutMin;
@@ -11067,7 +11026,7 @@ if (components.length) {
11067
11026
 
11068
11027
  const goalPlanBySafe = buildRuntimeGoalPlanMap({
11069
11028
  now, wallboxes: sorted, budgetW, staticBudgetW,
11070
- infrastructureCapacityW: cfg.infrastructureCapacityW,
11029
+ infrastructureCapacityW: Number.isFinite(goalSiteCapacityW) ? goalSiteCapacityW : 0,
11071
11030
  totalActualW: totalFreshActualPowerW,
11072
11031
  loadRestW: this._getAdapterNumberFromCache('derived.core.building.loadRestW', null),
11073
11032
  loadTotalW: this._getAdapterNumberFromCache('derived.core.building.loadTotalW', null),
@@ -11185,10 +11144,14 @@ if (components.length) {
11185
11144
  const selectedMode = normalizeWallboxModeOverride(w.userMode);
11186
11145
  const goalPlan = w.goalPlan && typeof w.goalPlan === 'object' ? w.goalPlan : null;
11187
11146
  let effMode = resolvePlanEffectiveMode(w.userMode, w.effectiveMode, goalPlan, w.strategyOverlay, w.userAutoSource);
11147
+ if (goalPlan?.active === true && w.goalGridBlocked) effMode = 'pv';
11188
11148
  if (zeroExportChargingActive && selectedMode === 'auto' && goalPlan?.action === 'charge' && goalPlan.source === 'pv') effMode = 'pv';
11189
- // Nur im neuen Zweig den vom Zielplan aufgelösten Untermodus auch
11190
- // an Phasenwahl/TS-Guard/Writer geben. Der Bedienmodus bleibt Auto.
11191
- if (zeroExportChargingActive) w.effectiveMode = effMode;
11149
+ // Bei Nulleinspeisung erhalten Diagnose und Writer den im Zielplan
11150
+ // aufgelösten Untermodus. Die gespeicherte Bedienvorgabe bleibt Auto.
11151
+ if (zeroExportChargingActive && effMode !== w.effectiveMode) {
11152
+ w.effectiveMode = effMode;
11153
+ await this._queueState(`${w.ch}.effectiveMode`, effMode, true);
11154
+ }
11192
11155
  const isPvOnly = effMode === 'pv';
11193
11156
  const isMinPv = effMode === 'minpv';
11194
11157
  const isBoost = effMode === 'boost';
@@ -11458,6 +11421,7 @@ if (components.length) {
11458
11421
  const planned = applyGoalPlan({
11459
11422
  plan: goalPlan, userMode: w.userMode, effectiveMode: effMode,
11460
11423
  targetW, targetA, minPowerW: w.minPW, maxPowerW: modeMaxW,
11424
+ availablePvW: pvAvailW,
11461
11425
  totalAvailableW: fairTotalAvailW, stationAvailableW: fairStationAvailW,
11462
11426
  });
11463
11427
  targetW = planned.targetW; targetA = planned.targetA;
@@ -7,7 +7,7 @@
7
7
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
8
8
  *
9
9
  * Quelle: src-ts/runtime-executables/ems/modules/para14a.ts
10
- * Quell-Hash: sha256:9f7a9f836cb28da9b5419fc822da6b223f48f6c74421539f1448106af11998e1
10
+ * Quell-Hash: sha256:7219232d9d414842c9c091a7400cf28db294467aa79bda6698d1df401c49c169
11
11
  * Erzeugung: npm run sync:ts-runtime-executables
12
12
  *
13
13
  * Zweck:
@@ -526,6 +526,7 @@ class Para14aModule extends BaseModule {
526
526
  */
527
527
  async _setupAuditHistory() {
528
528
  let historyInstance = '';
529
+ let providerReady = true;
529
530
  let dedicatedHistory = false;
530
531
  let autoProvisioned = false;
531
532
  let provisionState = '';
@@ -536,6 +537,7 @@ class Para14aModule extends BaseModule {
536
537
  const historyInfo = await this.adapter._nwEnsurePara14aInfluxInstance();
537
538
  if (historyInfo && typeof historyInfo === 'object') {
538
539
  historyInstance = String(historyInfo.instance || '').trim();
540
+ providerReady = historyInfo.ready !== false;
539
541
  dedicatedHistory = historyInfo.dedicated === true;
540
542
  autoProvisioned = historyInfo.autoProvisioned === true;
541
543
  provisionState = String(historyInfo.provisionState || '').trim();
@@ -551,14 +553,17 @@ class Para14aModule extends BaseModule {
551
553
  try {
552
554
  if (this.adapter && typeof this.adapter._nwDetectInfluxInstance === 'function') {
553
555
  historyInstance = String((await this.adapter._nwDetectInfluxInstance()) || '').trim();
554
- if (historyInstance && !provisionState) provisionState = 'fallback_existing';
556
+ if (historyInstance) {
557
+ providerReady = true;
558
+ if (!provisionState) provisionState = 'fallback_existing';
559
+ }
555
560
  }
556
561
  } catch {
557
562
  historyInstance = '';
558
563
  }
559
564
  }
560
565
 
561
- const historyReady = !!historyInstance && !!(this.adapter && typeof this.adapter._nwEnsureInfluxCustom === 'function');
566
+ const historyReady = providerReady && !!historyInstance && !!(this.adapter && typeof this.adapter._nwEnsureInfluxCustom === 'function');
562
567
  this._audit.historyInstance = historyInstance;
563
568
  this._audit.historyReady = historyReady;
564
569
 
@@ -7,7 +7,7 @@
7
7
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
8
8
  *
9
9
  * Quelle: src-ts/runtime-executables/ems/modules/storage-control.ts
10
- * Quell-Hash: sha256:0e05be0f979975a11f1064b0a4eca4959906ecdd5ead8eab6afccd67d1a6965e
10
+ * Quell-Hash: sha256:b9fac4a7bc07981e3690b175bab60290201fa8c6d4c8bdcdd016577f455c22ea
11
11
  * Erzeugung: npm run sync:ts-runtime-executables
12
12
  *
13
13
  * Zweck:
@@ -1662,7 +1662,7 @@ class SpeicherRegelungModule extends BaseModule {
1662
1662
  await this._setIfChanged('speicher.regelung.requestW', null);
1663
1663
  await this._setIfChanged('speicher.regelung.requestQuelle', 'aus');
1664
1664
  await this._setIfChanged('speicher.regelung.requestGrund', 'Deaktiviert');
1665
- await this._setIfChanged('speicher.regelung.dispatcherJson', JSON.stringify({ ts: Date.now(), disabled: true, reason: 'Deaktiviert' }));
1665
+ await this._setIfChanged('speicher.regelung.dispatcherJson', JSON.stringify({ ts: Date.now(), active: enabled, disabled: true, src: 'aus', reason: 'Deaktiviert' }));
1666
1666
  await this._setStorageNvpBalanceDiag(null);
1667
1667
  await this._setIfChanged('speicher.regelung.batteryPowerBalanceTrusted', false);
1668
1668
  await this._setIfChanged('speicher.regelung.batteryPowerFeedbackMode', 'inactive');
@@ -1883,6 +1883,7 @@ class SpeicherRegelungModule extends BaseModule {
1883
1883
  await this._setIfChanged('speicher.regelung.schreibStatus', 'fenecon-config-invalid');
1884
1884
  await this._setIfChanged('speicher.regelung.dispatcherJson', JSON.stringify({
1885
1885
  ts: Date.now(),
1886
+ active: enabled,
1886
1887
  reqW: null,
1887
1888
  reason: invalidReason,
1888
1889
  src: 'fenecon-invalid',
@@ -1896,7 +1897,7 @@ class SpeicherRegelungModule extends BaseModule {
1896
1897
  await this._setIfChanged('speicher.regelung.requestW', 0);
1897
1898
  await this._setIfChanged('speicher.regelung.requestQuelle', 'aus');
1898
1899
  await this._setIfChanged('speicher.regelung.requestGrund', unsupportedReason);
1899
- await this._setIfChanged('speicher.regelung.dispatcherJson', JSON.stringify({ ts: Date.now(), reqW: 0, reason: unsupportedReason, src: 'aus' }));
1900
+ await this._setIfChanged('speicher.regelung.dispatcherJson', JSON.stringify({ ts: Date.now(), active: enabled, reqW: 0, reason: unsupportedReason, src: 'aus' }));
1900
1901
  await this._applyTargetW(0, unsupportedReason, 'aus');
1901
1902
  return;
1902
1903
  }
@@ -1910,7 +1911,7 @@ class SpeicherRegelungModule extends BaseModule {
1910
1911
  await this._setIfChanged('speicher.regelung.requestW', 0);
1911
1912
  await this._setIfChanged('speicher.regelung.requestQuelle', 'aus');
1912
1913
  await this._setIfChanged('speicher.regelung.requestGrund', missingTargetReason);
1913
- await this._setIfChanged('speicher.regelung.dispatcherJson', JSON.stringify({ ts: Date.now(), reqW: 0, reason: missingTargetReason, src: 'aus' }));
1914
+ await this._setIfChanged('speicher.regelung.dispatcherJson', JSON.stringify({ ts: Date.now(), active: enabled, reqW: 0, reason: missingTargetReason, src: 'aus' }));
1914
1915
  await this._applyTargetW(0, missingTargetReason, 'aus');
1915
1916
  return;
1916
1917
  }
@@ -2274,6 +2275,7 @@ class SpeicherRegelungModule extends BaseModule {
2274
2275
  await this._setIfChanged('speicher.regelung.requestGrund', heldReason);
2275
2276
  await this._setIfChanged('speicher.regelung.dispatcherJson', JSON.stringify({
2276
2277
  ts: now,
2278
+ active: enabled,
2277
2279
  reqW: Math.round(heldW),
2278
2280
  reason: heldReason,
2279
2281
  src: heldSource,
@@ -2330,7 +2332,7 @@ class SpeicherRegelungModule extends BaseModule {
2330
2332
  await this._setIfChanged('speicher.regelung.requestW', 0);
2331
2333
  await this._setIfChanged('speicher.regelung.requestQuelle', 'aus');
2332
2334
  await this._setIfChanged('speicher.regelung.requestGrund', 'Netzleistung fehlt oder zu alt');
2333
- await this._setIfChanged('speicher.regelung.dispatcherJson', JSON.stringify({ ts: now, reqW: 0, reason: 'Netzleistung fehlt oder zu alt', src: 'aus' }));
2335
+ await this._setIfChanged('speicher.regelung.dispatcherJson', JSON.stringify({ ts: now, active: enabled, reqW: 0, reason: 'Netzleistung fehlt oder zu alt', src: 'aus' }));
2334
2336
 
2335
2337
  // Ein fehlender/veralteter NVP ist ein echter Sicherheitsfall. Auch beim
2336
2338
  // FENECON-/OpenEMS-Profil muss deshalb ein sicherer 0-W-Sollwert ueber den
@@ -6627,6 +6629,7 @@ const _prevRampW = (typeof this._lastTargetW === 'number' && Number.isFinite(thi
6627
6629
 
6628
6630
  const _diag = {
6629
6631
  ts: now,
6632
+ active: enabled,
6630
6633
  reqW: Number.isFinite(Number(_reqW)) ? Math.round(Number(_reqW)) : 0,
6631
6634
  clampW: Number.isFinite(Number(_clampW)) ? Math.round(Number(_clampW)) : 0,
6632
6635
  stepW: Number.isFinite(Number(_stepW)) ? Math.round(Number(_stepW)) : 0,
@@ -8905,6 +8908,7 @@ const _prevRampW = (typeof this._lastTargetW === 'number' && Number.isFinite(thi
8905
8908
  * ausdruecklich kein Schreibzugriff auf signed-, Split-, Run- oder Farm-DPs.
8906
8909
  */
8907
8910
  async _setHoldNoWriteTargetDiag(targetW, reason, source, status) {
8911
+ this.adapter?._sfInvalidatePowerTracking?.();
8908
8912
  const requestedW = Number.isFinite(Number(targetW)) ? Math.round(Number(targetW)) : 0;
8909
8913
  const lastSuccessfulW = Number.isFinite(Number(this._lastTargetW)) ? Math.round(Number(this._lastTargetW)) : 0;
8910
8914
  const visibleW = requestedW !== 0 ? requestedW : lastSuccessfulW;
@@ -8948,6 +8952,7 @@ const _prevRampW = (typeof this._lastTargetW === 'number' && Number.isFinite(thi
8948
8952
  * TypeScript: Parameter, Rückgabewert und verwendete Config-/State-Objekte später explizit typisieren.
8949
8953
  */
8950
8954
  async _setNoWriteTargetDiag(targetW, reason, source, status) {
8955
+ this.adapter?._sfInvalidatePowerTracking?.();
8951
8956
  const w = Number.isFinite(Number(targetW)) ? Math.round(Number(targetW)) : 0;
8952
8957
  try {
8953
8958
  const e = (this.dp && this.dp.getEntry) ? this.dp.getEntry('st.targetPowerW') : null;
@@ -7,7 +7,7 @@
7
7
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
8
8
  *
9
9
  * Quelle: src-ts/runtime-executables/ems/services/admin-overview-publisher.ts
10
- * Quell-Hash: sha256:357d37b8b985a5c58402839994ebdbeddce3344d6ae8f5ff91a2412593aa9c3a
10
+ * Quell-Hash: sha256:b13e20562f86bda73731f04330fd5b73c824a5ea21d14ab2b7eadd3890cd1896
11
11
  * Erzeugung: npm run sync:ts-runtime-executables
12
12
  *
13
13
  * Zweck:
@@ -845,6 +845,7 @@ class AdminOverviewPublisher {
845
845
  this.cycleWriteErrors = 0;
846
846
  this.cycleLastError = '';
847
847
  this.adapter = adapter;
848
+ this.publishToHost = typeof adapter.publishAdminOverviewJson === 'function' && adapter.hostNamespace !== adapter.namespace;
848
849
  this.intervalMs = Math.max(1000, Math.round(finite(options.intervalMs, DEFAULT_PUBLISH_INTERVAL_MS)));
849
850
  this.heartbeatIntervalMs = Math.max(500, Math.round(finite(options.heartbeatIntervalMs, DEFAULT_HEARTBEAT_INTERVAL_MS)));
850
851
  this.readTimeoutMs = Math.max(20, Math.round(finite(options.readTimeoutMs, DEFAULT_STATE_READ_TIMEOUT_MS)));
@@ -1106,9 +1107,6 @@ class AdminOverviewPublisher {
1106
1107
  async readState(id) {
1107
1108
  return this.runOperation('read', `state:${id}`, this.readTimeoutMs, async () => this.adapter.getStateAsync(id));
1108
1109
  }
1109
- async writeState(id, value) {
1110
- return this.runOperation('write', `state:${id}`, this.writeTimeoutMs, async () => (this.adapter.setStateAsync(id, { val: value, ack: true })));
1111
- }
1112
1110
  async ensureObject(id, object) {
1113
1111
  const result = await this.runOperation('write', `object:${id}`, this.objectTimeoutMs, async () => this.adapter.setObjectNotExistsAsync(id, object));
1114
1112
  if (!result.ok)
@@ -1341,12 +1339,20 @@ class AdminOverviewPublisher {
1341
1339
  const signature = typeof value === 'string' ? value : JSON.stringify(value);
1342
1340
  if (!force && this.lastValues.get(id) === signature)
1343
1341
  return true;
1344
- const write = await this.writeState(id, value);
1342
+ const localWrite = this.runOperation('write', `state:${id}`, this.writeTimeoutMs, () => this.adapter.setStateAsync(id, { val: value, ack: true }));
1343
+ const hostWrite = this.publishToHost && (id === 'info.adminOverview.summaryJson' || id === 'info.adminOverview.eventsJson')
1344
+ ? this.runOperation('write', `admin:${id}`, this.writeTimeoutMs, () => this.adapter.publishAdminOverviewJson(id, value))
1345
+ : null;
1346
+ const write = await localWrite;
1345
1347
  // Cache the signature only after a confirmed write. A timed-out write must
1346
1348
  // be retried later instead of being mistaken for an already published value.
1347
- if (write.ok)
1349
+ const hostResult = hostWrite ? await hostWrite : null;
1350
+ const confirmed = write.ok && !write.reused && (!hostResult || (hostResult.ok && !hostResult.reused));
1351
+ if (confirmed)
1348
1352
  this.lastValues.set(id, signature);
1349
- return write.ok;
1353
+ else
1354
+ this.lastValues.delete(id);
1355
+ return confirmed;
1350
1356
  }
1351
1357
  }
1352
1358
  module.exports = {
@@ -7,7 +7,7 @@
7
7
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
8
8
  *
9
9
  * Quelle: src-ts/runtime-executables/ems/services/charging-management-audit.ts
10
- * Quell-Hash: sha256:c0ececf63a472d400c9406d181d5484d0c64a8c43a7c65592676d53a9549a714
10
+ * Quell-Hash: sha256:3f5d3655f69e5853b9bf3748e8d66916457fcacef1202bfe45e44fa8ce56c0dc
11
11
  * Erzeugung: npm run sync:ts-runtime-executables
12
12
  *
13
13
  * Zweck:
@@ -193,6 +193,7 @@ function buildChargingAuditSnapshot(input = {}) {
193
193
  charging: row.charging === true,
194
194
  meterStale: row.meterStale === true || row.staleAny === true,
195
195
  statusClass: compactChargingAuditText(row.statusClass || '', 80),
196
+ statusFresh: rt.statusFresh === true,
196
197
  statusEffective: compactChargingAuditText(row.statusEffective || '', 120),
197
198
  faultActive: row.faultActive === true,
198
199
  faultReason: compactChargingAuditText(row.faultReason || '', 180),
@@ -201,6 +202,16 @@ function buildChargingAuditSnapshot(input = {}) {
201
202
  minimumPowerW: Math.max(0, finiteChargingAuditNumber(row.minPW, finiteChargingAuditNumber(row.minPowerW, 0))),
202
203
  phaseCount: Math.max(1, Math.min(3, finiteChargingAuditNumber(row.phases, finiteChargingAuditNumber(row.phaseCount, 1)))),
203
204
  actualPowerW: Math.round(actualW),
205
+ // The regulator may hold a previous value or assume zero. Only the
206
+ // independently timestamped meter sample belongs in the measured column.
207
+ measuredPowerW: Number.isFinite(rt.measuredPowerW) ? Math.round(rt.measuredPowerW) : null,
208
+ measurementQuality: Number.isFinite(rt.measuredPowerW) ? 'measured' : (Number.isFinite(rt.meterSampleAgeMs) ? 'stale' : 'missing'),
209
+ meterSampleAgeMs: Number.isFinite(rt.meterSampleAgeMs) ? rt.meterSampleAgeMs : null,
210
+ goalEnabled: typeof rt.goalEnabled === 'boolean' ? rt.goalEnabled : null,
211
+ goalFinishTs: Number.isSafeInteger(rt.goalFinishTs) && rt.goalFinishTs > 0 ? rt.goalFinishTs : null,
212
+ goalVehicleSocPct: Number.isFinite(rt.goalVehicleSocPct) ? rt.goalVehicleSocPct : null,
213
+ goalTargetSocPct: Number.isFinite(rt.goalTargetSocPct) ? rt.goalTargetSocPct : null,
214
+ goalTariffOverrideReason: compactChargingAuditText(rt.goalTariffOverrideReason, 80),
204
215
  requestedPowerW: Math.max(0, Math.round(requestedW || 0)),
205
216
  requestedCurrentA: Math.max(0, Math.round((requestedA || 0) * 10) / 10),
206
217
  targetPowerW: Math.round(targetW),
@@ -228,8 +239,12 @@ function buildChargingAuditSnapshot(input = {}) {
228
239
  record.limiter = deriveChargingAuditLimiter(record, globalBase);
229
240
  return record;
230
241
  });
242
+ const measuredTotalW = wallboxes.length && wallboxes.every(point => point.measuredPowerW !== null)
243
+ ? wallboxes.reduce((sum, point) => sum + point.measuredPowerW, 0) : null;
231
244
  const snapshot = {
232
245
  schemaVersion: 1,
246
+ measuredPowerW: measuredTotalW,
247
+ measurementQuality: measuredTotalW === null ? 'incomplete' : 'measured',
233
248
  ts,
234
249
  context: compactChargingAuditText(input.context || 'normal', 80),
235
250
  mode: compactChargingAuditText(input.mode || '', 64),
@@ -322,6 +337,9 @@ function chargingAuditEventSignature(snapshot) {
322
337
  row.online ? 1 : 0,
323
338
  row.connected ? 1 : 0,
324
339
  row.vehicleDemandConfirmed ? 1 : 0,
340
+ row.measurementQuality,
341
+ row.measuredPowerW === null ? '' : Math.round(row.measuredPowerW / 100),
342
+ row.goalEnabled, row.goalFinishTs, row.goalTargetSocPct, row.goalVehicleSocPct, row.goalTariffOverrideReason,
325
343
  Math.round(Number(row.actualPowerW || 0) / 100) * 100,
326
344
  Math.round(Number(row.requestedPowerW || 0) / 50) * 50,
327
345
  Math.round(Number(row.targetPowerW || 0) / 50) * 50,
@@ -380,6 +398,8 @@ function buildChargingAuditEvents(previousSnapshot, snapshot, options = {}) {
380
398
  name: 'Lademanagement',
381
399
  mode: snapshot.mode,
382
400
  actualPowerW: snapshot.actualPowerW,
401
+ measuredPowerW: snapshot.measuredPowerW,
402
+ measurementQuality: snapshot.measurementQuality,
383
403
  requestedPowerW: snapshot.targetPowerW,
384
404
  targetPowerW: snapshot.targetPowerW,
385
405
  targetCurrentA: 0,
@@ -399,6 +419,7 @@ function buildChargingAuditEvents(previousSnapshot, snapshot, options = {}) {
399
419
  const changed = !previous || [
400
420
  'mode', 'userMode', 'vehicleDemandReason', 'statusEffective', 'online', 'enabled', 'connected', 'vehicleDemandConfirmed', 'charging',
401
421
  'actualPowerW', 'requestedPowerW', 'targetPowerW', 'targetCurrentA',
422
+ 'measuredPowerW', 'measurementQuality', 'goalEnabled', 'goalFinishTs', 'goalVehicleSocPct', 'goalTargetSocPct', 'goalTariffOverrideReason',
402
423
  'reservedPowerW', 'pvShareW', 'storageShareW', 'limiter', 'reason',
403
424
  'applyStatus', 'safetyBinding', 'safetyReason', 'stationRemainingW',
404
425
  ].some((key) => previous[key] !== row[key]);
@@ -431,6 +452,14 @@ function buildChargingAuditEvents(previousSnapshot, snapshot, options = {}) {
431
452
  vehicleDemandReason: row.vehicleDemandReason,
432
453
  statusEffective: row.statusEffective,
433
454
  actualPowerW: row.actualPowerW,
455
+ measuredPowerW: row.measuredPowerW,
456
+ measurementQuality: row.measurementQuality,
457
+ meterSampleAgeMs: row.meterSampleAgeMs,
458
+ goalEnabled: row.goalEnabled,
459
+ goalFinishTs: row.goalFinishTs,
460
+ goalVehicleSocPct: row.goalVehicleSocPct,
461
+ goalTargetSocPct: row.goalTargetSocPct,
462
+ goalTariffOverrideReason: row.goalTariffOverrideReason,
434
463
  requestedPowerW: row.requestedPowerW,
435
464
  targetPowerW: row.targetPowerW,
436
465
  targetCurrentA: row.targetCurrentA,
@@ -458,6 +487,8 @@ function buildChargingAuditEvents(previousSnapshot, snapshot, options = {}) {
458
487
  name: 'Lademanagement',
459
488
  mode: snapshot.mode,
460
489
  actualPowerW: snapshot.actualPowerW,
490
+ measuredPowerW: snapshot.measuredPowerW,
491
+ measurementQuality: snapshot.measurementQuality,
461
492
  requestedPowerW: snapshot.targetPowerW,
462
493
  targetPowerW: snapshot.targetPowerW,
463
494
  targetCurrentA: 0,
@@ -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
  }