iobroker.eos-admin 9.0.30 → 9.0.33

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 (182) hide show
  1. package/NEXOWATT_EOS_BUILD_INFO.json +11 -12
  2. package/README.md +11 -11
  3. package/adminWww/.vite/manifest.json +39 -39
  4. package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +111 -110
  5. package/adminWww/apple-touch-icon-eos-v2.png +0 -0
  6. package/adminWww/apple-touch-icon.png +0 -0
  7. package/adminWww/assets/{AdapterUpdateDialog-qC6MANmq.js → AdapterUpdateDialog-DBUqmmyD.js} +1 -1
  8. package/adminWww/assets/{Adapters-C8quekd0.js → Adapters-dDEp7o5h.js} +1 -1
  9. package/adminWww/assets/{ConfigManager-hRZCAWRy.js → ConfigManager-DbqTWi2N.js} +1 -1
  10. package/adminWww/assets/{Enums-Dd0Z2KfV.js → Enums-DjldGElU.js} +1 -1
  11. package/adminWww/assets/{Fields-WfHFtdYw.js → Fields-0GsPCJeU.js} +1 -1
  12. package/adminWww/assets/{Files-DyG14v5-.js → Files-COnUtEbg.js} +1 -1
  13. package/adminWww/assets/{Hosts-3pSXVMxW.js → Hosts-CwU1LujG.js} +1 -1
  14. package/adminWww/assets/{Instances-DT6fp_TN.js → Instances-CUX5mxMQ.js} +1 -1
  15. package/adminWww/assets/{Intro-C6pMFhbu.js → Intro-BhQmHn3A.js} +1 -1
  16. package/adminWww/assets/{Logs-suepwNkZ.js → Logs-B5SpNqHq.js} +1 -1
  17. package/adminWww/assets/{Objects-CpjVeEjv.js → Objects-COg_cFkz.js} +1 -1
  18. package/adminWww/assets/{Overview-CxZJgF7X.js → Overview-CitzUjBF.js} +1 -1
  19. package/adminWww/assets/{State-CUsia7sz.js → State-D5ljzf-T.js} +1 -1
  20. package/adminWww/assets/{UsedResources-C3zr7pM8.js → UsedResources-BY_NF2wB.js} +1 -1
  21. package/adminWww/assets/{Users-BoBSUBkO.js → Users-Cu93_-VF.js} +1 -1
  22. package/adminWww/assets/{bootstrap-CM9qXoc1.js → bootstrap-Dwfxhm2V.js} +3 -3
  23. package/adminWww/assets/{hostInit-BQPg9kSQ.js → hostInit-3BbTwhaZ.js} +1 -1
  24. package/adminWww/assets/{icons-material-CDhwkQ0o.js → icons-material-DjqX0l_7.js} +1 -1
  25. package/adminWww/assets/{index-BrXN_pu2.js → index-nddph2Sl.js} +2 -2
  26. package/adminWww/assets/{installSVGRenderer-BEgWxsNI.js → installSVGRenderer-CPDIwFAL.js} +1 -1
  27. package/adminWww/assets/{mf-entry-bootstrap-0-3ef6056c.js → mf-entry-bootstrap-0-d1f0f40f.js} +2 -2
  28. package/adminWww/index.html +24 -24
  29. package/adminWww/mf-manifest.json +1 -1
  30. package/adminWww/mf-stats.json +1 -1
  31. package/adminWww/remoteEntry-eos-9.0.33.js +12 -0
  32. package/adminWww/remoteEntry.js +1 -1
  33. package/build/lib/eosUiProcess.js +31 -14
  34. package/build/lib/eosUiProcess.js.map +1 -1
  35. package/build/lib/eosUiProcessRpc.js +3 -1
  36. package/build/lib/eosUiProcessRpc.js.map +1 -1
  37. package/build/lib/eosUiProcessWorker.js +6 -4
  38. package/build/lib/eosUiProcessWorker.js.map +1 -1
  39. package/build/lib/web.js +9 -8
  40. package/build/lib/web.js.map +1 -1
  41. package/docs/README.md +3 -2
  42. package/docs/reports/unified-9.0.31/PRUEFBERICHT.md +22 -0
  43. package/docs/reports/unified-9.0.31/PRUEFERGEBNISSE.json +112 -0
  44. package/docs/reports/unified-9.0.31/raw/INDEX.json +102 -0
  45. package/docs/reports/unified-9.0.31/raw/backend.log +5 -0
  46. package/docs/reports/unified-9.0.31/raw/branding-build-node22.log +59 -0
  47. package/docs/reports/unified-9.0.31/raw/branding-node24.log +17 -0
  48. package/docs/reports/unified-9.0.31/raw/frontend.log +151 -0
  49. package/docs/reports/unified-9.0.31/raw/https-build-node22.log +235 -0
  50. package/docs/reports/unified-9.0.31/raw/https-node24.log +46 -0
  51. package/docs/reports/unified-9.0.31/raw/installer.log +26 -0
  52. package/docs/reports/unified-9.0.31/raw/lint.log +5 -0
  53. package/docs/reports/unified-9.0.31/raw/modules.log +5 -0
  54. package/docs/reports/unified-9.0.31/raw/node22-tests-final.log +17170 -0
  55. package/docs/reports/unified-9.0.31/raw/node22-version.log +1 -0
  56. package/docs/reports/unified-9.0.31/raw/node24-tests-final.log +2862 -0
  57. package/docs/reports/unified-9.0.31/raw/node24-version.log +1 -0
  58. package/docs/reports/unified-9.0.31/raw/typecheck.log +5 -0
  59. package/docs/reports/unified-9.0.31/raw/ui-runtime.log +8 -0
  60. package/docs/reports/unified-9.0.31/raw/web-lint.log +0 -0
  61. package/docs/reports/unified-9.0.32/PRUEFBERICHT.md +34 -0
  62. package/docs/reports/unified-9.0.32/PRUEFERGEBNISSE.json +112 -0
  63. package/docs/reports/unified-9.0.32/raw/INDEX.json +102 -0
  64. package/docs/reports/unified-9.0.32/raw/backend.log +5 -0
  65. package/docs/reports/unified-9.0.32/raw/browser-cadence-headless.json +63 -0
  66. package/docs/reports/unified-9.0.32/raw/browser-flow-headless.json +328 -0
  67. package/docs/reports/unified-9.0.32/raw/focused.log +67 -0
  68. package/docs/reports/unified-9.0.32/raw/frontend.log +151 -0
  69. package/docs/reports/unified-9.0.32/raw/installer.log +26 -0
  70. package/docs/reports/unified-9.0.32/raw/lint.log +5 -0
  71. package/docs/reports/unified-9.0.32/raw/modules.log +5 -0
  72. package/docs/reports/unified-9.0.32/raw/node22-tests-final.log +17212 -0
  73. package/docs/reports/unified-9.0.32/raw/node22-version.log +1 -0
  74. package/docs/reports/unified-9.0.32/raw/node24-tests-final.log +2869 -0
  75. package/docs/reports/unified-9.0.32/raw/node24-version.log +1 -0
  76. package/docs/reports/unified-9.0.32/raw/sbom.log +2 -0
  77. package/docs/reports/unified-9.0.32/raw/typecheck.log +5 -0
  78. package/docs/reports/unified-9.0.32/raw/ui-runtime.log +8 -0
  79. package/docs/reports/unified-9.0.32/raw/version-parity-928-929.log +6 -0
  80. package/docs/reports/unified-9.0.33/PRUEFBERICHT.md +60 -0
  81. package/docs/reports/unified-9.0.33/PRUEFERGEBNISSE.json +112 -0
  82. package/docs/reports/unified-9.0.33/raw/INDEX.json +272 -0
  83. package/docs/reports/unified-9.0.33/raw/backend.log +5 -0
  84. package/docs/reports/unified-9.0.33/raw/browser/UI_REVIEW.json +147 -0
  85. package/docs/reports/unified-9.0.33/raw/browser/admin-bundle.log +136 -0
  86. package/docs/reports/unified-9.0.33/raw/browser/eos-backup-settings-browser.log +67 -0
  87. package/docs/reports/unified-9.0.33/raw/browser/eos-customer-tariff-startup-browser.log +43 -0
  88. package/docs/reports/unified-9.0.33/raw/browser/eos-energyflow-browser-smoke.log +438 -0
  89. package/docs/reports/unified-9.0.33/raw/browser/eos-energyflow-cadence-browser-10s.log +108 -0
  90. package/docs/reports/unified-9.0.33/raw/browser/eos-evcs-delete-browser.log +1 -0
  91. package/docs/reports/unified-9.0.33/raw/browser/eos-history-setup-browser-smoke.log +49 -0
  92. package/docs/reports/unified-9.0.33/raw/browser/eos-kiosk-browser.log +59 -0
  93. package/docs/reports/unified-9.0.33/raw/browser/eos-ocpp-admin-browser.log +71 -0
  94. package/docs/reports/unified-9.0.33/raw/browser/eos-ocpp-installer-discovery-browser.log +11 -0
  95. package/docs/reports/unified-9.0.33/raw/browser/eos-pwa-trust-browser.log +35 -0
  96. package/docs/reports/unified-9.0.33/raw/browser/eos-runtime-controls-browser.log +78 -0
  97. package/docs/reports/unified-9.0.33/raw/browser/eos-runtime-health-browser.log +49 -0
  98. package/docs/reports/unified-9.0.33/raw/browser/eos-runtime-login-browser.log +34 -0
  99. package/docs/reports/unified-9.0.33/raw/browser/smarthome.log +46 -0
  100. package/docs/reports/unified-9.0.33/raw/browser-ten-seconds.json +108 -0
  101. package/docs/reports/unified-9.0.33/raw/changed-test-coverage.json +116 -0
  102. package/docs/reports/unified-9.0.33/raw/connected-control-node22.jsonl +42 -0
  103. package/docs/reports/unified-9.0.33/raw/connected-control-summary-node22.json +103 -0
  104. package/docs/reports/unified-9.0.33/raw/connected-control-summary.json +103 -0
  105. package/docs/reports/unified-9.0.33/raw/connected-control.jsonl +42 -0
  106. package/docs/reports/unified-9.0.33/raw/display-ui-node22.log +162 -0
  107. package/docs/reports/unified-9.0.33/raw/display-ui.log +35 -0
  108. package/docs/reports/unified-9.0.33/raw/frontend.log +151 -0
  109. package/docs/reports/unified-9.0.33/raw/git-delivery-fix.log +10 -0
  110. package/docs/reports/unified-9.0.33/raw/installer.log +26 -0
  111. package/docs/reports/unified-9.0.33/raw/license-central-node24.log +173 -0
  112. package/docs/reports/unified-9.0.33/raw/lint-final.log +45 -0
  113. package/docs/reports/unified-9.0.33/raw/modules.log +5 -0
  114. package/docs/reports/unified-9.0.33/raw/node22-npm-version.log +1 -0
  115. package/docs/reports/unified-9.0.33/raw/node22-tests-final.log +17646 -0
  116. package/docs/reports/unified-9.0.33/raw/node22-version.log +1 -0
  117. package/docs/reports/unified-9.0.33/raw/node24-npm-version.log +1 -0
  118. package/docs/reports/unified-9.0.33/raw/node24-tests-final.log +2941 -0
  119. package/docs/reports/unified-9.0.33/raw/node24-version.log +1 -0
  120. package/docs/reports/unified-9.0.33/raw/process-final-node22.log +220 -0
  121. package/docs/reports/unified-9.0.33/raw/process-final-node24.log +110 -0
  122. package/docs/reports/unified-9.0.33/raw/ram-picker.jsonl +12 -0
  123. package/docs/reports/unified-9.0.33/raw/reg-combined-node22.log +622 -0
  124. package/docs/reports/unified-9.0.33/raw/reg-combined.log +108 -0
  125. package/docs/reports/unified-9.0.33/raw/sbom-final.log +8 -0
  126. package/docs/reports/unified-9.0.33/raw/tariff-update-all-final-node22.log +1185 -0
  127. package/docs/reports/unified-9.0.33/raw/typecheck-final.log +5 -0
  128. package/docs/reports/unified-9.0.33/raw/ui-functional-node24.log +430 -0
  129. package/docs/reports/unified-9.0.33/raw/ui-runtime-final-verification.log +1 -0
  130. package/docs/reports/unified-9.0.33/raw/update-controller-standard-7-2-5.log +4 -0
  131. package/docs/reports/unified-9.0.33/raw/worker-memory-eos933.log +12 -0
  132. package/docs/reports/unified-9.0.33/raw/worker-memory-flow932.log +12 -0
  133. package/docs/start/START_HIER_9.0.31.md +16 -0
  134. package/docs/start/START_HIER_9.0.32.md +16 -0
  135. package/docs/start/START_HIER_9.0.33.md +32 -0
  136. package/io-package.json +16 -16
  137. package/package.json +10 -5
  138. package/public/eos-tls/trust.html +1 -1
  139. package/release-manifests/unified/build-environment.cdx.json +6 -6
  140. package/release-manifests/unified/files.json +259 -157
  141. package/release-manifests/unified/frontend.cdx.json +6 -6
  142. package/release-manifests/unified/installer.cdx.json +6 -6
  143. package/release-manifests/unified/obsolete-admin-assets.json +341 -88
  144. package/release-manifests/unified/runtime.cdx.json +26 -26
  145. package/release-manifests/unified/validation.json +15 -15
  146. package/tools/eos-release-manifest.cjs +2 -2
  147. package/ui/ems/consumers/sg-ready.js +26 -6
  148. package/ui/ems/datapoints.js +12 -4
  149. package/ui/ems/modules/charging-management.js +58 -67
  150. package/ui/ems/modules/core-limits.js +59 -36
  151. package/ui/ems/modules/prime-mover-control.js +141 -29
  152. package/ui/ems/modules/storage-control.js +31 -38
  153. package/ui/ems/modules/storage-mapping.js +14 -13
  154. package/ui/ems/modules/tarif-vis.js +38 -56
  155. package/ui/ems/services/measurement-freshness.js +58 -21
  156. package/ui/ems/services/safety-envelope.js +13 -6
  157. package/ui/io-package.json +13 -1
  158. package/ui/lib/datapoint-picker.js +27 -20
  159. package/ui/lib/eos-presentation-routes.js +2 -5
  160. package/ui/lib/tariff-price.js +7 -1
  161. package/ui/lib/ts-mirrors/ems/core-limits/core-runtime.js +5 -1
  162. package/ui/lib/ui-access-policy.js +12 -3
  163. package/ui/main.js +280 -190
  164. package/ui/package.json +4 -3
  165. package/ui/www/app.js +207 -87
  166. package/ui/www/ems-apps.html +1 -1
  167. package/ui/www/ems-apps.js +3 -2
  168. package/ui/www/energy-ledger.html +1 -1
  169. package/ui/www/evcs.html +1 -1
  170. package/ui/www/history.html +1 -1
  171. package/ui/www/index.html +2 -1
  172. package/ui/www/live-display.js +38 -4
  173. package/ui/www/logic.html +1 -1
  174. package/ui/www/login.html +1 -1
  175. package/ui/www/manifest.webmanifest +2 -2
  176. package/ui/www/power-measurements.js +28 -3
  177. package/ui/www/settings.html +1 -1
  178. package/ui/www/simulation.html +1 -1
  179. package/ui/www/smarthome-config.html +1 -1
  180. package/ui/www/smarthome.html +1 -1
  181. package/ui/www/storagefarm.html +1 -1
  182. package/adminWww/remoteEntry-eos-9.0.30.js +0 -12
package/ui/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexowatt-eos-ui-internal",
3
- "version": "9.0.30",
3
+ "version": "9.0.33",
4
4
  "description": "Internal UI and EMS module hosted by iobroker.eos-admin; not an ioBroker adapter entry point.",
5
5
  "author": "NexoWatt",
6
6
  "license": "UNLICENSED",
@@ -329,8 +329,9 @@
329
329
  "test:actuator-blocked-write-propagation": "node scripts/verify-actuator-blocked-write-propagation.js",
330
330
  "test:pv-surplus-dynamic-storage-remainder": "node scripts/verify-pv-surplus-dynamic-storage-remainder.js",
331
331
  "test:actuator-c3-threshold-relay": "node scripts/verify-actuator-c3-threshold-relay.js",
332
- "test:live-energy-flow-5s-cadence": "node scripts/verify-live-energy-flow-5s-cadence.js",
333
- "test:live-energy-flow-15s-cadence": "npm run test:live-energy-flow-5s-cadence",
332
+ "test:live-energy-flow-10s-cadence": "node scripts/verify-live-energy-flow-5s-cadence.js",
333
+ "test:live-energy-flow-5s-cadence": "npm run test:live-energy-flow-10s-cadence",
334
+ "test:live-energy-flow-15s-cadence": "npm run test:live-energy-flow-10s-cadence",
334
335
  "test:actuator-c3-thermal-heating": "node scripts/verify-actuator-c3-thermal-heating.js",
335
336
  "test:storage-zero-write-firewall-v2": "node scripts/verify-storage-zero-write-firewall-v2.js",
336
337
  "test:pv-source-dedup-cap": "node scripts/verify-pv-source-dedup-cap.js",
package/ui/www/app.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/app.ts
10
- * Quell-Hash: sha256:18104cb2b08b3c23c36643230efeb9f8a940be31f60d25193001491594db06ea
10
+ * Quell-Hash: sha256:b13e9e0e7f43fd59983d78f50e86e3b7fdf8f41c942fc607fce76311572a0231
11
11
  * Erzeugung: npm run sync:ts-runtime-executables
12
12
  *
13
13
  * Zweck:
@@ -470,7 +470,15 @@ const _RENDER_MIN_INTERVAL_MS = 120;
470
470
  * Zusammenhang: Teil von Kunden-LIVE-Frontend: Dashboard, Energiefluss, Schnellsteuerung; Aufrufstellen und abhängige States/APIs beim Ändern mitprüfen.
471
471
  * TypeScript: Parameter, Rückgabewert und verwendete Config-/State-Objekte später explizit typisieren.
472
472
  */
473
- function scheduleRender(force = false){
473
+ function scheduleRender(force = false, telemetryFrame = false){
474
+ // Settings changes and modal actions must not paint intermediate meter values.
475
+ // Keep immediate button feedback separate from the shared dashboard frame.
476
+ if (!telemetryFrame && document.getElementById('energyWebSvg')) {
477
+ try { window.__evcsApply?.(key => state[key]?.value, state); }
478
+ catch (error) { console.warn('EVCS controls', error); }
479
+ scheduleLiveTelemetryRender(false);
480
+ return;
481
+ }
474
482
  if (_renderScheduled && !force) return;
475
483
  _renderScheduled = true;
476
484
 
@@ -487,54 +495,57 @@ function scheduleRender(force = false){
487
495
  _renderScheduled = false;
488
496
  if (document.visibilityState !== 'visible' || _liveTelemetryPaused) return;
489
497
  _lastRenderTs = performance.now();
490
- try{ render(); }catch(_e){}
498
+ window.__nwLiveFrameNow = Date.now();
499
+ try { render(); } catch (_e) {}
500
+ finally { delete window.__nwLiveFrameNow; }
491
501
  }, wait);
492
502
  }
493
503
 
494
- // Kundenanzeige: Messwerte des Energieflussmonitors werden bewusst nur alle 5 Sekunden
504
+ // Kundenanzeige: Messwerte des Energieflussmonitors werden bewusst nur alle 10 Sekunden
495
505
  // neu gerendert. Die Backend-Messung und sämtliche EMS-Regelkreise bleiben unverändert
496
506
  // schnell; gedrosselt wird ausschließlich die sichtbare LIVE-Darstellung, damit kurze
497
507
  // NVP-/Speicher-Messversätze nicht als hektisches Springen erscheinen.
498
- const LIVE_TELEMETRY_RENDER_INTERVAL_MS = 5000;
508
+ const LIVE_TELEMETRY_RENDER_INTERVAL_MS = 10000;
509
+ const OTHER_PAGE_TELEMETRY_INTERVAL_MS = 5000;
499
510
  let _liveTelemetryRenderTimer = null;
500
511
  let _lastLiveTelemetryRenderTs = null;
501
512
  let _liveTelemetryPaused = false;
502
513
 
503
514
  /**
504
515
  * Code-Teil: scheduleLiveTelemetryRender
505
- * Zweck: Bündelt häufige SSE-Messwertupdates auf einen festen 5-Sekunden-Anzeigetakt.
516
+ * Zweck: Bündelt häufige SSE-Messwertupdates auf einen festen 10-Sekunden-Anzeigetakt.
506
517
  * Zusammenhang: Verändert keine Statewerte und keine Regelung; nur render() im LIVE-Frontend
507
- * wird verzögert. Initialdaten, Konfigurationsänderungen und bewusste UI-Aktionen dürfen
508
- * weiterhin sofort gerendert werden.
518
+ * wird verzögert. Erstansicht und Verbindungswechsel werden unmittelbar sichtbar.
509
519
  */
510
520
  function scheduleLiveTelemetryRender(force = false){
511
521
  // Eine monotone Zeitbasis verhindert Verzögerungen bei NTP-/Uhrzeitkorrekturen.
512
522
  // Eingehende SSE-Werte werden auch verborgen gepuffert, nur die Anzeige pausiert.
513
523
  if (_liveTelemetryPaused || document.visibilityState !== 'visible') return;
514
524
  const now = performance.now();
525
+ const interval = document.getElementById('energyWebSvg') ? LIVE_TELEMETRY_RENDER_INTERVAL_MS : OTHER_PAGE_TELEMETRY_INTERVAL_MS;
515
526
  const elapsed = _lastLiveTelemetryRenderTs === null ? Infinity : now - _lastLiveTelemetryRenderTs;
516
527
 
517
- if (force || elapsed >= LIVE_TELEMETRY_RENDER_INTERVAL_MS) {
528
+ if (force || elapsed >= interval) {
518
529
  if (_liveTelemetryRenderTimer !== null) {
519
530
  clearTimeout(_liveTelemetryRenderTimer);
520
531
  _liveTelemetryRenderTimer = null;
521
532
  }
522
533
  _lastLiveTelemetryRenderTs = now;
523
- scheduleRender(true);
534
+ scheduleRender(true, true);
524
535
  return;
525
536
  }
526
537
 
527
538
  if (_liveTelemetryRenderTimer !== null) return;
528
- const wait = Math.max(0, LIVE_TELEMETRY_RENDER_INTERVAL_MS - elapsed);
539
+ const wait = Math.max(0, interval - elapsed);
529
540
  _liveTelemetryRenderTimer = setTimeout(() => {
530
541
  _liveTelemetryRenderTimer = null;
531
542
  if (_liveTelemetryPaused || document.visibilityState !== 'visible') return;
532
543
  _lastLiveTelemetryRenderTs = performance.now();
533
- scheduleRender(true);
544
+ scheduleRender(true, true);
534
545
  }, wait);
535
546
  }
536
547
 
537
- // Auch ohne neue SSE-Werte alle 5 s den aktuellen Snapshot neu bewerten. Dadurch
548
+ // Auch ohne neue SSE-Werte alle 10 s den aktuellen Snapshot neu bewerten. Dadurch
538
549
  // altern echte Messzeitstempel sichtbar; das Rendering erzeugt keine neue Messung.
539
550
  function refreshLiveMeasurementAge() {
540
551
  if (document.visibilityState === 'visible' && document.getElementById('energyWebSvg')) scheduleLiveTelemetryRender(false);
@@ -557,7 +568,7 @@ function resumeLiveTelemetryRendering() {
557
568
  scheduleLiveTelemetryRender(true);
558
569
  }
559
570
  // Nach Tab-Rückkehr / BFcache sofort den neuesten gepufferten Stand zeigen,
560
- // danach einen einzigen 5-s-Takt. Kein Hintergrundrender und keine Timer-Duplikate.
571
+ // danach einen einzigen 10-s-Takt. Kein Hintergrundrender und keine Timer-Duplikate.
561
572
  document.addEventListener('visibilitychange', () => {
562
573
  if (document.visibilityState === 'visible') resumeLiveTelemetryRendering();
563
574
  else pauseLiveTelemetryRendering();
@@ -1862,28 +1873,13 @@ function nwFormatDashboardTimestamp(ts) {
1862
1873
  */
1863
1874
  function nwLatestStateTimestamp(keys) {
1864
1875
  const st = window.latestState || state || {};
1865
- let best = 0;
1866
- /**
1867
- * Code-Teil: scanKey
1868
- * Zweck: Kapselt einen lokalen Verarbeitungsschritt, damit Aufrufer nicht direkt in Detaildaten eingreifen.
1869
- * Zusammenhang: Teil von Kunden-LIVE-Frontend: Dashboard, Energiefluss, Schnellsteuerung; Aufrufstellen und abhängige States/APIs beim Ändern mitprüfen.
1870
- * TypeScript: Parameter, Rückgabewert und verwendete Config-/State-Objekte später explizit typisieren.
1871
- */
1872
- const scanKey = (k) => {
1873
- const rec = st && st[k];
1874
- const ts = rec && Number(rec.ts);
1875
- if (Number.isFinite(ts) && ts > best) best = ts;
1876
- };
1877
- if (Array.isArray(keys)) keys.forEach(scanKey);
1878
- if (!best) {
1879
- try {
1880
- Object.keys(st || {}).forEach((k) => {
1881
- const ts = Number(st[k] && st[k].ts);
1882
- if (Number.isFinite(ts) && ts > best) best = ts;
1883
- });
1884
- } catch (_e) {}
1876
+ const now = window.__nwLiveFrameNow ?? Date.now(), age = getFlowFreshMaxAgeMs(), online = window.__nwTariffLiveOnline !== false;
1877
+ let best = null;
1878
+ for (const key of keys) {
1879
+ if (window.NexoWattLiveDisplay.read(st, key, now, age, online) === null) continue;
1880
+ best = Math.max(best ?? 0, Number(st[key].ts));
1885
1881
  }
1886
- return best || Date.now();
1882
+ return best;
1887
1883
  }
1888
1884
  /**
1889
1885
  * Code-Teil: nwSetLiveOnline
@@ -1902,7 +1898,7 @@ function nwSetLiveOnline(isOnline) {
1902
1898
  if (dot) dot.classList.toggle('is-offline', !online);
1903
1899
  if (!online) {
1904
1900
  for (const id of ['pvPower', 'gridBuyPower', 'gridSellPower', 'storagePower', 'consumptionTotal', 'sidePvPower', 'sideBuildingPower', 'sideBatteryPower', 'sideGridBuyPower', 'sideGridSellPower', 'pvVal', 'gridVal', 'restVal', 'centerPower']) setText(id, '--');
1905
- setText('batterySocIn', '-- %'); setText('sideStorage', '-- %'); setText('sideBatterySoc', '-- %');
1901
+ setText('batteryFlowDirection', ''); setText('batterySocIn', '-- %'); setText('sideStorage', '-- %'); setText('sideBatterySoc', '-- %');
1906
1902
  setText('sideEms', 'Verbindung unterbrochen'); setText('sideGridStatus', 'Messstatus unbekannt');
1907
1903
  }
1908
1904
  }
@@ -1928,20 +1924,19 @@ function updateDashboardShellUi(data) {
1928
1924
  const liveDot = document.getElementById('liveDot');
1929
1925
  nwSetLiveOnline(!liveDot || liveDot.classList.contains('live'));
1930
1926
 
1931
- const { pv, buy, sell, load, charge, discharge } = getLiveMeasurementView();
1927
+ const { pv, buy, sell, load, charge, discharge, soc } = getLiveMeasurementView();
1932
1928
  const batterySigned = charge === null || discharge === null ? null : discharge - charge;
1933
1929
  const evcsAvailable = nwEvcsFeatureFromConfig();
1934
1930
  const evcsPower = evcsAvailable ? getEvcsPowerW(d) : null;
1935
1931
  try { nwApplyCustomerFeatureVisibility(window.__nwCfg || {}, window.latestState || state || {}); } catch (_e) {}
1936
1932
 
1937
- const soc = getLiveMeasurementView().soc;
1938
1933
  const autarky = (snap.autarkyN !== undefined && snap.autarkyN !== null) ? Number(snap.autarkyN) : getFreshFlowNumber('autarky');
1939
1934
  const selfc = (snap.selfcN !== undefined && snap.selfcN !== null) ? Number(snap.selfcN) : getFreshFlowNumber('selfConsumption');
1940
1935
 
1941
1936
  setText('sideStorage', Number.isFinite(soc) ? `${Math.round(soc)} %` : '-- %');
1942
1937
  setText('sideBatterySoc', Number.isFinite(soc) ? `${Math.round(soc)} %` : '-- %');
1943
1938
  const p14 = !!d('ems.core.para14aActive') || !!d('para14a.active'), peak = String(d('peakShaving.control.status') || '').trim(), safety = String(d('chargingManagement.audit.safetyStage') || '').trim(), p14Fallback = d('para14a.communicationFallbackActive') === true;
1944
- const health = window.NexoWattLiveDisplay?.status(window.latestState || state || {}, window.__nwTariffLiveOnline !== false, Date.now());
1939
+ const health = window.NexoWattLiveDisplay?.status(window.latestState || state || {}, window.__nwTariffLiveOnline !== false, window.__nwLiveFrameNow ?? Date.now(), getFlowFreshMaxAgeMs());
1945
1940
  setText('sideEms', safety === 'EOS-SAFETY-STOP' ? 'Safety aktiv' : health?.ems || 'Status unbekannt');
1946
1941
  setText('sideGridStatus', p14Fallback ? '§14a Fallback' : (p14 ? '§14a aktiv' : (peak === 'active' ? 'Peak aktiv' : health?.grid || 'Messstatus unbekannt')));
1947
1942
  setText('sideStatusText', health?.summary || 'Betriebsstatus unbekannt');
@@ -1960,8 +1955,9 @@ function updateDashboardShellUi(data) {
1960
1955
  if (evcsAvailable) setText('sideEvcsPower', evcsPower === null ? '--' : formatFlowPower(Math.abs(evcsPower)));
1961
1956
 
1962
1957
  const ts = nwLatestStateTimestamp([
1963
- 'pvPower', 'productionTotal', 'consumptionTotal', 'gridPower', 'gridBuyPower',
1964
- 'gridSellPower', 'storageSoc', 'storagePower', 'consumptionEvcs'
1958
+ 'derived.core.pv.totalW', 'derived.core.grid.netW', 'derived.core.storage.netW', 'derived.core.building.loadTotalW',
1959
+ 'pvPower', 'productionTotal', 'consumptionTotal', 'gridPointPower', 'gridBuyPower', 'gridSellPower',
1960
+ 'batteryPower', 'storageChargePower', 'storageDischargePower', 'storageSoc', 'consumptionEvcs', 'evcs.totalPowerW'
1965
1961
  ]);
1966
1962
  setText('sideTimestamp', nwFormatDashboardTimestamp(ts));
1967
1963
  }
@@ -2957,8 +2953,9 @@ function getStateAgeMs(key) {
2957
2953
  try {
2958
2954
  const rec = state && state[key];
2959
2955
  const ts = Number(rec && rec.ts);
2960
- if (!Number.isFinite(ts) || ts <= 0 || ts > Date.now() + 5000) return null;
2961
- return Math.max(0, Date.now() - ts);
2956
+ const now = window.__nwLiveFrameNow ?? Date.now();
2957
+ if (!Number.isFinite(ts) || ts <= 0 || ts > now + 5000) return null;
2958
+ return Math.max(0, now - ts);
2962
2959
  } catch (_e) {
2963
2960
  return null;
2964
2961
  }
@@ -2987,7 +2984,7 @@ function getFlowFreshMaxAgeMs() {
2987
2984
  */
2988
2985
  function getFreshFlowNumber(key, opts = {}) {
2989
2986
  if (opts.onlyIfMapped && !isMappedDatapoint(key)) return null;
2990
- return window.NexoWattLiveDisplay?.read(state, key, Date.now(), getFlowFreshMaxAgeMs(), window.__nwTariffLiveOnline !== false) ?? null;
2987
+ return window.NexoWattLiveDisplay?.read(state, key, window.__nwLiveFrameNow ?? Date.now(), getFlowFreshMaxAgeMs(), window.__nwTariffLiveOnline !== false) ?? null;
2991
2988
  }
2992
2989
  /**
2993
2990
  * Code-Teil: getStableFlowNumber
@@ -3044,29 +3041,45 @@ function getBalanceDerivedBatteryFlow(opts = {}) {
3044
3041
  const hasDirectLoad = isMappedDatapoint('consumptionTotal') || isMappedDatapoint('housePower');
3045
3042
  if (!hasDirectLoad) return null;
3046
3043
 
3047
- const load = coerceNumber(read('consumptionTotal') ?? read('housePower'));
3048
- if (load === null) return null;
3044
+ const load = (isMappedDatapoint('consumptionTotal') ? read('consumptionTotal') : null)
3045
+ ?? (isMappedDatapoint('housePower') ? read('housePower') : null);
3046
+ if (load === null || load < 0) return null;
3049
3047
 
3050
- const grid = getGridImportExport(read);
3051
- if (!grid || grid.rawBuy === null || grid.rawSell === null) return null;
3052
3048
  const nvp = st['ems.gridMeasurementFresh'];
3053
- if (nvp && (nvp.value !== true || getStateAgeMs('ems.gridMeasurementFresh') === null || getStateAgeMs('ems.gridMeasurementFresh') > getFlowFreshMaxAgeMs())) return null;
3054
-
3055
- let pv = coerceNumber(read('pvPower'));
3056
- if (pv === null && isMappedDatapoint('productionTotal')) pv = coerceNumber(read('productionTotal'));
3049
+ if (nvp && (nvp.value !== true || (nvp.q !== undefined && nvp.q !== 0) || getStateAgeMs('ems.gridMeasurementFresh') === null || getStateAgeMs('ems.gridMeasurementFresh') > getFlowFreshMaxAgeMs())) return null;
3050
+ let net;
3051
+ if (Object.hasOwn(st, 'derived.core.grid.netW')) {
3052
+ net = read('derived.core.grid.netW');
3053
+ if (net === null) return null;
3054
+ } else {
3055
+ const grid = getGridImportExport(read);
3056
+ if (!grid || grid.rawBuy === null || grid.rawSell === null) return null;
3057
+ net = grid.buy - grid.sell;
3058
+ if (st['settings.flowInvertGrid']?.value) net = -net;
3059
+ }
3060
+ const pv = Object.hasOwn(st, 'derived.core.pv.totalW') ? read('derived.core.pv.totalW')
3061
+ : read('pvPower') ?? (isMappedDatapoint('productionTotal') ? read('productionTotal') : null);
3057
3062
  if (pv === null) return null;
3058
3063
 
3059
- let production = Math.max(0, Math.abs(Number(pv) || 0));
3060
- for (let i = 1; i <= 5; i++) {
3061
- const p = coerceNumber(read(`producer${i}Power`));
3062
- if (p !== null) production += Math.max(0, Math.abs(p));
3064
+ let production = Math.abs(pv);
3065
+ if (Object.hasOwn(st, 'derived.core.production.extraW')) {
3066
+ const extra = read('derived.core.production.extraW');
3067
+ if (extra === null) return null;
3068
+ production += extra;
3069
+ } else {
3070
+ for (let i = 1; i <= 5; i++) {
3071
+ const key = `producer${i}Power`;
3072
+ const power = read(key);
3073
+ if (power === null && isMappedDatapoint(key)) return null;
3074
+ if (power !== null) production += Math.abs(power);
3075
+ }
3063
3076
  }
3064
3077
 
3065
- const signed = Math.round((Math.max(0, load) - production - Math.max(0, grid.buy || 0) + Math.max(0, grid.sell || 0)));
3078
+ const signed = Math.round(load - production - net);
3066
3079
  if (!Number.isFinite(signed) || Math.abs(signed) <= deadbandW) return null;
3067
3080
 
3068
3081
  // Plausibilitätsbremsen gegen kurze Messversätze oder unbekannte Verbraucher.
3069
- const activity = production + Math.max(0, load) + Math.max(0, grid.buy || 0) + Math.max(0, grid.sell || 0);
3082
+ const activity = production + load + Math.abs(net);
3070
3083
  if (activity < 500) return null;
3071
3084
  if (Math.abs(signed) > Math.max(3000, activity * 1.15)) return null;
3072
3085
  if (signed < 0 && soc >= 99.5) return null;
@@ -3254,25 +3267,75 @@ function getCanonicalPvPowerW(readValue) {
3254
3267
  * Keine Regelung, keine Ersatzmessung und keine Änderung der Kundenzuordnung. */
3255
3268
  function getLiveMeasurementView() {
3256
3269
  const fresh = key => getFreshFlowNumber(key);
3257
- const grid = getGridImportExport(fresh);
3258
- const nvp = state?.['ems.gridMeasurementFresh'];
3259
- const nvpUsable = !nvp || (nvp.value === true && getStateAgeMs('ems.gridMeasurementFresh') !== null && getStateAgeMs('ems.gridMeasurementFresh') <= getFlowFreshMaxAgeMs());
3260
- const gridAvailable = nvpUsable && grid.rawBuy !== null && grid.rawSell !== null;
3261
- const battery = getNormalizedBatteryFlow();
3262
- const batteryAvailable = !['missing', 'mapped-missing', 'storageFarm-missing-power', 'storageFarm-unavailable', 'stale-or-missing'].includes(String(battery.src)) && battery.incomplete !== true;
3270
+ let buy = null, sell = null;
3271
+ if (state && Object.hasOwn(state, 'derived.core.grid.netW')) {
3272
+ // Der Netzpunkt stammt aus demselben Messsatz wie der berechnete Verbrauch.
3273
+ const net = fresh('derived.core.grid.netW');
3274
+ if (net !== null) {
3275
+ buy = Math.max(0, net);
3276
+ sell = Math.max(0, -net);
3277
+ }
3278
+ } else {
3279
+ const nvp = state?.['ems.gridMeasurementFresh'];
3280
+ const nvpAge = nvp ? getStateAgeMs('ems.gridMeasurementFresh') : null;
3281
+ const nvpUsable = !nvp || (nvp.value === true && (nvp.q === undefined || nvp.q === 0) && nvpAge !== null && nvpAge <= getFlowFreshMaxAgeMs());
3282
+ if (nvpUsable) {
3283
+ const grid = getGridImportExport(fresh);
3284
+ if (grid.rawBuy !== null && grid.rawSell !== null) {
3285
+ const inverted = !!((window.latestState || state)?.['settings.flowInvertGrid']?.value);
3286
+ [buy, sell] = inverted ? [grid.sell, grid.buy] : [grid.buy, grid.sell];
3287
+ }
3288
+ }
3289
+ }
3290
+ const hasStorageObservation = state && Object.hasOwn(state, 'derived.core.storage.netW');
3263
3291
  const farm = nwStorageFarmFeatureFromConfig(window.__nwCfg || {}, state || {});
3264
- const farmView = farm ? window.NexoWattLiveDisplay?.farm(state, Date.now(), window.__nwTariffLiveOnline !== false) : null;
3265
- const directLoad = fresh('consumptionTotal');
3266
- const derivedLoad = fresh('derived.core.building.loadTotalW');
3267
- const load = directLoad !== null && directLoad >= 0 ? directLoad : derivedLoad !== null && derivedLoad >= 0 ? derivedLoad : null;
3292
+ const farmView = farm ? window.NexoWattLiveDisplay?.farm(state, window.__nwLiveFrameNow ?? Date.now(), window.__nwTariffLiveOnline !== false) : null;
3293
+ let charge = null, discharge = null, batteryDerived = false;
3294
+ if (farmView) {
3295
+ ({ charge, discharge } = farmView);
3296
+ } else if (hasStorageObservation) {
3297
+ const net = fresh('derived.core.storage.netW');
3298
+ if (net !== null) {
3299
+ charge = Math.max(0, -net);
3300
+ discharge = Math.max(0, net);
3301
+ } else if (!farm && !isMappedDatapoint('batteryPower') && !isMappedDatapoint('storageChargePower') && !isMappedDatapoint('storageDischargePower')) {
3302
+ const estimate = getBalanceDerivedBatteryFlow();
3303
+ if (estimate) {
3304
+ ({ chargeW: charge, dischargeW: discharge } = estimate);
3305
+ batteryDerived = true;
3306
+ }
3307
+ }
3308
+ } else {
3309
+ const battery = getNormalizedBatteryFlow();
3310
+ const missing = ['missing', 'mapped-missing', 'storageFarm-missing-power', 'storageFarm-unavailable', 'stale-or-missing'];
3311
+ if (!missing.includes(String(battery.src)) && battery.incomplete !== true) {
3312
+ ({ chargeW: charge, dischargeW: discharge } = battery);
3313
+ batteryDerived = battery.derived === true;
3314
+ }
3315
+ }
3316
+ // A direct meter can arrive one SSE batch before the backend publishes the new balance.
3317
+ // Unmapped consumptionTotal may be a mirror of the previous balance; never revive it here.
3318
+ const directKey = isMappedDatapoint('consumptionTotal') ? 'consumptionTotal'
3319
+ : isMappedDatapoint('housePower') ? 'housePower' : null;
3320
+ const directLoad = directKey ? fresh(directKey) : null;
3321
+ const canonicalKey = 'derived.core.building.loadTotalW';
3322
+ const canonical = state?.[canonicalKey];
3323
+ let load = canonical ? fresh(canonicalKey) : fresh('consumptionTotal');
3324
+ const directRow = directKey ? state?.[directKey] : null;
3325
+ const evaluatedAt = Math.max(canonical?.ts || 0, state?.['derived.core.building.loadSource']?.ts || 0, state?.['derived.core.building.quality']?.ts || 0);
3326
+ if (directLoad !== null && directLoad >= 0 && (!canonical || directRow.ts > evaluatedAt || directRow === window.__nwPendingDirectSample)) {
3327
+ load = directLoad;
3328
+ } else if (directKey && state?.[directKey] && state?.['derived.core.building.loadSource']?.value === 'mapped:' + directKey
3329
+ && (directRow === window.__nwPendingDirectSample || directRow.ts >= (canonical?.ts ?? 0))) {
3330
+ // An invalidating sample for the same physical meter takes precedence immediately.
3331
+ load = null;
3332
+ }
3333
+ const pv = getCanonicalPvPowerW(fresh);
3268
3334
  const soc = farmView ? farmView.soc : farm ? fresh('storageFarm.totalSoc') ?? fresh('storageFarm.medianSoc') : fresh('storageSoc');
3269
3335
  return {
3270
- pv: getCanonicalPvPowerW(fresh), load,
3271
- buy: gridAvailable ? grid.buy : null, sell: gridAvailable ? grid.sell : null,
3272
- charge: farmView ? farmView.charge : batteryAvailable ? battery.chargeW : null,
3273
- discharge: farmView ? farmView.discharge : batteryAvailable ? battery.dischargeW : null,
3336
+ pv: pv !== null && pv >= 0 ? pv : null, load: load !== null && load >= 0 ? load : null, buy, sell,
3337
+ charge, discharge, batteryDerived,
3274
3338
  soc: soc !== null && soc >= 0 && soc <= 100 ? soc : null,
3275
- batteryDerived: !farmView && battery.derived === true,
3276
3339
  };
3277
3340
  }
3278
3341
 
@@ -3568,6 +3631,7 @@ async function chargingControlFetch(url, options = {}) {
3568
3631
  }
3569
3632
 
3570
3633
  async function bootstrap() {
3634
+ window.__nwFlowConnection = 'connecting';
3571
3635
  let cfg = {};
3572
3636
  try {
3573
3637
  const cfgRes = await fetch('/config');
@@ -3750,8 +3814,19 @@ const refreshConfig = async () => {
3750
3814
  }
3751
3815
  }
3752
3816
  };
3753
- const snap = await fetch('/api/state').then(r => r.json());
3754
- state = snap || {};
3817
+ try {
3818
+ const response = await fetch('/api/state', { cache: 'no-store' });
3819
+ if (!response.ok) throw new Error('HTTP ' + response.status);
3820
+ const snap = await response.json();
3821
+ if (!snap || typeof snap !== 'object' || Array.isArray(snap)) throw new Error('invalid snapshot');
3822
+ state = snap;
3823
+ window.__nwFlowConnection = 'snapshot';
3824
+ document.getElementById('liveDot')?.classList.add('live');
3825
+ nwSetLiveOnline(true);
3826
+ } catch (error) {
3827
+ // The EventSource below still obtains a complete snapshot after an HTTP bootstrap error.
3828
+ console.warn('[live-state]', error);
3829
+ }
3755
3830
  try { lastInstallerConfigJson = (state && state['installer.configJson'] && state['installer.configJson'].value) || null; } catch (_e) {}
3756
3831
  // merge cfg.settings into state if missing (for initial checkbox values)
3757
3832
  try{
@@ -3791,16 +3866,47 @@ const refreshConfig = async () => {
3791
3866
  try{
3792
3867
  const es = new EventSource((window.NW_RUNTIME?.url('/events') ?? '/events'));
3793
3868
  const dot = document.getElementById('liveDot');
3794
- if (dot) dot.classList.remove('live');
3795
- es.onopen = () => { if (dot) dot.classList.add('live'); try{ nwSetLiveOnline(true); }catch(_e){} };
3796
- es.onerror = () => { if (dot) dot.classList.remove('live'); try{ nwSetLiveOnline(false); }catch(_e){} try{ es.close(); }catch(_){ } setTimeout(startEvents, 3000); };
3869
+ let initialized = false;
3870
+ let closed = false;
3871
+ const reconnect = () => {
3872
+ if (closed) return;
3873
+ closed = true;
3874
+ window.__nwFlowConnection = 'disconnected';
3875
+ dot?.classList.remove('live');
3876
+ nwSetLiveOnline(false);
3877
+ es.close();
3878
+ scheduleLiveTelemetryRender(true);
3879
+ setTimeout(startEvents, 3000);
3880
+ };
3881
+ es.onerror = reconnect;
3797
3882
  es.onmessage = (ev) => {
3798
3883
  try {
3799
3884
  const msg = JSON.parse(ev.data);
3800
- const isInitMessage = msg.type === 'init' && msg.payload;
3801
- const isUpdateMessage = msg.type === 'update' && msg.payload;
3802
- if (isInitMessage) { state = msg.payload; window.latestState = state; }
3803
- else if (isUpdateMessage) { Object.assign(state, msg.payload); window.latestState = state; }
3885
+ if (closed || !msg || !msg.payload || typeof msg.payload !== 'object' || Array.isArray(msg.payload)) return;
3886
+ const isInitMessage = msg.type === 'init';
3887
+ const isUpdateMessage = msg.type === 'update';
3888
+ if (isInitMessage) {
3889
+ if (msg.degraded === true) { reconnect(); return; }
3890
+ state = msg.payload;
3891
+ window.latestState = state;
3892
+ initialized = true;
3893
+ window.__nwPendingDirectSample = null;
3894
+ window.__nwFlowConnection = 'ready';
3895
+ dot?.classList.add('live');
3896
+ nwSetLiveOnline(true);
3897
+ } else if (isUpdateMessage && initialized) {
3898
+ const hasBalance = Object.hasOwn(msg.payload, 'derived.core.building.loadTotalW');
3899
+ if (hasBalance) window.__nwPendingDirectSample = null;
3900
+ if (msg.payload.consumptionTotal || msg.payload.housePower) {
3901
+ const key = isMappedDatapoint('consumptionTotal') ? 'consumptionTotal'
3902
+ : isMappedDatapoint('housePower') ? 'housePower' : null;
3903
+ const sample = key ? msg.payload[key] : null;
3904
+ if (sample && sample.ts > 0 && state[key]?.ts > sample.ts) delete msg.payload[key];
3905
+ else if (sample && !hasBalance) window.__nwPendingDirectSample = sample;
3906
+ }
3907
+ Object.assign(state, msg.payload);
3908
+ window.latestState = state;
3909
+ } else return;
3804
3910
 
3805
3911
  // App-Center config changed? Refresh /config so tiles + slot layout update without reload.
3806
3912
  try {
@@ -3815,7 +3921,14 @@ const refreshConfig = async () => {
3815
3921
  else if (isUpdateMessage) scheduleLiveTelemetryRender(false);
3816
3922
  } catch (e) { console.warn(e); }
3817
3923
  };
3818
- } catch(e){ console.warn('events', e); setTimeout(startEvents, 3000); }
3924
+ } catch (e) {
3925
+ console.warn('events', e);
3926
+ window.__nwFlowConnection = 'disconnected';
3927
+ document.getElementById('liveDot')?.classList.remove('live');
3928
+ nwSetLiveOnline(false);
3929
+ scheduleLiveTelemetryRender(true);
3930
+ setTimeout(startEvents, 3000);
3931
+ }
3819
3932
  }
3820
3933
  startEvents();
3821
3934
 
@@ -8654,16 +8767,15 @@ function updateEnergyWeb() {
8654
8767
 
8655
8768
  const measurements = getLiveMeasurementView();
8656
8769
  let pv = measurements.pv ?? 0;
8657
- let buy = measurements.buy ?? 0, sell = measurements.sell ?? 0;
8770
+ const buy = measurements.buy ?? 0, sell = measurements.sell ?? 0;
8658
8771
  const load = measurements.load ?? 0;
8659
8772
  const evcsPowerW = getEvcsPowerW(d);
8660
8773
  let c2 = evcsPowerW ?? 0; // Nur Geometrie, niemals Ersatzmessung.
8661
8774
  const batCharge = measurements.charge ?? 0, batDischarge = measurements.discharge ?? 0;
8662
8775
  const soc = measurements.soc;
8663
8776
 
8664
- // Invert toggles (Batterie ist bereits im Normalizer enthalten)
8777
+ // Netz und Speicher wurden bereits bei der Messwertauswahl normalisiert.
8665
8778
  const invPv = !!(s['settings.flowInvertPv']?.value);
8666
- const invGrid = !!(s['settings.flowInvertGrid']?.value);
8667
8779
  const invEv = !!(s['settings.flowInvertEv']?.value);
8668
8780
  const subEvFromLoad = (s['settings.flowSubtractEvFromBuilding']?.value ?? true) ? true : false;
8669
8781
  const evAvail = nwEvcsFeatureFromConfig() && ((flowExtras && flowExtras.meta) ? !!flowExtras.meta.evcsAvailable : false);
@@ -8671,7 +8783,6 @@ function updateEnergyWeb() {
8671
8783
  if (invPv) pv = -pv;
8672
8784
  if (invEv) c2 = -c2;
8673
8785
  if (!evAvail) c2 = 0;
8674
- if (invGrid) { const t=buy; buy = sell; sell = t; } // swap semantics if inverted grid
8675
8786
 
8676
8787
  // Optionale Extra-Kreise aktualisieren (Rückgabe = Summe der optionalen Verbraucher)
8677
8788
  const extrasConsumersSum = updateEnergyWebExtras(key => getFreshFlowNumber(key));
@@ -8680,6 +8791,10 @@ function updateEnergyWeb() {
8680
8791
  // keine echte Null. Die vorhandene EV-/Verbraucher-Betragskonvention bleibt erhalten.
8681
8792
  const flowBalance = window.NexoWattPowerMeasurements?.resolveFlowBalance({
8682
8793
  load: measurements.load, ev: evcsPowerW === null ? null : c2,
8794
+ buildingQuality: measurements.load === null
8795
+ ? (window.__nwFlowConnection === 'connecting' ? 'awaiting-snapshot'
8796
+ : window.NexoWattLiveDisplay?.buildingQuality?.(state, window.__nwLiveFrameNow ?? Date.now(), getFlowFreshMaxAgeMs(), window.__nwTariffLiveOnline !== false, isMappedDatapoint))
8797
+ : null,
8683
8798
  consumers: extrasConsumersSum, pv: measurements.pv,
8684
8799
  producers: state && Object.hasOwn(state, 'derived.core.production.extraW') ? getFreshFlowNumber('derived.core.production.extraW')
8685
8800
  : window.__nwFlowExtraProductionW ?? (flowExtras?.producers?.length || flowExtras?.special?.length ? null : 0),
@@ -8737,6 +8852,11 @@ function updateEnergyWeb() {
8737
8852
  // EV & Batterie Texte
8738
8853
  T('c2Val', evcsPowerW === null ? '--' : formatFlowPower(evShowVal));
8739
8854
  T('restVal', measurements.charge === null || measurements.discharge === null ? '--' : batShowVal ? (batRev ? ('-'+formatFlowPower(batShowVal)) : formatFlowPower(batShowVal)) : formatFlowPower(0));
8855
+ const hasBatteryDirection = measurements.charge !== null && measurements.discharge !== null;
8856
+ const grossBoth = batCharge > 0 && batDischarge > 0;
8857
+ const direction = !hasBatteryDirection || !batShowVal ? (grossBoth ? 'Netto 0' : '')
8858
+ : batRev ? (grossBoth ? 'Netto laden' : 'Laden') : (grossBoth ? 'Netto entladen' : 'Entladen');
8859
+ T('batteryFlowDirection', direction);
8740
8860
  T('centerPower', loadDisplay === null ? '--' : formatFlowPower(loadDisplay));
8741
8861
  const balanceStatus = flowBalance.mismatchW === null ? (flowBalance.status || (measurements.batteryDerived ? 'Batterieleistung aus Energiebilanz berechnet' : ''))
8742
8862
  : `Bilanzabweichung ${formatFlowPower(Math.abs(flowBalance.mismatchW))} – Messpunkte, Vorzeichen und Zeitstempel prüfen`;
@@ -26,7 +26,7 @@
26
26
  <link rel="manifest" href="/manifest.webmanifest">
27
27
  <link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/nexowatt-32.png">
28
28
  <link rel="icon" type="image/png" sizes="192x192" href="/assets/icons/nexowatt-192.png">
29
- <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/assets/icons/nexowatt-180.png?v=083e11ab28ec">
29
+ <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/apple-touch-icon-eos-v2.png">
30
30
 
31
31
  <meta content="width=device-width, initial-scale=1" name="viewport"/>
32
32
  <title>NexoWatt EOS – App-Center (Installer)</title>
@@ -7,7 +7,7 @@
7
7
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
8
8
  *
9
9
  * Quelle: src-ts/runtime-executables/www/ems-apps.ts
10
- * Quell-Hash: sha256:e9b2e1babf672181807086e69928c205e546ed8b47ba65fdbe64dc9193bb89e9
10
+ * Quell-Hash: sha256:088e92dabd6b0645c4860afd01899a0112e36951a07f1da3cb16c58c4fabdcb1
11
11
  * Erzeugung: npm run sync:ts-runtime-executables
12
12
  *
13
13
  * Zweck:
@@ -1733,7 +1733,8 @@ function _collectFlowPowerDpIsWFromUI() {
1733
1733
  }
1734
1734
  function appCenterDraftSnapshot() {
1735
1735
  try {
1736
- const inputs = Array.from(document.querySelectorAll('main input, main select, main textarea'))
1736
+ // The language display is updated asynchronously from the system locale and cannot be edited.
1737
+ const inputs = Array.from(document.querySelectorAll('main input:not(#countryProfileLanguageDisplay), main select, main textarea'))
1737
1738
  .map(input => [input.id, input.name, input.type, input.value, input.checked,
1738
1739
  input.multiple && input.selectedOptions ? Array.from(input.selectedOptions).map(option => option.value) : null]);
1739
1740
  return JSON.stringify([currentConfig, inputs]);
@@ -11,7 +11,7 @@
11
11
  <link rel="manifest" href="/manifest.webmanifest">
12
12
  <link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/nexowatt-32.png">
13
13
  <link rel="icon" type="image/png" sizes="192x192" href="/assets/icons/nexowatt-192.png">
14
- <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/assets/icons/nexowatt-180.png?v=083e11ab28ec">
14
+ <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/apple-touch-icon-eos-v2.png">
15
15
  <!-- Gemeinsamer direkter/Proxy-Bootstrap: Sitzung und CSRF vor der Bedienlogik. -->
16
16
  <script src="/static/runtime-base.js"></script>
17
17
  <script src="/static/auth.js"></script>
package/ui/www/evcs.html CHANGED
@@ -26,7 +26,7 @@
26
26
  <link rel="manifest" href="/manifest.webmanifest">
27
27
  <link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/nexowatt-32.png">
28
28
  <link rel="icon" type="image/png" sizes="192x192" href="/assets/icons/nexowatt-192.png">
29
- <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/assets/icons/nexowatt-180.png?v=083e11ab28ec">
29
+ <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/apple-touch-icon-eos-v2.png">
30
30
  <!-- Gemeinsamer direkter/Proxy-Bootstrap: Sitzung und CSRF vor der Bedienlogik. -->
31
31
  <script src="/static/runtime-base.js"></script>
32
32
  <script src="/static/auth.js"></script>
@@ -26,7 +26,7 @@
26
26
  <link rel="manifest" href="/manifest.webmanifest">
27
27
  <link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/nexowatt-32.png">
28
28
  <link rel="icon" type="image/png" sizes="192x192" href="/assets/icons/nexowatt-192.png">
29
- <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/assets/icons/nexowatt-180.png?v=083e11ab28ec">
29
+ <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/apple-touch-icon-eos-v2.png">
30
30
  <!-- Gemeinsamer direkter/Proxy-Bootstrap: Sitzung und CSRF vor der Bedienlogik. -->
31
31
  <script src="/static/runtime-base.js"></script>
32
32
  <script src="/static/auth.js"></script>
package/ui/www/index.html CHANGED
@@ -28,7 +28,7 @@
28
28
  <link rel="manifest" href="/manifest.webmanifest">
29
29
  <link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/nexowatt-32.png">
30
30
  <link rel="icon" type="image/png" sizes="192x192" href="/assets/icons/nexowatt-192.png">
31
- <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/assets/icons/nexowatt-180.png?v=083e11ab28ec">
31
+ <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/apple-touch-icon-eos-v2.png">
32
32
  <!-- Gemeinsamer direkter/Proxy-Bootstrap: Sitzung und CSRF vor der Bedienlogik. -->
33
33
  <script src="/static/runtime-base.js"></script>
34
34
  <script src="/static/auth.js"></script>
@@ -241,6 +241,7 @@
241
241
  <text class="minor" id="batterySocIn" text-anchor="middle" y="-14">-- %</text>
242
242
  <text class="minor" id="batteryTime" text-anchor="middle" x="300" y="480"></text>
243
243
  <text class="val" id="restVal" text-anchor="middle" y="58">--</text>
244
+ <text class="minor" id="batteryFlowDirection" text-anchor="middle" y="74"></text>
244
245
  <text class="lbl" text-anchor="middle" y="28">Batterie</text>
245
246
  </g>
246
247
  <!-- center node -->