iobroker.eos-admin 9.0.35 → 9.0.38

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 (253) hide show
  1. package/NEXOWATT_EOS_BUILD_INFO.json +10 -13
  2. package/README.md +21 -3
  3. package/adminWww/.vite/manifest.json +114 -114
  4. package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +13759 -13759
  5. package/adminWww/assets/{AdapterUpdateDialog-DH6S-kWX.js → AdapterUpdateDialog-D4gUYZep.js} +1 -1
  6. package/adminWww/assets/{Adapters-CIlqSF5B.js → Adapters-DLxiJc3y.js} +1 -1
  7. package/adminWww/assets/{ConfigManager-BhVBfM-q.js → ConfigManager-D_YTKUdP.js} +1 -1
  8. package/adminWww/assets/{Enums-3H97czGs.js → Enums-D79rON6b.js} +1 -1
  9. package/adminWww/assets/{Fields-vWLKiuvO.js → Fields-CTOv49EU.js} +1 -1
  10. package/adminWww/assets/{Files-wmjjMXYM.js → Files-DNLzjEG5.js} +1 -1
  11. package/adminWww/assets/{Hosts-Bk-xmI98.js → Hosts-DHNboUMq.js} +1 -1
  12. package/adminWww/assets/{Instances-Db6Vgh62.js → Instances-BJxYNJAC.js} +1 -1
  13. package/adminWww/assets/{Intro-Dc3wAG9V.js → Intro-8R-Q7CR_.js} +1 -1
  14. package/adminWww/assets/{Logs-CPbEGWNq.js → Logs-CjAPhWuK.js} +1 -1
  15. package/adminWww/assets/{Objects-DJB-2468.js → Objects-cvdqooGe.js} +1 -1
  16. package/adminWww/assets/{Overview-DdvghCLQ.js → Overview-JPfBOuKv.js} +1 -1
  17. package/adminWww/assets/{State-0UzpgKYj.js → State-CGnvMceJ.js} +1 -1
  18. package/adminWww/assets/{UsedResources-Bcmo58YD.js → UsedResources-FBd9jThR.js} +1 -1
  19. package/adminWww/assets/{Users-BGHf3Rox.js → Users-BbUu3hZj.js} +1 -1
  20. package/adminWww/assets/{bootstrap-qkrk_CAn.js → bootstrap-Df_WTIJg.js} +3 -3
  21. package/adminWww/assets/{hostInit-DlGqatlv.js → hostInit-BQCRqFay.js} +1 -1
  22. package/adminWww/assets/{icons-material-CUNq6tdT.js → icons-material-DS82xOs8.js} +1 -1
  23. package/adminWww/assets/{index-BrtKq3UN.js → index-BlBZd8r8.js} +2 -2
  24. package/adminWww/assets/{installSVGRenderer-DujLjpXt.js → installSVGRenderer-BtlXF9y3.js} +1 -1
  25. package/adminWww/assets/{mf-entry-bootstrap-0-3e1cd85c.js → mf-entry-bootstrap-0-8bb11ea2.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.38.js +12 -0
  30. package/adminWww/remoteEntry.js +1 -1
  31. package/build/lib/eosDashboardProcessStatus.js +11 -3
  32. package/build/lib/eosDashboardProcessStatus.js.map +1 -1
  33. package/build/lib/eosLegacyMigration.js +476 -92
  34. package/build/lib/eosLegacyMigration.js.map +1 -1
  35. package/build/lib/eosLegacySource.js +172 -0
  36. package/build/lib/eosLegacySource.js.map +1 -0
  37. package/build/lib/eosLicenseService.js +9 -0
  38. package/build/lib/eosLicenseService.js.map +1 -1
  39. package/build/lib/eosModuleConfigStore.js +21 -8
  40. package/build/lib/eosModuleConfigStore.js.map +1 -1
  41. package/build/lib/eosModuleHost.js +308 -104
  42. package/build/lib/eosModuleHost.js.map +1 -1
  43. package/build/lib/eosModuleHttp.js +77 -12
  44. package/build/lib/eosModuleHttp.js.map +1 -1
  45. package/build/lib/eosModuleProcess.js +17 -6
  46. package/build/lib/eosModuleProcess.js.map +1 -1
  47. package/build/lib/eosModuleProcessWorker.js +34 -1
  48. package/build/lib/eosModuleProcessWorker.js.map +1 -1
  49. package/build/lib/eosRuntimeControl.js +50 -14
  50. package/build/lib/eosRuntimeControl.js.map +1 -1
  51. package/build/lib/eosRuntimeHealth.js +35 -7
  52. package/build/lib/eosRuntimeHealth.js.map +1 -1
  53. package/build/lib/eosSupervisorNotifications.js +1 -1
  54. package/build/lib/eosSupervisorNotifications.js.map +1 -1
  55. package/build/lib/eosUiProcess.js +42 -4
  56. package/build/lib/eosUiProcess.js.map +1 -1
  57. package/build/lib/eosUiProcessWorker.js +21 -0
  58. package/build/lib/eosUiProcessWorker.js.map +1 -1
  59. package/build/lib/eosUnifiedOwnership.js +10 -8
  60. package/build/lib/eosUnifiedOwnership.js.map +1 -1
  61. package/build/lib/web.js +28 -24
  62. package/build/lib/web.js.map +1 -1
  63. package/build/main.js +36 -1
  64. package/build/main.js.map +1 -1
  65. package/docs/README.md +3 -0
  66. package/docs/reports/unified-9.0.36/MIGRATION.md +25 -0
  67. package/docs/reports/unified-9.0.36/PRUEFBERICHT.md +61 -0
  68. package/docs/reports/unified-9.0.36/PRUEFERGEBNISSE.json +112 -0
  69. package/docs/reports/unified-9.0.36/raw/INDEX.json +262 -0
  70. package/docs/reports/unified-9.0.36/raw/admin-934-legacy-ui-reproduction.json +66 -0
  71. package/docs/reports/unified-9.0.36/raw/admin-936-legacy-ui-reproduction.json +64 -0
  72. package/docs/reports/unified-9.0.36/raw/admin-health-browser22.json +49 -0
  73. package/docs/reports/unified-9.0.36/raw/admin-health-browser24.json +49 -0
  74. package/docs/reports/unified-9.0.36/raw/admin-runtime-migration-browser22.json +80 -0
  75. package/docs/reports/unified-9.0.36/raw/admin-runtime-migration-browser24.json +80 -0
  76. package/docs/reports/unified-9.0.36/raw/backend.log +6 -0
  77. package/docs/reports/unified-9.0.36/raw/core-final-node22.log +1439 -0
  78. package/docs/reports/unified-9.0.36/raw/core-final-node24.log +1381 -0
  79. package/docs/reports/unified-9.0.36/raw/customer-934-node22-final.log +78 -0
  80. package/docs/reports/unified-9.0.36/raw/customer-934-node22-repeat.log +78 -0
  81. package/docs/reports/unified-9.0.36/raw/customer-935-node24-final.log +74 -0
  82. package/docs/reports/unified-9.0.36/raw/customer-935-node24-repeat.log +74 -0
  83. package/docs/reports/unified-9.0.36/raw/customer-admin-six-controls24.log +24 -0
  84. package/docs/reports/unified-9.0.36/raw/customer-earlier-pid-stop.log +22 -0
  85. package/docs/reports/unified-9.0.36/raw/customer-six-process-restart-node22.log +28 -0
  86. package/docs/reports/unified-9.0.36/raw/customer-six-process-restart-node24.log +24 -0
  87. package/docs/reports/unified-9.0.36/raw/dashboard-de-en-nl.json +728 -0
  88. package/docs/reports/unified-9.0.36/raw/fixtures-verification.log +44 -0
  89. package/docs/reports/unified-9.0.36/raw/frontend.log +152 -0
  90. package/docs/reports/unified-9.0.36/raw/installer.log +26 -0
  91. package/docs/reports/unified-9.0.36/raw/legacy-migration-node22.log +630 -0
  92. package/docs/reports/unified-9.0.36/raw/legacy-migration-node24.log +109 -0
  93. package/docs/reports/unified-9.0.36/raw/lint.log +45 -0
  94. package/docs/reports/unified-9.0.36/raw/module-standby-drain22.log +446 -0
  95. package/docs/reports/unified-9.0.36/raw/module-standby-drain24.log +80 -0
  96. package/docs/reports/unified-9.0.36/raw/module-standby-linux-memory.log +6 -0
  97. package/docs/reports/unified-9.0.36/raw/modules.log +5 -0
  98. package/docs/reports/unified-9.0.36/raw/node22-migration.log +1329 -0
  99. package/docs/reports/unified-9.0.36/raw/node22-mira.log +222 -0
  100. package/docs/reports/unified-9.0.36/raw/node22-system-status.log +225 -0
  101. package/docs/reports/unified-9.0.36/raw/node22-tests-final.log +18358 -0
  102. package/docs/reports/unified-9.0.36/raw/node22-version.log +1 -0
  103. package/docs/reports/unified-9.0.36/raw/node24-migration.log +1301 -0
  104. package/docs/reports/unified-9.0.36/raw/node24-mira.log +41 -0
  105. package/docs/reports/unified-9.0.36/raw/node24-system-status.log +42 -0
  106. package/docs/reports/unified-9.0.36/raw/node24-tests-final.log +3058 -0
  107. package/docs/reports/unified-9.0.36/raw/node24-version.log +1 -0
  108. package/docs/reports/unified-9.0.36/raw/npm-runtime-audit.json +77 -0
  109. package/docs/reports/unified-9.0.36/raw/ocpp-owner-isolation22.log +109 -0
  110. package/docs/reports/unified-9.0.36/raw/ocpp-owner-isolation24.log +24 -0
  111. package/docs/reports/unified-9.0.36/raw/qa-source-check.log +2 -0
  112. package/docs/reports/unified-9.0.36/raw/release-metadata.log +13 -0
  113. package/docs/reports/unified-9.0.36/raw/sbom.log +9 -0
  114. package/docs/reports/unified-9.0.36/raw/standby-independent-drain.log +4 -0
  115. package/docs/reports/unified-9.0.36/raw/standby-independent-sockets.log +3 -0
  116. package/docs/reports/unified-9.0.36/raw/typecheck.log +5 -0
  117. package/docs/reports/unified-9.0.36/raw/ui-runtime.log +8 -0
  118. package/docs/reports/unified-9.0.37/PRUEFBERICHT.md +59 -0
  119. package/docs/reports/unified-9.0.37/PRUEFERGEBNISSE.json +112 -0
  120. package/docs/reports/unified-9.0.37/raw/INDEX.json +232 -0
  121. package/docs/reports/unified-9.0.37/raw/backend.log +5 -0
  122. package/docs/reports/unified-9.0.37/raw/core-final-node22.log +1439 -0
  123. package/docs/reports/unified-9.0.37/raw/core-final-node24.log +1381 -0
  124. package/docs/reports/unified-9.0.37/raw/dashboard-935-screenshot.json +15 -0
  125. package/docs/reports/unified-9.0.37/raw/dashboard-de-en-nl.json +1059 -0
  126. package/docs/reports/unified-9.0.37/raw/ems-ui-nvp-integration.json +245 -0
  127. package/docs/reports/unified-9.0.37/raw/farm-and-dashboard-935.json +11 -0
  128. package/docs/reports/unified-9.0.37/raw/farm-tracking-source-tests.log +80 -0
  129. package/docs/reports/unified-9.0.37/raw/fixtures-verification.log +39 -0
  130. package/docs/reports/unified-9.0.37/raw/frontend.log +160 -0
  131. package/docs/reports/unified-9.0.37/raw/installer.log +26 -0
  132. package/docs/reports/unified-9.0.37/raw/lint.log +45 -0
  133. package/docs/reports/unified-9.0.37/raw/measure-storage-display.cjs +47 -0
  134. package/docs/reports/unified-9.0.37/raw/modules.log +5 -0
  135. package/docs/reports/unified-9.0.37/raw/node22-isolated-start-deadlines.log +28 -0
  136. package/docs/reports/unified-9.0.37/raw/node22-migration.log +1329 -0
  137. package/docs/reports/unified-9.0.37/raw/node22-mira.log +222 -0
  138. package/docs/reports/unified-9.0.37/raw/node22-parallel-initial.log +13278 -0
  139. package/docs/reports/unified-9.0.37/raw/node22-startzeiten.json +21 -0
  140. package/docs/reports/unified-9.0.37/raw/node22-system-status.log +639 -0
  141. package/docs/reports/unified-9.0.37/raw/node22-tests-final.log +18494 -0
  142. package/docs/reports/unified-9.0.37/raw/node22-version.log +1 -0
  143. package/docs/reports/unified-9.0.37/raw/node24-migration.log +1301 -0
  144. package/docs/reports/unified-9.0.37/raw/node24-mira.log +41 -0
  145. package/docs/reports/unified-9.0.37/raw/node24-system-status.log +111 -0
  146. package/docs/reports/unified-9.0.37/raw/node24-tests-final.log +3080 -0
  147. package/docs/reports/unified-9.0.37/raw/node24-version.log +1 -0
  148. package/docs/reports/unified-9.0.37/raw/npm-runtime-audit.json +77 -0
  149. package/docs/reports/unified-9.0.37/raw/platform-acl-node22.log +98 -0
  150. package/docs/reports/unified-9.0.37/raw/platform-acl-node24.log +22 -0
  151. package/docs/reports/unified-9.0.37/raw/platform-nginx-node22.json +21 -0
  152. package/docs/reports/unified-9.0.37/raw/platform-nginx-node24.json +21 -0
  153. package/docs/reports/unified-9.0.37/raw/qa-source-check.log +2 -0
  154. package/docs/reports/unified-9.0.37/raw/release-metadata.log +13 -0
  155. package/docs/reports/unified-9.0.37/raw/sbom.log +8 -0
  156. package/docs/reports/unified-9.0.37/raw/speicher-warnschwelle-integration.json +172 -0
  157. package/docs/reports/unified-9.0.37/raw/sse-backpressure-9.0.35.log +1 -0
  158. package/docs/reports/unified-9.0.37/raw/sse-backpressure-9.0.37.log +1 -0
  159. package/docs/reports/unified-9.0.37/raw/storage-display-memory-node22.json +19 -0
  160. package/docs/reports/unified-9.0.37/raw/storage-display-memory-node24.json +19 -0
  161. package/docs/reports/unified-9.0.37/raw/typecheck.log +5 -0
  162. package/docs/reports/unified-9.0.37/raw/ui-runtime.log +7 -0
  163. package/docs/reports/unified-9.0.38/PRUEFBERICHT.md +51 -0
  164. package/docs/reports/unified-9.0.38/PRUEFERGEBNISSE.json +112 -0
  165. package/docs/reports/unified-9.0.38/raw/INDEX.json +272 -0
  166. package/docs/reports/unified-9.0.38/raw/backend.log +5 -0
  167. package/docs/reports/unified-9.0.38/raw/core-final-node22.log +1439 -0
  168. package/docs/reports/unified-9.0.38/raw/core-final-node24.log +1381 -0
  169. package/docs/reports/unified-9.0.38/raw/dashboard-de-en-nl.json +1044 -0
  170. package/docs/reports/unified-9.0.38/raw/field-upgrade-936-node22.log +21 -0
  171. package/docs/reports/unified-9.0.38/raw/field-upgrade-936-node24.log +10 -0
  172. package/docs/reports/unified-9.0.38/raw/fixtures-verification.log +39 -0
  173. package/docs/reports/unified-9.0.38/raw/frontend.log +152 -0
  174. package/docs/reports/unified-9.0.38/raw/installer.log +26 -0
  175. package/docs/reports/unified-9.0.38/raw/legacy-historian-provenance.json +44 -0
  176. package/docs/reports/unified-9.0.38/raw/legacy-history-built-influx.log +10 -0
  177. package/docs/reports/unified-9.0.38/raw/legacy-history-misbinding-937.log +1 -0
  178. package/docs/reports/unified-9.0.38/raw/legacy-history-providers-node22.log +326 -0
  179. package/docs/reports/unified-9.0.38/raw/legacy-history-providers-node24.log +58 -0
  180. package/docs/reports/unified-9.0.38/raw/legacy-history-real-influx.log +10 -0
  181. package/docs/reports/unified-9.0.38/raw/legacy-history-source-comparison.json +12 -0
  182. package/docs/reports/unified-9.0.38/raw/legacy-template-interfaces.json +21 -0
  183. package/docs/reports/unified-9.0.38/raw/lint.log +45 -0
  184. package/docs/reports/unified-9.0.38/raw/migration-admin-browser-node22.log +86 -0
  185. package/docs/reports/unified-9.0.38/raw/migration-admin-browser-node24.log +84 -0
  186. package/docs/reports/unified-9.0.38/raw/migration-live-children-node22.log +20 -0
  187. package/docs/reports/unified-9.0.38/raw/migration-live-children-node24.log +9 -0
  188. package/docs/reports/unified-9.0.38/raw/migration-process-admin-node22.log +831 -0
  189. package/docs/reports/unified-9.0.38/raw/migration-process-admin-node24.log +144 -0
  190. package/docs/reports/unified-9.0.38/raw/modules.log +5 -0
  191. package/docs/reports/unified-9.0.38/raw/node22-initial-destination-channel.log +13298 -0
  192. package/docs/reports/unified-9.0.38/raw/node22-migration.log +1443 -0
  193. package/docs/reports/unified-9.0.38/raw/node22-mira.log +222 -0
  194. package/docs/reports/unified-9.0.38/raw/node22-system-status.log +639 -0
  195. package/docs/reports/unified-9.0.38/raw/node22-tests-final.log +18620 -0
  196. package/docs/reports/unified-9.0.38/raw/node22-version.log +1 -0
  197. package/docs/reports/unified-9.0.38/raw/node24-migration.log +1411 -0
  198. package/docs/reports/unified-9.0.38/raw/node24-mira.log +41 -0
  199. package/docs/reports/unified-9.0.38/raw/node24-system-status.log +111 -0
  200. package/docs/reports/unified-9.0.38/raw/node24-tests-final.log +3102 -0
  201. package/docs/reports/unified-9.0.38/raw/node24-version.log +1 -0
  202. package/docs/reports/unified-9.0.38/raw/npm-runtime-audit.json +77 -0
  203. package/docs/reports/unified-9.0.38/raw/platform-acl-node22.log +98 -0
  204. package/docs/reports/unified-9.0.38/raw/platform-acl-node24.log +22 -0
  205. package/docs/reports/unified-9.0.38/raw/platform-nginx-node22.json +21 -0
  206. package/docs/reports/unified-9.0.38/raw/platform-nginx-node24.json +21 -0
  207. package/docs/reports/unified-9.0.38/raw/qa-source-check.log +2 -0
  208. package/docs/reports/unified-9.0.38/raw/release-metadata.log +13 -0
  209. package/docs/reports/unified-9.0.38/raw/sbom.log +8 -0
  210. package/docs/reports/unified-9.0.38/raw/source-shape-node22.log +438 -0
  211. package/docs/reports/unified-9.0.38/raw/source-shape-node24.log +78 -0
  212. package/docs/reports/unified-9.0.38/raw/target-owner-bootstrap-node22.log +509 -0
  213. package/docs/reports/unified-9.0.38/raw/target-owner-bootstrap-node24.log +92 -0
  214. package/docs/reports/unified-9.0.38/raw/typecheck.log +5 -0
  215. package/docs/reports/unified-9.0.38/raw/ui-runtime.log +7 -0
  216. package/docs/start/START_HIER_9.0.36.md +32 -0
  217. package/docs/start/START_HIER_9.0.37.md +38 -0
  218. package/docs/start/START_HIER_9.0.38.md +21 -0
  219. package/docs/unified/ARCHITECTURE.md +6 -0
  220. package/docs/unified/BESTANDSUEBERNAHME_9_0_7.md +2 -0
  221. package/docs/unified/DEVELOPMENT_FINDINGS.md +3 -1
  222. package/docs/unified/SECURITY_CRA.md +6 -0
  223. package/io-package.json +16 -16
  224. package/package.json +10 -4
  225. package/public/eos-migration/index.html +11 -4
  226. package/public/eos-migration/index.js +176 -22
  227. package/public/eos-runtime/index.js +82 -15
  228. package/release-manifests/unified/build-environment.cdx.json +6 -6
  229. package/release-manifests/unified/files.json +343 -174
  230. package/release-manifests/unified/frontend.cdx.json +6 -6
  231. package/release-manifests/unified/installer.cdx.json +6 -6
  232. package/release-manifests/unified/obsolete-admin-assets.json +249 -0
  233. package/release-manifests/unified/runtime.cdx.json +26 -26
  234. package/release-manifests/unified/validation.json +15 -15
  235. package/tools/eos-release-manifest.cjs +1 -1
  236. package/ui/ems/modules/para14a.js +8 -3
  237. package/ui/ems/modules/storage-control.js +10 -5
  238. package/ui/io-package.json +13 -1
  239. package/ui/lib/hosted-startup-status.js +2 -2
  240. package/ui/lib/notification-mail.js +95 -8
  241. package/ui/main.js +339 -21
  242. package/ui/package.json +1 -1
  243. package/ui/www/app.js +48 -18
  244. package/ui/www/dashboard-process-status.js +7 -4
  245. package/ui/www/i18n/en.json +16 -0
  246. package/ui/www/i18n/nl.json +16 -0
  247. package/ui/www/licenses/smarthome-markdown-components.json +156 -156
  248. package/ui/www/live-display.js +154 -31
  249. package/ui/www/manifest.webmanifest +2 -2
  250. package/ui/www/storagefarm-dispatch.js +59 -8
  251. package/ui/www/storagefarm-summary.css +3 -1
  252. package/ui/www/storagefarm.html +2 -0
  253. package/adminWww/remoteEntry-eos-9.0.35.js +0 -12
package/ui/main.js CHANGED
@@ -7,7 +7,7 @@
7
7
  * AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
8
8
  *
9
9
  * Quelle: src-ts/runtime-executables/main.ts
10
- * Quell-Hash: sha256:2316c9c2553f364bf54c35a456deb0345dc306a146b2d649e6c341b77f0413b2
10
+ * Quell-Hash: sha256:7c9927317c3f19ba2a761e5ade005ba6d705e4d24ebd17fe079ca2030ab94395
11
11
  * Erzeugung: npm run sync:ts-runtime-executables
12
12
  *
13
13
  * Zweck:
@@ -57,6 +57,7 @@ const bodyParser = express.json({ limit: '5mb', inflate: false });
57
57
  const crypto = require('crypto');
58
58
  const { installerRevision, assertInstallerRevision, provisionInstallerObjects, assertDeviceAppActivations, numericMeasurement, activeDeviceProfileReferences, awaitEmsTransition } = require('./lib/installer-lifecycle');
59
59
  const { buildFarmOverview } = require('./lib/storage-farm-overview');
60
+ const { compareFarmPower } = require('./www/live-display');
60
61
  const { readFlowMeasurement, sumFlowMeasurements } = require('./lib/flow-measurement');
61
62
  const nwDefaultFlowMappings = require('./io-package.json').native.datapoints;
62
63
  const { tariffDisplayConfig, tariffPriceNumber } = require('./lib/tariff-price');
@@ -242,6 +243,15 @@ class NexoWattVis extends HostedAdapter {
242
243
  });
243
244
 
244
245
  this.stateCache = {};
246
+ // Read-only projection of the three EMS health reports. Keep producer evidence
247
+ // separate from normalized cache rows used by flow calculations and controls.
248
+ this._nwDashboardHealth = {
249
+ 'ems.core.schedulerAlive': undefined,
250
+ 'ems.core.schedulerHeartbeatAt': undefined,
251
+ 'ems.gridMeasurementFresh': undefined,
252
+ };
253
+ this._nwDashboardHealthSent = Object.create(null);
254
+ this._nwFarmDisplay = Object.create(null);
245
255
  // Public values may be normalized for UI/module safety (e.g. charge/discharge magnitudes).
246
256
  // Keep the original signed input values as well so signed battery fallbacks can be split correctly.
247
257
  this._nwRawValueCache = {};
@@ -278,7 +288,7 @@ class NexoWattVis extends HostedAdapter {
278
288
  const snapshot = client?.internal
279
289
  ? adapter.stateCache
280
290
  : publicBuilder(adapter.stateCache, true);
281
- const chunk = `data: ${JSON.stringify({ type: 'init', payload: snapshot })}\n\n`;
291
+ const chunk = `data: ${JSON.stringify({ type: 'init', payload: Object.assign(client?.internal ? { ...snapshot, ...adapter._nwFarmDisplay } : snapshot, adapter._nwDashboardHealth) })}\n\n`;
282
292
  cacheRoot[cacheKey] = { createdAt: now, chunk };
283
293
  adapter._nwSseSnapshotBuilds = Number(adapter._nwSseSnapshotBuilds || 0) + 1;
284
294
  return chunk;
@@ -6716,6 +6726,7 @@ class NexoWattVis extends HostedAdapter {
6716
6726
  const getUnit = async (id) => {
6717
6727
  const sid = String(id || '').trim();
6718
6728
  if (!sid) return '';
6729
+ if (this._sfTrackingLayout?.units.has(sid)) return this._sfTrackingLayout.units.get(sid);
6719
6730
  if (_unitCache.has(sid)) return _unitCache.get(sid) || '';
6720
6731
 
6721
6732
  let unit = '';
@@ -6851,6 +6862,29 @@ class NexoWattVis extends HostedAdapter {
6851
6862
  const statusRows = [];
6852
6863
  const overviewMembers = [];
6853
6864
  const overviewPvSources = [];
6865
+ // A shared actuator or meter cannot identify a single battery. Count owners
6866
+ // before inspecting live values so even the first duplicate is excluded.
6867
+ const trackingOwners = new Map();
6868
+ const trackingForbiddenMeters = new Set();
6869
+ const trackingRoutes = await this._sfTrackingRoutes(list, cfg);
6870
+ assertCurrent();
6871
+ for (const member of list.filter(entry => entry.enabled !== false)) {
6872
+ const actuators = [member.setSignedPowerId, member.setChargePowerId, member.setDischargePowerId, member.feneconGridSetpointId]
6873
+ .filter(Boolean).map(id => trackingRoutes.write.get(id));
6874
+ const meters = [member.batteryFlowPowerId, member.signedPowerId, member.feneconEssActualPowerId,
6875
+ member.chargePowerId, member.dischargePowerId].filter(Boolean).map(id => trackingRoutes.read.get(id));
6876
+ const foreignRoles = [member.pvPowerId, member.feneconPvDcId, member.feneconPvAcId, member.feneconPvTotalId,
6877
+ member.feneconNvpPowerId, member.feneconConsumptionTotalId, member.feneconActualSetpointId, member.socId];
6878
+ for (const id of [...actuators, ...foreignRoles.map(id => trackingRoutes.read.get(id))]) {
6879
+ if (id) trackingForbiddenMeters.add(id);
6880
+ }
6881
+ const hardware = member._eosDevice?.baseId;
6882
+ for (const id of new Set([...actuators, ...meters, ...(hardware ? [`device:${hardware}`] : [])].filter(Boolean))) {
6883
+ trackingOwners.set(id, (trackingOwners.get(id) || 0) + 1);
6884
+ }
6885
+ }
6886
+ const trackingMaxAgeMs = Math.min(staleMs, 30000);
6887
+ const trackingBindings = [];
6854
6888
  const farmWritableStorageCount = list.filter((row) => this._nwStorageFarmRowHasWritableDatapoint(row)).length;
6855
6889
 
6856
6890
  const maxLicensedStorages = this._nwLicenseMaxStorages();
@@ -6877,6 +6911,7 @@ class NexoWattVis extends HostedAdapter {
6877
6911
  dischargePowerId: String(row.dischargePowerId || '').trim(),
6878
6912
  socId: String(row.socId || '').trim(),
6879
6913
  soc: null,
6914
+ powerComparison: null,
6880
6915
  chargePowerW: null,
6881
6916
  dischargePowerW: null,
6882
6917
  signedPowerW: null,
@@ -7515,10 +7550,44 @@ class NexoWattVis extends HostedAdapter {
7515
7550
  status.batteryFlowPowerW = physicalPower;
7516
7551
  overviewMember.batteryPowerW = physicalPower;
7517
7552
  if (duplicateBatteryFlow) status.batteryFlowDuplicate = true;
7553
+
7518
7554
  } else {
7519
7555
  status.batteryFlowMissing = true;
7520
7556
  }
7521
7557
  }
7558
+ // A direct Home ESS command addresses the AC converter (706 → 604).
7559
+ // Its battery-only channel 415 can differ substantially whenever DC PV runs.
7560
+ const essAc = feneconHybridRow && feneconMode.mode === 'direct-ess'
7561
+ && this._sfHasHomeEssComparison(row, trackingRoutes) && signedFeedbackUsable;
7562
+ const domain = essAc ? 'ess-ac' : 'battery';
7563
+ const signedMeasurement = !!(essAc || batteryFlowId || signedFeedbackUsable);
7564
+ const observedIds = essAc ? [signedId] : batteryFlowId ? [batteryFlowId] : signedFeedbackUsable ? [signedId] : [chgId, dchgId];
7565
+ const observedKeys = observedIds.map(id => trackingRoutes.read.get(id));
7566
+ const targetKeys = targetPowerIds.map(id => trackingRoutes.write.get(id));
7567
+ const deviceKey = row._eosDevice?.baseId;
7568
+ const unique = [...targetKeys, ...observedKeys, ...(deviceKey ? [`device:${deviceKey}`] : [])]
7569
+ .every(key => !!key && trackingOwners.get(key) === 1);
7570
+ if (!status.licenseBlocked && status.dispatchAvailable && directTargetAvailable && (!feneconHybridRow || essAc)
7571
+ && !['fems-grid', 'invalid'].includes(feneconMode.mode) && unique
7572
+ && (signedMeasurement || (chargeFeedbackUsable && dischargeFeedbackUsable && observedKeys[0] !== observedKeys[1]))
7573
+ && observedKeys.every(key => !trackingForbiddenMeters.has(key) && key !== trackingRoutes.read.get(pvId))) {
7574
+ const samples = observedIds.map(id => _stCache.get(id));
7575
+ const valid = samples.every(st => st?.ack === true && (st.q === undefined || st.q === 0)
7576
+ && Number.isFinite(st.ts) && st.ts > 0 && st.ts <= now && now - st.ts <= trackingMaxAgeMs
7577
+ && (typeof st.val === 'number' && Number.isFinite(st.val) || typeof st.val === 'string'
7578
+ && /^[-+]?\d+(?:[.,]\d+)?(?:e[-+]?\d+)?\s*(?:[kmg]?w|(?:kilo|mega|giga)?watts?)?$/i.test(st.val.trim())));
7579
+ // Already read for this snapshot. Reject a direction/sign conflict
7580
+ // rather than inheriting display-only clamping of an invalid split.
7581
+ const charge = !signedMeasurement && valid ? parseNum(samples[0].val) * (invChg ? -1 : 1) : 0;
7582
+ const discharge = !signedMeasurement && valid ? parseNum(samples[1].val) * (invDchg ? -1 : 1) : 0;
7583
+ const measured = essAc ? await readNumber(signedId, 'power', { allowStale: false, display: true })
7584
+ : status.batteryFlowPowerW;
7585
+ if (valid && Number.isFinite(measured) && charge >= 0 && discharge >= 0 && !(charge > 0 && discharge > 0)) {
7586
+ const observedAt = Math.min(...samples.map(st => st.ts));
7587
+ status.trackingMeasurement = { signedW: measured, observedAt, domain };
7588
+ trackingBindings.push({ status, binding: this._sfPowerComparisonBinding(row), domain });
7589
+ }
7590
+ }
7522
7591
  statusRows.push(status);
7523
7592
  available++;
7524
7593
  }
@@ -7569,6 +7638,17 @@ class NexoWattVis extends HostedAdapter {
7569
7638
  const capacityWeightedSocOnlineState = Math.round(capacityWeightedSocOnline * 10) / 10;
7570
7639
  const totalPowerState = Math.round(totalPower);
7571
7640
  const farmOverview = buildFarmOverview(overviewMembers, overviewPvSources, now);
7641
+ // Join only the currently accepted command phase. All lookups are synchronous
7642
+ // and local; no new timers, physical reads or actuator writes are introduced.
7643
+ if (!runtimeInfo.dispatchActive || dynamicGridHasControl(this)) this._sfInvalidatePowerTracking();
7644
+ for (const { status, binding, domain } of trackingBindings) {
7645
+ const command = this._sfPowerTracking?.get(status.dispatchKey);
7646
+ if (!command || command.binding !== binding || command.config !== cfg) continue;
7647
+ const sample = status.trackingMeasurement;
7648
+ const validUntil = Math.min(command.acceptedAt, sample.observedAt) + trackingMaxAgeMs;
7649
+ status.powerComparison = compareFarmPower(command.signedW, sample.signedW, command.acceptedSince,
7650
+ sample.observedAt, validUntil, Date.now(), domain === 'ess-ac' ? domain : undefined);
7651
+ }
7572
7652
  const farmOverviewJson = JSON.stringify(farmOverview);
7573
7653
  const totalBatteryPowerState = farmOverview.battery.netW;
7574
7654
  const totalChargeState = Math.round(totalCharge);
@@ -8061,7 +8141,116 @@ class NexoWattVis extends HostedAdapter {
8061
8141
  return { ok: false, skipped: false, changed: false, error: msg };
8062
8142
  }
8063
8143
  }
8144
+ _sfInvalidatePowerTracking() {
8145
+ this._sfPowerTracking?.clear();
8146
+ if (this._sfTrackingWriters) this._sfTrackingOverlap = true;
8147
+ }
8148
+
8149
+ async _sfTrackingRoutes(rows, config) {
8150
+ // Resolve the configured metadata graph once per layout. State observations
8151
+ // always come from the aggregation's existing per-tick cache.
8152
+ const inputs = new Set(), outputs = new Set();
8153
+ for (const row of rows) {
8154
+ if (!row.enabled) continue;
8155
+ for (const id of [row.setSignedPowerId, row.setChargePowerId, row.setDischargePowerId, row.feneconGridSetpointId]) if (id) outputs.add(id);
8156
+ for (const id of [row.batteryFlowPowerId, row.signedPowerId, row.feneconEssActualPowerId, row.chargePowerId,
8157
+ row.dischargePowerId, row.socId, row.pvPowerId, row.feneconPvDcId, row.feneconPvAcId,
8158
+ row.feneconPvTotalId, row.feneconNvpPowerId, row.feneconConsumptionTotalId, row.feneconActualSetpointId]) if (id) inputs.add(id);
8159
+ }
8160
+ const signature = JSON.stringify([[...inputs], [...outputs]]);
8161
+ const previous = this._sfTrackingLayout;
8162
+ if (previous?.signature === signature && previous.config === config && Date.now() < previous.retryAt) return previous;
8163
+ const layout = previous?.signature === signature && previous.config === config
8164
+ ? { ...previous, retryAt: Infinity }
8165
+ : { config, signature, retryAt: Infinity, read: new Map(), write: new Map(), units: new Map(), homeIds: new Set() };
8166
+ const objects = new Map();
8167
+ const resolve = async (start, write) => {
8168
+ let id = start;
8169
+ const visited = new Set();
8170
+ while (id && !visited.has(id) && visited.size < 8) {
8171
+ visited.add(id);
8172
+ if (!objects.has(id)) objects.set(id, await this.getForeignObjectAsync(id).catch(() => null));
8173
+ const obj = objects.get(id);
8174
+ if (obj?.type !== 'state' || !obj.common) {
8175
+ layout.retryAt = Math.min(layout.retryAt, Date.now() + 30000);
8176
+ return null;
8177
+ }
8178
+ if (write ? obj.common.write === false : obj.common.read === false) return null;
8179
+ layout.units.set(id, String(obj.common.unit || '').trim());
8180
+ const native = obj.native || {};
8181
+ const alias = obj.common.alias;
8182
+ if (alias !== undefined && alias !== null) {
8183
+ const next = typeof alias.id === 'string' ? alias.id : alias.id?.[write ? 'write' : 'read'];
8184
+ if (typeof next !== 'string' || !next || alias[write ? 'write' : 'read']) return null;
8185
+ id = next;
8186
+ continue;
8187
+ }
8188
+ if (native.isAlias === true) {
8189
+ const base = id.split('.aliases.')[0];
8190
+ const dp = (write && native.writeDpId) || native.dpId;
8191
+ if (base === id || !native.deviceId || !base.endsWith(`.devices.${native.deviceId}`) || typeof dp !== 'string' || !dp) return null;
8192
+ id = `${base}.${dp}`;
8193
+ continue;
8194
+ }
8195
+ if (native.templateId === 'ess.fenecon.FeneconHomeEssImpl' && native.deviceId && native.datapointId
8196
+ && id.endsWith(`.devices.${native.deviceId}.${native.datapointId}`)) layout.homeIds.add(id);
8197
+ return id;
8198
+ }
8199
+ return null;
8200
+ };
8201
+ for (const id of inputs) if (!layout.read.get(id)) layout.read.set(id, await resolve(id, false));
8202
+ for (const id of outputs) if (!layout.write.get(id)) layout.write.set(id, await resolve(id, true));
8203
+ this._sfTrackingLayout = layout;
8204
+ return layout;
8205
+ }
8206
+
8207
+ _sfHasHomeEssComparison(s, layout) {
8208
+ if (!layout || s.setChargePowerId && s.setDischargePowerId) return false;
8209
+ const actualDp = s.feneconEssActualPowerId || s.signedPowerId;
8210
+ const targetDp = s.setSignedPowerId;
8211
+ const actual = layout.read.get(actualDp);
8212
+ const target = layout.write.get(targetDp);
8213
+ if (!target?.endsWith('.sET_ACTIVE_POWER') || !layout.homeIds.has(target) || !layout.homeIds.has(actual)) return false;
8214
+ const base = s._eosDevice?.baseId || target.slice(0, -'.sET_ACTIVE_POWER'.length);
8215
+ const matches = (id, leaf, alias) => [`${base}.${leaf}`, `${base}.aliases.${alias}`, `${base}.aliases.v1.${alias}`].includes(id);
8216
+ return target === `${base}.sET_ACTIVE_POWER` && actual === `${base}.eSS0_ACTIVE_POWER`
8217
+ && matches(targetDp, 'sET_ACTIVE_POWER', 'ctrl.powerSetpointW') && matches(actualDp, 'eSS0_ACTIVE_POWER', 'r.essActivePower')
8218
+ && layout.units.get(targetDp) === 'W' && ['W', 'kW'].includes(layout.units.get(actualDp));
8219
+
8220
+ }
8221
+
8222
+ _sfPowerComparisonBinding(s) {
8223
+ // A retained name/command value is insufficient after replacing a meter, a
8224
+ // port, a wiring convention or the physical member.
8225
+ return JSON.stringify([s._eosDevice?.baseId, s._eosDevice?.devId, s.socId, s.vendorProfile, s.coupling, s.feneconControlMode,
8226
+ s.setSignedPowerId, s.setChargePowerId, s.setDischargePowerId, s.feneconGridSetpointId,
8227
+ s.batteryFlowPowerId, s.signedPowerId, s.feneconEssActualPowerId, s.chargePowerId, s.dischargePowerId,
8228
+ s.invertSignedPowerSign, s.invertSetSignedPowerSign, s.invertChargeSign, s.invertDischargeSign]);
8229
+ }
8230
+
8064
8231
  async applyStorageFarmTargetW(targetW, meta = {}) {
8232
+ // Journal covers only the current dispatch and the current member list.
8233
+ // Overlap, early exits, handover and restart invalidate comparison evidence.
8234
+ const writesInFlight = this._sfTrackingWriters || 0;
8235
+ this._sfTrackingWriters = writesInFlight + 1;
8236
+ if (writesInFlight) {
8237
+ this._sfTrackingOverlap = true;
8238
+ this._sfPowerTracking?.clear();
8239
+ }
8240
+ const tracking = { next: new Map(), config: this.config };
8241
+ try {
8242
+ const result = await this._sfApplyStorageFarmTargetW(targetW, meta, tracking);
8243
+ if (!this._sfTrackingOverlap && this.config === tracking.config) this._sfPowerTracking = tracking.next;
8244
+ return result;
8245
+ } catch (error) {
8246
+ this._sfPowerTracking?.clear();
8247
+ throw error;
8248
+ } finally {
8249
+ if (!--this._sfTrackingWriters) this._sfTrackingOverlap = false;
8250
+ }
8251
+ }
8252
+
8253
+ async _sfApplyStorageFarmTargetW(targetW, meta, tracking) {
8065
8254
  if (dynamicGridHasControl(this)) return { applied: false, reason: 'dynamic-grid-owns-storage' };
8066
8255
  const w = Number.isFinite(Number(targetW)) ? Math.round(Number(targetW)) : 0;
8067
8256
  const sf = this._sfGetNormalizedFarmConfig();
@@ -8940,6 +9129,14 @@ class NexoWattVis extends HostedAdapter {
8940
9129
  writes: {},
8941
9130
  };
8942
9131
 
9132
+ const signedAllocatedW = direction === 'charge' ? -Math.abs(alloc) : (direction === 'discharge' ? Math.abs(alloc) : 0);
9133
+ const homeEssAc = nwIsFeneconHybrid(s) && commandFamily === 'signed' && this._sfHasHomeEssComparison(s, this._sfTrackingLayout);
9134
+ const trackingSignedW = homeEssAc ? outSignedW : signedAllocatedW;
9135
+ const binding = this._sfPowerComparisonBinding(s);
9136
+ const previous = this._sfPowerTracking?.get(r.dispatchKey);
9137
+ const continuity = previous && previous.config === tracking.config && previous.binding === binding && previous.source === src
9138
+ && previous.signedW === trackingSignedW && previous.acceptedAt <= now && now - previous.acceptedAt < 30000;
9139
+ if (!continuity) this._sfPowerTracking?.delete(r.dispatchKey);
8943
9140
  const selectedIds = new Set();
8944
9141
  if (commandFamily === 'signed' && signedId) selectedIds.add(signedId);
8945
9142
  if (commandFamily === 'split') {
@@ -9008,7 +9205,6 @@ class NexoWattVis extends HostedAdapter {
9008
9205
  && !r.writes.conflict
9009
9206
  && releaseAccepted
9010
9207
  && selectedAccepted;
9011
- const signedAllocatedW = direction === 'charge' ? -Math.abs(alloc) : (direction === 'discharge' ? Math.abs(alloc) : 0);
9012
9208
  r.commandRequired = commandRequired;
9013
9209
  r.commandAccepted = commandAccepted;
9014
9210
  r.releaseAccepted = releaseAccepted;
@@ -9017,6 +9213,22 @@ class NexoWattVis extends HostedAdapter {
9017
9213
  r.failedW = (commandRequired && commandAccepted !== true && direction !== 'idle') ? signedAllocatedW : 0;
9018
9214
  r.stopAccepted = direction === 'idle' && commandRequired ? commandAccepted === true : null;
9019
9215
 
9216
+ // A skipped equal command alone cannot prove a new phase or extend its
9217
+ // lifetime. Keep its first acceptance only while the whole path is valid.
9218
+ const submitted = selectedWrites.every(write => write.submitted === true);
9219
+ const freshlySent = submitted && selectedWrites.every(write => write.changed === true);
9220
+ if (commandAccepted && submitted && (freshlySent || continuity) && !this._sfTrackingOverlap
9221
+ && s.statusMatch === 'dispatch-key' && !s.licenseBlocked && s.dispatchAvailable && s.online
9222
+ && (commandFamily === 'signed' || completeSplit) && !splitPairConflict
9223
+ && [...selectedIds].every(id => this._sfTrackingLayout?.units.get(id) === 'W')
9224
+ && (!nwIsFeneconHybrid(s) || homeEssAc)) {
9225
+ const acceptedAt = freshlySent ? Date.now() : previous.acceptedAt;
9226
+ const acceptedSince = continuity ? previous.acceptedSince : acceptedAt;
9227
+ r.trackingCommand = { signedW: trackingSignedW, acceptedSince, acceptedAt };
9228
+ tracking.next.set(r.dispatchKey, { ...r.trackingCommand, binding, source: src, config: tracking.config });
9229
+ } else {
9230
+ this._sfPowerTracking?.delete(r.dispatchKey);
9231
+ }
9020
9232
  if (commandAccepted === true) this._sfRememberDispatchSnapshot(s, direction, alloc);
9021
9233
  results.push(r);
9022
9234
  }
@@ -9150,6 +9362,7 @@ class NexoWattVis extends HostedAdapter {
9150
9362
  commandRequired: r.commandRequired === true,
9151
9363
  commandAccepted: r.commandAccepted === true,
9152
9364
  acceptedW: Number.isFinite(Number(r.acceptedW)) ? Math.round(Number(r.acceptedW)) : 0,
9365
+ ...(r.trackingCommand ? { trackingCommand: r.trackingCommand } : {}),
9153
9366
  failedW: Number.isFinite(Number(r.failedW)) ? Math.round(Number(r.failedW)) : 0,
9154
9367
  stopAccepted: r.stopAccepted,
9155
9368
  authorityBlocked: authorityBlocks.length > 0,
@@ -12587,6 +12800,16 @@ async onReady() {
12587
12800
  try { await this.subscribeForeignStatesAsync(`${this.namespace}.chargingManagement.*`); } catch (_e) {}
12588
12801
  try { await this.subscribeForeignStatesAsync(`${this.namespace}.ems.*`); } catch (_e2) {}
12589
12802
 
12803
+ // The subscription is live before the reads. A delayed read must never
12804
+ // resurrect a state that was changed or deleted during startup.
12805
+ await Promise.all(Object.keys(this._nwDashboardHealth).map(async key => {
12806
+ const before = this._nwDashboardHealth[key];
12807
+ try {
12808
+ const state = await this.getStateAsync(key);
12809
+ if (before === this._nwDashboardHealth[key] && (state || before)) this._nwObserveDashboardHealth(key, state);
12810
+ } catch (_ignored) {}
12811
+ }));
12812
+
12590
12813
  // Prime a minimal subset that the UI uses on first render.
12591
12814
  /**
12592
12815
  * Code-Teil: primeKey
@@ -12940,10 +13163,32 @@ async onReady() {
12940
13163
 
12941
13164
  /** Öffentlichen State-/SSE-Snapshot erzeugen; operative Leistungswerte bleiben unverändert. */
12942
13165
  const nwBuildPublicStateSnapshot = (source, includeDerived = true) => {
12943
- const input = (source && typeof source === 'object') ? source : {};
13166
+ // Apply canonical diagnostics before the public privacy filter, also on backpressure resync.
13167
+ const input = includeDerived && this._nwFarmDisplay
13168
+ ? Object.assign({}, source, this._nwFarmDisplay) : (source || {});
12944
13169
  const out = {};
12945
13170
  for (const [key, entry] of Object.entries(input)) {
12946
13171
  if (nwPublicStateKeyBlocked(key)) continue;
13172
+ if (key === 'speicher.regelung.dispatcherJson') {
13173
+ // Die Farmseite benötigt nur die Reglerentscheidung. Hersteller- und
13174
+ // Prüfdaten des internen Dispatchers gehören nicht in den Kundenfeed.
13175
+ let publicDecision = null;
13176
+ if (entry && typeof entry.value === 'string' && entry.value.length <= 262144) {
13177
+ try {
13178
+ const data = JSON.parse(entry.value);
13179
+ if (data && Number.isFinite(data.ts) && typeof data.active === 'boolean') {
13180
+ publicDecision = JSON.stringify({
13181
+ ts: data.ts, active: data.active, disabled: data.disabled === true,
13182
+ finalW: Number.isFinite(data.finalW) ? data.finalW : null,
13183
+ src: typeof data.src === 'string' ? data.src.slice(0, 180) : '',
13184
+ reason: typeof data.reason === 'string' ? data.reason.slice(0, 260) : '',
13185
+ });
13186
+ }
13187
+ } catch (_) { /* Ungültige Meldung ersetzt den vorherigen Kundenwert. */ }
13188
+ }
13189
+ out[key] = { value: publicDecision, ts: entry?.ts, q: entry?.q, ack: entry?.ack };
13190
+ continue;
13191
+ }
12947
13192
  if (entry && typeof entry === 'object' && Object.prototype.hasOwnProperty.call(entry, 'value')) {
12948
13193
  out[key] = Object.assign({}, entry, { value: nwRedactPublicValue(entry.value) });
12949
13194
  } else {
@@ -24528,7 +24773,8 @@ settingsConfig: {
24528
24773
  const source = tsStates || this.stateCache;
24529
24774
  const access = authEnabled ? await resolveAccess(req) : null;
24530
24775
  const installerAccess = !!(authEnabled && access && access.isInstaller);
24531
- return res.json(installerAccess ? source : nwBuildPublicStateSnapshot(source, true));
24776
+ const visible = installerAccess ? source : nwBuildPublicStateSnapshot(source, true);
24777
+ return res.json(Object.assign(installerAccess ? { ...visible, ...this._nwFarmDisplay } : visible, this._nwDashboardHealth));
24532
24778
  });
24533
24779
 
24534
24780
  // RFID-Kundendaten liegen bewusst nicht mehr im globalen State-/SSE-Snapshot.
@@ -26695,7 +26941,7 @@ return res.json(out);
26695
26941
  const initialPayload = client.internal ? this.stateCache : nwBuildPublicStateSnapshot(this.stateCache, true);
26696
26942
  this._nwSseGuard.write(
26697
26943
  client,
26698
- "retry: 3000\n" + "data: " + JSON.stringify({ type: 'init', payload: initialPayload }) + "\n\n",
26944
+ "retry: 3000\n" + "data: " + JSON.stringify({ type: 'init', payload: Object.assign(client.internal ? { ...initialPayload, ...this._nwFarmDisplay } : initialPayload, this._nwDashboardHealth) }) + "\n\n",
26699
26945
  { kind: 'init' },
26700
26946
  );
26701
26947
  });
@@ -27423,7 +27669,7 @@ return res.json(out);
27423
27669
  // "Datenpunkte" gemappt wurden. Daher wird im Subscribe-Loop unten auf die lokalen
27424
27670
  // Adapter-States (namespace + key) zurückgefallen.
27425
27671
  const localUiKeys = [
27426
- 'speicher.dcPvPowerW',
27672
+ 'speicher.dcPvPowerW', 'speicher.regelung.dispatcherJson',
27427
27673
  'tarif.statusText', 'tarif.intentStatusText', 'tarif.intentSnapshotAgeMs', 'tarif.intentSnapshotFresh', 'tarif.statusJson',
27428
27674
  'tarif.speicherIntentW', 'tarif.speicherIntentStatus', 'tarif.speicherIntentGrund',
27429
27675
  'tarif.speicherRequestW', 'tarif.speicherRequestQuelle', 'tarif.speicherRequestGrund',
@@ -27483,13 +27729,20 @@ return res.json(out);
27483
27729
 
27484
27730
  if (!id) continue;
27485
27731
 
27486
- // subscribe
27487
- this.subscribeForeignStates(id);
27732
+ const farmDisplay = this._nwIsFarmDisplayKey(key) && id === namespace + key;
27733
+ const before = farmDisplay ? this._nwFarmDisplay?.[key] : undefined;
27734
+ if (farmDisplay && typeof this.subscribeForeignStatesAsync === 'function') {
27735
+ try { await this.subscribeForeignStatesAsync(id); }
27736
+ catch (error) { this.log.warn(`Live-Diagnose ${key} konnte nicht abonniert werden: ${error.message}`); }
27737
+ } else this.subscribeForeignStates(id);
27488
27738
 
27489
27739
  // get initial value
27490
27740
  try {
27491
27741
  await this._nwPrimeForeignPowerScale(id);
27492
27742
  const state = await this.getForeignStateAsync(id);
27743
+ if (farmDisplay && before === this._nwFarmDisplay?.[key] && (state || before)) {
27744
+ this._nwObserveFarmDisplay(key, state);
27745
+ }
27493
27746
  if (state && state.val !== undefined) {
27494
27747
  this.updateValue(key, this._nwScaleMappedValue(key, id, state.val), state.ts, { q: state.q });
27495
27748
  }
@@ -27609,6 +27862,11 @@ return res.json(out);
27609
27862
  async onStateChange(id, state) {
27610
27863
  if (this._nwShuttingDown) return;
27611
27864
  this._ocppAutoDiscovery?.onStateChange(id, state);
27865
+ if (typeof id === 'string' && id.startsWith(this.namespace + '.')) {
27866
+ const key = id.slice(this.namespace.length + 1);
27867
+ if (Object.hasOwn(this._nwDashboardHealth || {}, key)) this._nwObserveDashboardHealth(key, state);
27868
+ else if (this._nwIsFarmDisplayKey(key)) this._nwObserveFarmDisplay(key, state);
27869
+ }
27612
27870
  if (state && state.ack === false && String(id).startsWith(this.namespace + '.')
27613
27871
  && !centralLicenseSnapshot(this._bridge).ok) return;
27614
27872
  // Ordinary ioBroker controls remain usable without a separate token or
@@ -32167,7 +32425,9 @@ return res.json(out);
32167
32425
  }
32168
32426
  const now = Date.now();
32169
32427
  const cached = this._nwPara14aInfluxProvision;
32170
- if (!force && cached && cached.result && (now - Number(cached.ts || 0) < 10 * 60 * 1000)) {
32428
+ const configured = this._nwTrimId(this.config && this.config.history && this.config.history.instance);
32429
+ const retainedHistorian = configured && this.namespace !== this.hostNamespace && /^nexowatt-ui\.\d+$/.test(this.namespace);
32430
+ if (!retainedHistorian && !force && cached && cached.result && (now - Number(cached.ts || 0) < 10 * 60 * 1000)) {
32171
32431
  return cached.result;
32172
32432
  }
32173
32433
 
@@ -32187,7 +32447,7 @@ return res.json(out);
32187
32447
  provisionError: '',
32188
32448
  }, partial || {});
32189
32449
  out.instance = this._nwTrimId(out.instance);
32190
- out.ready = !!out.instance && typeof this._nwEnsureInfluxCustom === 'function';
32450
+ out.ready = partial.ready !== false && !!out.instance && typeof this._nwEnsureInfluxCustom === 'function';
32191
32451
  this._nwPara14aInfluxProvision = { ts: Date.now(), result: out };
32192
32452
  return out;
32193
32453
  };
@@ -32243,7 +32503,14 @@ return res.json(out);
32243
32503
  };
32244
32504
 
32245
32505
  try {
32246
- const configured = this._nwTrimId(this.config && this.config.history && this.config.history.instance);
32506
+ if (retainedHistorian) {
32507
+ // Der Bestand bleibt auch bei Lesefehlern an seinem gespeicherten Historiker.
32508
+ // Eine benachbarte Influx-Instanz kann eine andere Datenbank bedienen.
32509
+ const object = await this.getForeignObjectAsync(`system.adapter.${configured}`).catch(() => null);
32510
+ const available = object?.type === 'instance' && object.common?.enabled === true;
32511
+ return finish({ instance: configured, ready: available, provisionState: available ? 'shared_configured' : 'configured_unavailable',
32512
+ provisionError: available ? '' : `Übernommene History-Instanz ist nicht verfügbar: ${configured}` });
32513
+ }
32247
32514
  const existingInfluxInstances = await this._nwListAdapterInstances('influxdb');
32248
32515
  const sharedInflux = pickSharedInfluxInstance(existingInfluxInstances);
32249
32516
 
@@ -34310,6 +34577,49 @@ return res.json(out);
34310
34577
  }
34311
34578
  }
34312
34579
  }
34580
+ _nwIsFarmDisplayKey(key) {
34581
+ return key === 'storageFarm.storagesStatusJson' || key === 'storageFarm.lastDispatchJson'
34582
+ || key === 'storageFarm.overviewJson' || key === 'speicher.regelung.dispatcherJson';
34583
+ }
34584
+
34585
+ _nwObserveFarmDisplay(key, state) {
34586
+ // Preserve the source's observation across separate EMS and UI processes.
34587
+ // The regular control and history caches retain their existing semantics.
34588
+ const value = typeof state?.val === 'string' && state.val.length <= 262144 ? state.val : null;
34589
+ const ts = Number.isSafeInteger(state?.ts) && state.ts > 0 ? state.ts : 0;
34590
+ const q = state?.q === undefined ? undefined : Number.isSafeInteger(state.q) ? state.q : 128;
34591
+ const row = { value, ts, ack: state?.ack === true, ...(q === undefined ? {} : { q }) };
34592
+ this._nwFarmDisplay ??= Object.create(null);
34593
+ this._nwFarmDisplay[key] = row;
34594
+ this._nwSseSnapshotChunkCache = null;
34595
+ if (!this.sseClients?.size) return;
34596
+ (this._ssePendingPayload ??= Object.create(null))[key] = row;
34597
+ this._nwScheduleSseFlush();
34598
+ }
34599
+
34600
+ _nwObserveDashboardHealth(key, state) {
34601
+ const heartbeat = key === 'ems.core.schedulerHeartbeatAt';
34602
+ const raw = state?.val;
34603
+ const value = (heartbeat ? Number.isSafeInteger(raw) && raw > 0 : typeof raw === 'boolean') ? raw : null;
34604
+ const ts = Number.isSafeInteger(state?.ts) && state.ts > 0 ? state.ts : 0;
34605
+ const ack = state?.ack === true;
34606
+ const q = state?.q === undefined ? undefined : Number.isSafeInteger(state.q) ? state.q : 128;
34607
+ const row = { value, ts, ack, ...(q === undefined ? {} : { q }) };
34608
+ this._nwDashboardHealth[key] = row;
34609
+ this._nwSseSnapshotChunkCache = null;
34610
+ // No timers, serialization or broadcasts for an idle dashboard. Repeated
34611
+ // confirmations share the existing SSE batch; faults and recovery go at once.
34612
+ if (!this.sseClients?.size) return;
34613
+ const sent = this._nwDashboardHealthSent[key];
34614
+ const regularHeartbeat = heartbeat && value > 0 && sent?.value > 0 && value >= sent.value
34615
+ && Math.abs(value - ts) < 4000 && Math.abs(sent.value - sent.ts) < 4000;
34616
+ if (sent && sent.ack === ack && sent.q === q && (sent.value === value || regularHeartbeat)
34617
+ && ts >= sent.ts && ts - sent.ts < 4000) return;
34618
+ this._nwDashboardHealthSent[key] = row;
34619
+ (this._ssePendingPayload ??= Object.create(null))[key] = row;
34620
+ this._nwScheduleSseFlush();
34621
+ }
34622
+
34313
34623
  updateValue(key, value, ts, opts = {}) {
34314
34624
  // Nach Beginn des Unloads keine Cache-Kaskaden, abgeleiteten Berechnungen oder
34315
34625
  // SSE-Batches mehr erzeugen. Laufende Hardware-/State-Schreibvorgänge werden durch
@@ -34339,9 +34649,16 @@ return res.json(out);
34339
34649
 
34340
34650
  this.stateCache[key] = { value, ts, ...(opts.q !== undefined ? { q: opts.q } : {}) };
34341
34651
 
34652
+ // The admin overview periodically normalizes scheduler rows for its own cache.
34653
+ // Only the original producer observation may reach dashboard clients.
34654
+ if (this._nwDashboardHealth && Object.hasOwn(this._nwDashboardHealth, key)) return;
34655
+ // A synthetic local refresh must not replace the producer's ack/q/ts in the
34656
+ // outgoing batch. Other calculations below still see their original cache value.
34657
+ const authoritativeFarmRow = this._nwFarmDisplay?.[key];
34658
+
34342
34659
  // Allocate one patch per delivery batch, and none while no dashboard is listening.
34343
34660
  const payload = this.sseClients?.size ? (this._ssePendingPayload ??= Object.create(null)) : null;
34344
- if (payload) payload[key] = this.stateCache[key];
34661
+ if (payload) payload[key] = authoritativeFarmRow || this.stateCache[key];
34345
34662
 
34346
34663
  // derived EVCS aggregates
34347
34664
  try {
@@ -34400,15 +34717,16 @@ return res.json(out);
34400
34717
  if (isTrigger) this.scheduleDerivedFlowUpdate(`key:${key}`);
34401
34718
  } catch (_e3) {}
34402
34719
 
34403
- // push update to all SSE clients (batched to avoid UI freezes)
34720
+ // RC88_SSE_IDLE_ZERO_ALLOCATION: only schedule a batch for active dashboards.
34721
+ if (!payload) {
34722
+ this._ssePendingPayload = null;
34723
+ return;
34724
+ }
34725
+ this._nwScheduleSseFlush();
34726
+ }
34727
+
34728
+ _nwScheduleSseFlush() {
34404
34729
  try {
34405
- // RC88_SSE_IDLE_ZERO_ALLOCATION: without connected dashboards there is
34406
- // nothing to batch or serialize. Avoid a permanent 120-ms timer/allocation
34407
- // chain on headless customer systems.
34408
- if (!payload) {
34409
- this._ssePendingPayload = null;
34410
- return;
34411
- }
34412
34730
  if (!this._sseFlushTimer) {
34413
34731
  const batchMs = (this.config && Number(this.config.sseBatchMs)) || 120;
34414
34732
  this._sseFlushTimer = this._nwSetTimeout(() => {
package/ui/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexowatt-eos-ui-internal",
3
- "version": "9.0.35",
3
+ "version": "9.0.38",
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",