iobroker.eos-admin 9.0.17 → 9.0.19

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 (291) hide show
  1. package/NEXOWATT_EOS_BUILD_INFO.json +11 -14
  2. package/README.md +7 -3
  3. package/START_HIER_9.0.18.md +47 -0
  4. package/START_HIER_9.0.19.md +52 -0
  5. package/adminWww/.vite/manifest.json +114 -114
  6. package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +13759 -13759
  7. package/adminWww/assets/{AdapterUpdateDialog-Cpo3dAfY.js → AdapterUpdateDialog-JOf2z4Vg.js} +1 -1
  8. package/adminWww/assets/{Adapters-n2ukPDdC.js → Adapters-C9fcSdWm.js} +1 -1
  9. package/adminWww/assets/{ConfigManager-BVZ6_Ebo.js → ConfigManager-BeeLlT6D.js} +1 -1
  10. package/adminWww/assets/{Enums-CQ6yHG2W.js → Enums-FqnXWl8U.js} +1 -1
  11. package/adminWww/assets/{Fields-CaJqzoW-.js → Fields-DMgrt5Pi.js} +1 -1
  12. package/adminWww/assets/{Files-DfvpKGa3.js → Files-CIHtt12g.js} +1 -1
  13. package/adminWww/assets/{Hosts-3xLBsdG6.js → Hosts-fPLBzvTy.js} +1 -1
  14. package/adminWww/assets/{Instances-B7hKEhyw.js → Instances-4XaVQlrT.js} +1 -1
  15. package/adminWww/assets/{Intro-BV4kYZdT.js → Intro-5TKriiLO.js} +1 -1
  16. package/adminWww/assets/{Logs-DpL9eY69.js → Logs-33zcIds-.js} +1 -1
  17. package/adminWww/assets/{Objects-dN06jhQk.js → Objects-CNQPVbNG.js} +1 -1
  18. package/adminWww/assets/{Overview-Lip63_ej.js → Overview-BskXGOc8.js} +1 -1
  19. package/adminWww/assets/{State-BSO2X_xN.js → State-C8SJ_Iqo.js} +1 -1
  20. package/adminWww/assets/{UsedResources-DvqzszKI.js → UsedResources-CgqRa9ei.js} +1 -1
  21. package/adminWww/assets/{Users-Csqd1xA-.js → Users-0JVYWR9u.js} +1 -1
  22. package/adminWww/assets/{bootstrap-C3HM8kNL.js → bootstrap-D16lu6rd.js} +3 -3
  23. package/adminWww/assets/{hostInit-DdxBUeXQ.js → hostInit-C8YZJuzi.js} +1 -1
  24. package/adminWww/assets/{icons-material-D1Tb_725.js → icons-material-CiNJ_6Ur.js} +1 -1
  25. package/adminWww/assets/{index-BOujTMyH.js → index-DA9Sphgh.js} +2 -2
  26. package/adminWww/assets/{installSVGRenderer-BZyrUVAo.js → installSVGRenderer-DPdkRa_d.js} +1 -1
  27. package/adminWww/assets/{mf-entry-bootstrap-0-3418586b.js → mf-entry-bootstrap-0-a7ab91de.js} +2 -2
  28. package/adminWww/index.html +23 -23
  29. package/adminWww/mf-manifest.json +1 -1
  30. package/adminWww/mf-stats.json +1 -1
  31. package/adminWww/{remoteEntry-eos-9.0.17.js → remoteEntry-eos-9.0.19.js} +1 -1
  32. package/adminWww/remoteEntry.js +1 -1
  33. package/build/lib/eosCookieNamespace.js +12 -2
  34. package/build/lib/eosCookieNamespace.js.map +1 -1
  35. package/build/lib/eosDeviceEmsPlan.js +1147 -0
  36. package/build/lib/eosDeviceEmsPlan.js.map +1 -0
  37. package/build/lib/eosDeviceEmsService.js +473 -0
  38. package/build/lib/eosDeviceEmsService.js.map +1 -0
  39. package/build/lib/eosModuleHost.js +227 -51
  40. package/build/lib/eosModuleHost.js.map +1 -1
  41. package/build/lib/eosModuleHttp.js +1 -1
  42. package/build/lib/eosModuleHttp.js.map +1 -1
  43. package/build/lib/web.js +31 -0
  44. package/build/lib/web.js.map +1 -1
  45. package/docs/reports/unified-9.0.18/ALIAS_V1_COVERAGE.json +5056 -0
  46. package/docs/reports/unified-9.0.18/ALIAS_V1_VERTRAG.md +257 -0
  47. package/docs/reports/unified-9.0.18/ANFORDERUNGEN.md +55 -0
  48. package/docs/reports/unified-9.0.18/CUSTOMER_TARIFF_REVIEW.md +33 -0
  49. package/docs/reports/unified-9.0.18/GERAETE_EMS_EINRICHTUNG.md +86 -0
  50. package/docs/reports/unified-9.0.18/INSTALLER_LIFECYCLE_REVIEW.md +29 -0
  51. package/docs/reports/unified-9.0.18/KUNDENTARIF_EINRICHTUNG.md +27 -0
  52. package/docs/reports/unified-9.0.18/PRUEFBERICHT.md +87 -0
  53. package/docs/reports/unified-9.0.18/UNABHAENGIGER_REVIEW.md +63 -0
  54. package/docs/reports/unified-9.0.18/raw/INDEX.json +331 -0
  55. package/docs/reports/unified-9.0.18/raw/audit-full.log +345 -0
  56. package/docs/reports/unified-9.0.18/raw/audit-full.result.json +14 -0
  57. package/docs/reports/unified-9.0.18/raw/audit-runtime.log +23 -0
  58. package/docs/reports/unified-9.0.18/raw/audit-runtime.result.json +15 -0
  59. package/docs/reports/unified-9.0.18/raw/backend-final.log +5 -0
  60. package/docs/reports/unified-9.0.18/raw/backend-final.result.json +14 -0
  61. package/docs/reports/unified-9.0.18/raw/frontend-build.log +152 -0
  62. package/docs/reports/unified-9.0.18/raw/frontend-build.result.json +14 -0
  63. package/docs/reports/unified-9.0.18/raw/installer-build.log +26 -0
  64. package/docs/reports/unified-9.0.18/raw/installer-build.result.json +14 -0
  65. package/docs/reports/unified-9.0.18/raw/keygen-source.json +6 -0
  66. package/docs/reports/unified-9.0.18/raw/lint-final.log +5 -0
  67. package/docs/reports/unified-9.0.18/raw/lint-final.result.json +14 -0
  68. package/docs/reports/unified-9.0.18/raw/modules-build.log +5 -0
  69. package/docs/reports/unified-9.0.18/raw/modules-build.result.json +14 -0
  70. package/docs/reports/unified-9.0.18/raw/node22-tests-final.log +9859 -0
  71. package/docs/reports/unified-9.0.18/raw/node22-tests-final.result.json +13 -0
  72. package/docs/reports/unified-9.0.18/raw/node22-typecheck-final.log +7 -0
  73. package/docs/reports/unified-9.0.18/raw/node22-typecheck-final.result.json +14 -0
  74. package/docs/reports/unified-9.0.18/raw/node22-version.log +1 -0
  75. package/docs/reports/unified-9.0.18/raw/node24-tests-final.log +1663 -0
  76. package/docs/reports/unified-9.0.18/raw/node24-tests-final.result.json +13 -0
  77. package/docs/reports/unified-9.0.18/raw/node24-typecheck-final.log +5 -0
  78. package/docs/reports/unified-9.0.18/raw/node24-typecheck-final.result.json +14 -0
  79. package/docs/reports/unified-9.0.18/raw/node24-version.log +1 -0
  80. package/docs/reports/unified-9.0.18/raw/sbom-runtime.log +7 -0
  81. package/docs/reports/unified-9.0.18/raw/sbom-runtime.result.json +14 -0
  82. package/docs/reports/unified-9.0.18/raw/sbom-vendor-check.log +1 -0
  83. package/docs/reports/unified-9.0.18/raw/sbom-vendor-check.result.json +14 -0
  84. package/docs/reports/unified-9.0.18/raw/ui-docs-check.log +6 -0
  85. package/docs/reports/unified-9.0.18/raw/ui-docs-check.result.json +14 -0
  86. package/docs/reports/unified-9.0.18/raw/ui-runtime-final.log +7 -0
  87. package/docs/reports/unified-9.0.18/raw/ui-runtime-final.result.json +14 -0
  88. package/docs/reports/unified-9.0.18/raw/ui-runtime-sync.log +6 -0
  89. package/docs/reports/unified-9.0.18/raw/ui-runtime-sync.result.json +14 -0
  90. package/docs/reports/unified-9.0.18/raw/ui-sbom-check.log +6 -0
  91. package/docs/reports/unified-9.0.18/raw/ui-sbom-check.result.json +14 -0
  92. package/docs/reports/unified-9.0.18/raw/ui-sbom-final.log +14 -0
  93. package/docs/reports/unified-9.0.18/raw/ui-sbom-final.result.json +14 -0
  94. package/docs/reports/unified-9.0.18/raw/ui-secret-final.log +6 -0
  95. package/docs/reports/unified-9.0.18/raw/ui-secret-final.result.json +14 -0
  96. package/docs/reports/unified-9.0.18/raw/ui-security-final.log +8 -0
  97. package/docs/reports/unified-9.0.18/raw/ui-security-final.result.json +14 -0
  98. package/docs/reports/unified-9.0.19/ALIAS_MESSWERTFRISCHE.md +31 -0
  99. package/docs/reports/unified-9.0.19/COMMISSIONING_PLAN_REVIEW.md +56 -0
  100. package/docs/reports/unified-9.0.19/EMS_ABSCHLUSSREVIEW.md +43 -0
  101. package/docs/reports/unified-9.0.19/EMS_KATEGORIEN_ABDECKUNG.md +66 -0
  102. package/docs/reports/unified-9.0.19/EMS_VERGLEICH_UND_KOPPLUNG.md +25 -0
  103. package/docs/reports/unified-9.0.19/EVCS_STATE_OBJECTS.md +47 -0
  104. package/docs/reports/unified-9.0.19/GERAETE_EMS_EINRICHTUNG.md +100 -0
  105. package/docs/reports/unified-9.0.19/GERAETE_STARTAUSFALL.md +37 -0
  106. package/docs/reports/unified-9.0.19/INSTALLER_LIFECYCLE_REVIEW.md +59 -0
  107. package/docs/reports/unified-9.0.19/LEGACY_REGRESSION_REVIEW.md +42 -0
  108. package/docs/reports/unified-9.0.19/MODBUS_AUTHORIZATION_READS.md +25 -0
  109. package/docs/reports/unified-9.0.19/PRUEFBERICHT.md +56 -0
  110. package/docs/reports/unified-9.0.19/RUNTIME_START_UEBERNAHME.md +33 -0
  111. package/docs/reports/unified-9.0.19/SMA_RECEIVER_LIFECYCLE.md +42 -0
  112. package/docs/reports/unified-9.0.19/STATIC_REVIEW_DE.md +11 -0
  113. package/docs/reports/unified-9.0.19/TARIFF_PRICE_VALUES_REVIEW.md +31 -0
  114. package/docs/reports/unified-9.0.19/TARIF_VIERTELSTUNDEN_RUNTIME.md +17 -0
  115. package/docs/reports/unified-9.0.19/UNABHAENGIGER_REVIEW.md +49 -0
  116. package/docs/reports/unified-9.0.19/raw/INDEX.json +751 -0
  117. package/docs/reports/unified-9.0.19/raw/audit-full.log +345 -0
  118. package/docs/reports/unified-9.0.19/raw/audit-full.result.json +14 -0
  119. package/docs/reports/unified-9.0.19/raw/audit-runtime.log +23 -0
  120. package/docs/reports/unified-9.0.19/raw/audit-runtime.result.json +15 -0
  121. package/docs/reports/unified-9.0.19/raw/backend-final.log +5 -0
  122. package/docs/reports/unified-9.0.19/raw/backend-final.result.json +14 -0
  123. package/docs/reports/unified-9.0.19/raw/devices-hosted-typecheck-node22.log +0 -0
  124. package/docs/reports/unified-9.0.19/raw/devices-hosted-typecheck-node22.result.json +15 -0
  125. package/docs/reports/unified-9.0.19/raw/devices-hosted-typecheck-node24.log +0 -0
  126. package/docs/reports/unified-9.0.19/raw/devices-hosted-typecheck-node24.result.json +15 -0
  127. package/docs/reports/unified-9.0.19/raw/devices-incident-build.log +5 -0
  128. package/docs/reports/unified-9.0.19/raw/devices-incident-host-final.log +70 -0
  129. package/docs/reports/unified-9.0.19/raw/devices-incident-lease-918-before.log +26 -0
  130. package/docs/reports/unified-9.0.19/raw/devices-incident-lease-after.log +9 -0
  131. package/docs/reports/unified-9.0.19/raw/devices-incident-metadata-after.log +11 -0
  132. package/docs/reports/unified-9.0.19/raw/devices-incident-metadata-before.log +28 -0
  133. package/docs/reports/unified-9.0.19/raw/devices-incident-web-pipeline.log +22 -0
  134. package/docs/reports/unified-9.0.19/raw/frontend-build.log +152 -0
  135. package/docs/reports/unified-9.0.19/raw/frontend-build.result.json +14 -0
  136. package/docs/reports/unified-9.0.19/raw/installer-build.log +26 -0
  137. package/docs/reports/unified-9.0.19/raw/installer-build.result.json +14 -0
  138. package/docs/reports/unified-9.0.19/raw/keygen-source.json +6 -0
  139. package/docs/reports/unified-9.0.19/raw/legacy-auto-pv.log +6 -0
  140. package/docs/reports/unified-9.0.19/raw/legacy-auto-pv.result.json +14 -0
  141. package/docs/reports/unified-9.0.19/raw/legacy-charging-grid-cap-clamp.log +6 -0
  142. package/docs/reports/unified-9.0.19/raw/legacy-charging-grid-cap-clamp.result.json +14 -0
  143. package/docs/reports/unified-9.0.19/raw/legacy-charging-grid-cap-safe.log +6 -0
  144. package/docs/reports/unified-9.0.19/raw/legacy-charging-grid-cap-safe.result.json +14 -0
  145. package/docs/reports/unified-9.0.19/raw/legacy-charging-mode-recovery.log +539 -0
  146. package/docs/reports/unified-9.0.19/raw/legacy-charging-mode-recovery.result.json +14 -0
  147. package/docs/reports/unified-9.0.19/raw/legacy-core-limits-phase1.log +6 -0
  148. package/docs/reports/unified-9.0.19/raw/legacy-core-limits-phase1.result.json +14 -0
  149. package/docs/reports/unified-9.0.19/raw/legacy-core-limits-phase2.log +6 -0
  150. package/docs/reports/unified-9.0.19/raw/legacy-core-limits-phase2.result.json +14 -0
  151. package/docs/reports/unified-9.0.19/raw/legacy-core-limits-tariff-final.log +6 -0
  152. package/docs/reports/unified-9.0.19/raw/legacy-core-limits-tariff-final.result.json +14 -0
  153. package/docs/reports/unified-9.0.19/raw/legacy-energy-wallet-final.log +6 -0
  154. package/docs/reports/unified-9.0.19/raw/legacy-energy-wallet-final.result.json +14 -0
  155. package/docs/reports/unified-9.0.19/raw/legacy-farm-dispatch-loader-current.log +2 -0
  156. package/docs/reports/unified-9.0.19/raw/legacy-farm-dispatch-loader-current.result.json +14 -0
  157. package/docs/reports/unified-9.0.19/raw/legacy-final-write-envelope.log +6 -0
  158. package/docs/reports/unified-9.0.19/raw/legacy-final-write-envelope.result.json +14 -0
  159. package/docs/reports/unified-9.0.19/raw/legacy-history-http.log +39 -0
  160. package/docs/reports/unified-9.0.19/raw/legacy-history-http.result.json +15 -0
  161. package/docs/reports/unified-9.0.19/raw/legacy-import-grid-budget.log +30 -0
  162. package/docs/reports/unified-9.0.19/raw/legacy-import-grid-budget.result.json +14 -0
  163. package/docs/reports/unified-9.0.19/raw/legacy-import-grid-contract-current.log +2 -0
  164. package/docs/reports/unified-9.0.19/raw/legacy-import-grid-contract-current.result.json +14 -0
  165. package/docs/reports/unified-9.0.19/raw/legacy-live-mode-loader-current.log +203 -0
  166. package/docs/reports/unified-9.0.19/raw/legacy-live-mode-loader-current.result.json +14 -0
  167. package/docs/reports/unified-9.0.19/raw/legacy-load-grid-sanity.log +6 -0
  168. package/docs/reports/unified-9.0.19/raw/legacy-load-grid-sanity.result.json +14 -0
  169. package/docs/reports/unified-9.0.19/raw/legacy-ocpp-stability.log +6 -0
  170. package/docs/reports/unified-9.0.19/raw/legacy-ocpp-stability.result.json +14 -0
  171. package/docs/reports/unified-9.0.19/raw/legacy-ocpp21-storage-safety.log +6 -0
  172. package/docs/reports/unified-9.0.19/raw/legacy-ocpp21-storage-safety.result.json +14 -0
  173. package/docs/reports/unified-9.0.19/raw/legacy-permanent-grid-protection.log +18 -0
  174. package/docs/reports/unified-9.0.19/raw/legacy-permanent-grid-protection.result.json +14 -0
  175. package/docs/reports/unified-9.0.19/raw/legacy-storage-dp-persistence.log +6 -0
  176. package/docs/reports/unified-9.0.19/raw/legacy-storage-dp-persistence.result.json +14 -0
  177. package/docs/reports/unified-9.0.19/raw/legacy-storage-farm-dispatch-recovery.log +16 -0
  178. package/docs/reports/unified-9.0.19/raw/legacy-storage-farm-dispatch-recovery.result.json +14 -0
  179. package/docs/reports/unified-9.0.19/raw/legacy-storage-functional-safety.log +6 -0
  180. package/docs/reports/unified-9.0.19/raw/legacy-storage-functional-safety.result.json +14 -0
  181. package/docs/reports/unified-9.0.19/raw/legacy-storage-topology-loader-current.log +2 -0
  182. package/docs/reports/unified-9.0.19/raw/legacy-storage-topology-loader-current.result.json +14 -0
  183. package/docs/reports/unified-9.0.19/raw/legacy-test-loader.cjs +47 -0
  184. package/docs/reports/unified-9.0.19/raw/lint-final.log +16 -0
  185. package/docs/reports/unified-9.0.19/raw/lint-final.result.json +14 -0
  186. package/docs/reports/unified-9.0.19/raw/modules-build.log +5 -0
  187. package/docs/reports/unified-9.0.19/raw/modules-build.result.json +14 -0
  188. package/docs/reports/unified-9.0.19/raw/node22-tests-final.log +10719 -0
  189. package/docs/reports/unified-9.0.19/raw/node22-tests-final.result.json +13 -0
  190. package/docs/reports/unified-9.0.19/raw/node22-typecheck-final.log +7 -0
  191. package/docs/reports/unified-9.0.19/raw/node22-typecheck-final.result.json +14 -0
  192. package/docs/reports/unified-9.0.19/raw/node22-version.log +1 -0
  193. package/docs/reports/unified-9.0.19/raw/node24-tests-final.log +1805 -0
  194. package/docs/reports/unified-9.0.19/raw/node24-tests-final.result.json +13 -0
  195. package/docs/reports/unified-9.0.19/raw/node24-typecheck-final.log +5 -0
  196. package/docs/reports/unified-9.0.19/raw/node24-typecheck-final.result.json +14 -0
  197. package/docs/reports/unified-9.0.19/raw/node24-version.log +1 -0
  198. package/docs/reports/unified-9.0.19/raw/sbom-runtime.log +7 -0
  199. package/docs/reports/unified-9.0.19/raw/sbom-runtime.result.json +14 -0
  200. package/docs/reports/unified-9.0.19/raw/sbom-vendor-check.log +1 -0
  201. package/docs/reports/unified-9.0.19/raw/sbom-vendor-check.result.json +14 -0
  202. package/docs/reports/unified-9.0.19/raw/tariff-price-chain-919.log +11 -0
  203. package/docs/reports/unified-9.0.19/raw/tariff-price-chain-919.result.json +14 -0
  204. package/docs/reports/unified-9.0.19/raw/tariff-price-chain-old-918.log +68 -0
  205. package/docs/reports/unified-9.0.19/raw/tariff-price-chain-old-918.result.json +14 -0
  206. package/docs/reports/unified-9.0.19/raw/ui-docs-check.log +6 -0
  207. package/docs/reports/unified-9.0.19/raw/ui-docs-check.result.json +14 -0
  208. package/docs/reports/unified-9.0.19/raw/ui-runtime-final.log +7 -0
  209. package/docs/reports/unified-9.0.19/raw/ui-runtime-final.result.json +14 -0
  210. package/docs/reports/unified-9.0.19/raw/ui-runtime-sync.log +6 -0
  211. package/docs/reports/unified-9.0.19/raw/ui-runtime-sync.result.json +14 -0
  212. package/docs/reports/unified-9.0.19/raw/ui-sbom-check.log +6 -0
  213. package/docs/reports/unified-9.0.19/raw/ui-sbom-check.result.json +14 -0
  214. package/docs/reports/unified-9.0.19/raw/ui-sbom-final.log +6 -0
  215. package/docs/reports/unified-9.0.19/raw/ui-sbom-final.result.json +14 -0
  216. package/docs/reports/unified-9.0.19/raw/ui-secret-final.log +6 -0
  217. package/docs/reports/unified-9.0.19/raw/ui-secret-final.result.json +14 -0
  218. package/docs/reports/unified-9.0.19/raw/ui-security-final.log +8 -0
  219. package/docs/reports/unified-9.0.19/raw/ui-security-final.result.json +14 -0
  220. package/io-package.json +12 -12
  221. package/modules/devices/admin/alias-contract-v1.json +189 -0
  222. package/modules/devices/admin/ems-assignment.d.ts +16 -0
  223. package/modules/devices/admin/ems-assignment.js +356 -0
  224. package/modules/devices/admin/host-bridge.js +76 -4
  225. package/modules/devices/admin/index.html +40 -1
  226. package/modules/devices/admin/index_m.js +158 -2
  227. package/modules/devices/admin/style.css +32 -4
  228. package/modules/devices/checks/emsAssignment.check.js +132 -0
  229. package/modules/devices/contracts.d.ts +1 -1
  230. package/modules/devices/eslint.hosted.config.mjs +1 -1
  231. package/modules/devices/index.js +64 -16
  232. package/modules/devices/lib/alias-contract-v1.json +189 -0
  233. package/modules/devices/lib/aliasContract.js +7 -1
  234. package/modules/devices/lib/device-alias-semantics-v1.json +1605 -0
  235. package/modules/devices/lib/deviceAliasFreshness.js +65 -0
  236. package/modules/devices/lib/deviceAliasSemantics.js +109 -0
  237. package/modules/devices/lib/deviceRuntime.js +204 -127
  238. package/modules/devices/lib/drivers/modbus.js +18 -3
  239. package/modules/devices/lib/drivers/speedwire.js +42 -22
  240. package/modules/devices/test/aliasContractV1.test.js +1 -1
  241. package/modules/devices/test/deviceAliasFreshness.test.js +149 -0
  242. package/modules/devices/test/deviceAliasSemantics.test.js +163 -0
  243. package/modules/devices/test/emsAssignmentUi.test.js +298 -0
  244. package/modules/devices/test/modbusAuthorizationReads.test.js +112 -0
  245. package/modules/devices/test/runtimeLiveness.test.js +1 -1
  246. package/modules/devices/test/speedwireLifecycle.test.js +118 -0
  247. package/modules/devices/tsconfig.alias-semantics.json +17 -0
  248. package/modules/devices/tsconfig.ems-ui.json +9 -0
  249. package/modules/devices/tsconfig.hosted.json +1 -1
  250. package/package.json +11 -7
  251. package/release-manifests/unified/build-environment.cdx.json +1483 -7370
  252. package/release-manifests/unified/files.json +392 -121
  253. package/release-manifests/unified/frontend.cdx.json +2688 -5952
  254. package/release-manifests/unified/installer.cdx.json +2053 -821
  255. package/release-manifests/unified/obsolete-admin-assets.json +172 -6
  256. package/release-manifests/unified/runtime.cdx.json +40 -3283
  257. package/release-manifests/unified/validation.json +15 -15
  258. package/tools/eos-release-check.cjs +1 -1
  259. package/tools/eos-release-manifest.cjs +5 -5
  260. package/ui/docs/security/eslint-reviewed-findings.json +32 -18
  261. package/ui/ems/datapoints.js +22 -1
  262. package/ui/ems/engine.js +54 -7
  263. package/ui/ems/module-manager.js +44 -21
  264. package/ui/ems/modules/core-limits.js +5 -3
  265. package/ui/ems/modules/energy-wallet.js +31 -32
  266. package/ui/ems/modules/storage-control.js +5 -4
  267. package/ui/ems/modules/tarif-vis.js +36 -24
  268. package/ui/ems/modules/tariff-provider.js +259 -59
  269. package/ui/ems/services/tariff-provider-registry.js +11 -8
  270. package/ui/io-package.json +5 -1
  271. package/ui/lib/customer-tariff.js +245 -0
  272. package/ui/lib/installer-lifecycle.js +220 -0
  273. package/ui/lib/storage-farm-overview.js +115 -0
  274. package/ui/lib/tariff-price.js +115 -0
  275. package/ui/main.js +400 -163
  276. package/ui/package.json +14 -4
  277. package/ui/www/app.js +47 -134
  278. package/ui/www/customer-tariff.css +21 -0
  279. package/ui/www/customer-tariff.js +333 -0
  280. package/ui/www/ems-apps.html +2 -0
  281. package/ui/www/ems-apps.js +29 -7
  282. package/ui/www/index.html +2 -0
  283. package/ui/www/licenses/smarthome-markdown-components.json +156 -156
  284. package/ui/www/manifest.webmanifest +2 -2
  285. package/ui/www/power-measurements.js +62 -0
  286. package/ui/www/settings.html +47 -0
  287. package/ui/www/storagefarm-summary.css +17 -0
  288. package/ui/www/storagefarm-summary.js +136 -0
  289. package/ui/www/storagefarm.html +16 -1
  290. package/ui/www/storagefarm.js +10 -22
  291. package/ui/www/tariff-display.js +161 -0
@@ -302,6 +302,7 @@ class SpeedwireHub {
302
302
  if (this._restarting) return;
303
303
  if (this.starting) return;
304
304
  if (!this.socket) return;
305
+ if (!this.handlers.size) return;
305
306
 
306
307
  this._restarting = true;
307
308
  const sock = this.socket;
@@ -323,6 +324,7 @@ class SpeedwireHub {
323
324
  });
324
325
 
325
326
  try {
327
+ if (!this.handlers.size) return;
326
328
  if (reason) this._logWarn(`[speedwire] Restarting UDP listener (${reason}).`);
327
329
  await this.start();
328
330
  } catch (e) {
@@ -426,13 +428,23 @@ class SpeedwireHub {
426
428
  sock.on('error', (err) => {
427
429
  this._logWarn(`[speedwire] UDP socket error (${this.multicastGroup}:${this.port}): ${_errMsg(err)}`);
428
430
  try { sock.close(); } catch (_) { /* ignore */ }
429
- this.socket = null;
430
- this.started = false;
431
- this.starting = null;
431
+ if (this.socket === sock) {
432
+ this.socket = null;
433
+ this.started = false;
434
+ }
435
+ });
436
+ // A closed socket is no longer a running receiver. Keep its subscribers;
437
+ // the next ordinary device read can create a replacement listener.
438
+ sock.on('close', () => {
439
+ if (this.socket === sock) {
440
+ this.socket = null;
441
+ this.started = false;
442
+ }
432
443
  });
433
444
 
434
445
  sock.on('message', (msg, rinfo) => {
435
446
  try {
447
+ if (this.socket !== sock) return;
436
448
  this.rxCount += 1;
437
449
  this.lastRxAt = Date.now();
438
450
 
@@ -543,10 +555,10 @@ class SpeedwireHub {
543
555
  this._startWatchdog();
544
556
 
545
557
  this.started = true;
546
- this.starting = null;
547
558
  })();
548
559
 
549
- return await this.starting;
560
+ try { return await this.starting; }
561
+ finally { this.starting = null; }
550
562
  }
551
563
 
552
564
  addHandler(fn) {
@@ -559,7 +571,10 @@ class SpeedwireHub {
559
571
 
560
572
  async stopIfUnused() {
561
573
  if (this.handlers.size) return;
562
- if (!this.socket) return;
574
+ // Binding is asynchronous. Wait for its completion before closing, and
575
+ // recheck users because a replacement driver may have joined meanwhile.
576
+ if (this.starting) { try { await this.starting; } catch (_) { /* Failed binds still need cleanup. */ } }
577
+ if (this.handlers.size) return;
563
578
 
564
579
  if (this._refreshTimer) {
565
580
  try { clearInterval(this._refreshTimer); } catch (_) { /* ignore */ }
@@ -576,6 +591,7 @@ class SpeedwireHub {
576
591
  this.started = false;
577
592
  this.starting = null;
578
593
 
594
+ if (!sock) return;
579
595
  await new Promise((resolve) => {
580
596
  try { sock.close(() => resolve()); } catch (_) { resolve(); }
581
597
  });
@@ -654,20 +670,19 @@ class SpeedwireDriver {
654
670
  }
655
671
 
656
672
  async _ensureListener() {
657
- if (this.hub) return;
658
-
659
- const { hub, key } = getHub(this.adapter, {
660
- port: this.port,
661
- multicastGroup: this.multicastGroup,
662
- interfaceAddress: this.interfaceAddress,
663
- });
664
-
665
- this.hub = hub;
666
- this.hubKey = key;
667
-
668
- await this.hub.start();
669
-
670
- this.unregister = this.hub.addHandler((parsed, rinfo) => {
673
+ if (!this.hub) {
674
+ const { hub, key } = getHub(this.adapter, {
675
+ port: this.port,
676
+ multicastGroup: this.multicastGroup,
677
+ interfaceAddress: this.interfaceAddress,
678
+ });
679
+ this.hub = hub;
680
+ this.hubKey = key;
681
+ }
682
+ const hub = this.hub;
683
+ // Register before awaiting the bind. This prevents a concurrent disconnect
684
+ // from treating a pending replacement subscriber as an unused listener.
685
+ if (!this.unregister) this.unregister = hub.addHandler((parsed, rinfo) => {
671
686
  try {
672
687
  // Track any parsed meter telegrams (helps detect filterHost issues)
673
688
  this.lastSeenAny = Date.now();
@@ -683,6 +698,9 @@ class SpeedwireDriver {
683
698
  // ignore
684
699
  }
685
700
  });
701
+ // A hub reference alone is not liveness: an earlier bind or socket error
702
+ // may have closed its receiver. start() is idempotent while really active.
703
+ await hub.start();
686
704
  }
687
705
 
688
706
  async disconnect() {
@@ -700,9 +718,11 @@ class SpeedwireDriver {
700
718
  if (hub) await hub.stopIfUnused();
701
719
  } catch (_) { /* ignore */ }
702
720
 
703
- // Cleanup global map if the hub stopped
721
+ // A failed bind may leave an intentionally retained hub with other users.
722
+ // Remove only this unused, stopped registry entry, never a replacement hub
723
+ // installed while our asynchronous disconnect was finishing.
704
724
  try {
705
- if (key && hub && !hub.socket) _hubByKey.delete(key);
725
+ if (key && hub && !hub.socket && !hub.starting && !hub.handlers.size && _hubByKey.get(key) === hub) _hubByKey.delete(key);
706
726
  } catch (_) { /* ignore */ }
707
727
  }
708
728
 
@@ -168,7 +168,7 @@ test('all 195 templates satisfy the canonical path, type, role and unit contract
168
168
  }
169
169
  }
170
170
 
171
- assert.equal(standardAliasCount, 2463); // 2454 existing + 7 VARTA error codes + 2 temperatures
171
+ assert.equal(standardAliasCount, 2552); // 2463 existing + 89 source-bound read-only semantic aliases
172
172
  assert.deepEqual(Object.fromEntries([...classCounts.entries()].sort()), {
173
173
  battery: 12,
174
174
  batteryInverter: 3,
@@ -0,0 +1,149 @@
1
+ 'use strict';
2
+
3
+ const test = require('node:test');
4
+ const assert = require('node:assert/strict');
5
+ const Module = require('node:module');
6
+ const templates = require('../lib/templates.json').templates;
7
+ const { buildSemanticAliasDefinitions } = require('../lib/deviceAliasSemantics');
8
+
9
+ const originalLoad = Module._load;
10
+ Module._load = function (request, parent, isMain) {
11
+ if (request === 'modbus-serial') return class ModbusRTU {};
12
+ if (request === 'serialport') return { SerialPort: class SerialPort {} };
13
+ if (request === 'mqtt') return { connect() { throw new Error('unexpected device connection'); } };
14
+ if (request === 'axios') return {};
15
+ return originalLoad.call(this, request, parent, isMain);
16
+ };
17
+ let DeviceRuntime;
18
+ let ModbusDriver;
19
+ try {
20
+ DeviceRuntime = require('../lib/deviceRuntime').DeviceRuntime;
21
+ ModbusDriver = require('../lib/drivers/modbus').ModbusDriver;
22
+ } finally { Module._load = originalLoad; }
23
+
24
+ function createRuntime(templateId, protocol = 'modbusTcp', config = {}) {
25
+ const template = templates.find(item => item.id === templateId);
26
+ assert.ok(template);
27
+ const writes = [];
28
+ const adapter = {
29
+ log: { debug() {}, info() {}, warn() {}, error() {} },
30
+ async setStateAsync(id, state) { writes.push({ id, ...state, ts: Date.now() }); },
31
+ };
32
+ const cfg = { id: 'sample', templateId, category: template.category, protocol, connection: {}, ...config };
33
+ const runtime = new DeviceRuntime(adapter, cfg, template, {});
34
+ for (const dp of template.datapoints) runtime.dpById.set(dp.id, dp);
35
+ runtime.aliasDefs = runtime._buildAliasDefinitions();
36
+ runtime._liveAliasRefreshMs = runtime._computeLiveAliasRefreshMs({ fastIntervalMs: 1000 });
37
+ return { runtime, writes, template, adapter, cfg };
38
+ }
39
+
40
+ function lastWrite(writes, suffix) { return writes.findLast(item => item.id.endsWith(suffix)); }
41
+
42
+ test('constant SMA grid samples stay fresh for 30 minutes; cached telegrams, failed polls and counters do not', async t => {
43
+ let now = 100000;
44
+ t.mock.method(Date, 'now', () => now);
45
+ const { runtime, writes } = createRuntime('meter.sma.SmaEnergyMeterSpeedwireImpl', 'speedwire');
46
+ runtime.driver = { lastSeen: now };
47
+ const values = { aCTIVE_POWER: 1.234, aCTIVE_CONSUMPTION_POWER: 1.234, aCTIVE_PRODUCTION_POWER: 0 };
48
+ for (let i = 0; i <= 1800; i++) {
49
+ runtime.driver.lastSeen = now;
50
+ await runtime._updateAliases(values, { connected: true });
51
+ assert.equal(lastWrite(writes, '.aliases.v1.r.power').val, 1234);
52
+ assert.ok(now - lastWrite(writes, '.aliases.v1.r.power').ts < 2000, 'constant measured power must remain current');
53
+ now += 1000;
54
+ }
55
+ const freshAt = lastWrite(writes, '.aliases.v1.r.power').ts;
56
+ now += 30000;
57
+ await runtime._updateAliases(values, { connected: true });
58
+ assert.equal(lastWrite(writes, '.aliases.v1.r.power').ts, freshAt, 'old Speedwire telegram cannot renew measurement');
59
+ await runtime._updateAliases({}, { connected: false, lastError: 'timeout' });
60
+ assert.equal(lastWrite(writes, '.aliases.v1.r.power').ts, freshAt);
61
+ assert.equal(lastWrite(writes, '.aliases.v1.comm.connected').val, false);
62
+ assert.equal(runtime._liveAliasRefreshOptions('devices.sample.aliases.v1.r.energyImport', values, {}, ['aCTIVE_POWER']), undefined);
63
+ });
64
+
65
+ test('FENECON real battery, SOC, PV, converter and grid samples refresh within bound while commands remain change-only', async t => {
66
+ let now = 500000;
67
+ t.mock.method(Date, 'now', () => now);
68
+ const { runtime, writes } = createRuntime('ess.fenecon.FeneconHomeEssImpl');
69
+ const values = { bATTERY_AC_POWER: -2, eSS_SOC_IN: 60, pV_POWER_SUM: 3, pV_DC_POWER: 3, pV_AC_POWER: 0, eSS0_ACTIVE_POWER: 1, gRID_POWER: 0.2 };
70
+ await runtime._updateAliases(values, { connected: true });
71
+ const checks = new Map([
72
+ ['r.power', -2000], ['r.soc', 60], ['r.pvPower', 3000], ['r.pvPowerDc', 3000],
73
+ ['r.pvPowerAc', 0], ['r.essActivePower', 1000], ['r.nvpPower', 200],
74
+ ]);
75
+ const initialCount = writes.length;
76
+ now += 200;
77
+ await runtime._updateAliases(values, { connected: true });
78
+ assert.equal(writes.length, initialCount, 'polls before the refresh bound must not flood unchanged states');
79
+ now += 1000;
80
+ await runtime._updateAliases(values, { connected: true });
81
+ for (const [path, expected] of checks) {
82
+ const state = lastWrite(writes, `.aliases.v1.${path}`);
83
+ assert.equal(state.val, expected, path);
84
+ assert.equal(state.ts, now, path);
85
+ }
86
+ const pvAt = lastWrite(writes, '.aliases.v1.r.pvPowerDc').ts;
87
+ now += 30000;
88
+ await runtime._updateAliases({ eSS_SOC_IN: 60 }, { connected: true });
89
+ assert.equal(lastWrite(writes, '.aliases.v1.r.pvPowerDc').ts, pvAt, 'unrelated SOC sample cannot refresh PV');
90
+ assert.equal(runtime._liveAliasRefreshOptions('devices.sample.aliases.v1.ctrl.powerSetpointW', values, {}, ['eSS0_ACTIVE_POWER']), undefined);
91
+ });
92
+
93
+ test('SolaX applied-target readback refreshes only from actual poll, never write acknowledgement or unrelated packet', async t => {
94
+ let now = 1000000;
95
+ t.mock.method(Date, 'now', () => now);
96
+ const { runtime, writes } = createRuntime('ess.solax.SolaXHybridX1X3Ess');
97
+ await runtime._updateAliases({ sET_ACTIVE_POWER: 900 }, { connected: true });
98
+ const path = '.aliases.v1.r.powerSetpointReadbackW';
99
+ now += 5000;
100
+ await runtime._ackWrittenValue(runtime.dpById.get('sET_ACTIVE_POWER'), 1200);
101
+ assert.equal(lastWrite(writes, path).ts, 1000000);
102
+ assert.equal(lastWrite(writes, path).val, 900);
103
+ await runtime._updateAliases({ bMS1_SOC: 55 }, { connected: true });
104
+ assert.equal(lastWrite(writes, path).ts, 1000000);
105
+ await runtime._updateAliases({ sET_ACTIVE_POWER: 900 }, { connected: true });
106
+ assert.equal(lastWrite(writes, path).ts, now);
107
+ });
108
+
109
+ test('MQTT full caches and diagnostic packets cannot refresh an old source or a partially updated computed alias', async t => {
110
+ let now = 2000000;
111
+ t.mock.method(Date, 'now', () => now);
112
+ const { runtime, writes } = createRuntime('ess.solax.SolaXHybridX1X3Ess', 'mqtt');
113
+ runtime.driver = { updatedAtByDpId: new Map([['bATTERY_POWER', now], ['pV_POWER', now]]) };
114
+ const values = { bATTERY_POWER: 1500, pV_POWER: 500 };
115
+ await runtime._updateAliases(values, { connected: true });
116
+ const powerPath = '.aliases.v1.r.power';
117
+ now += 5000;
118
+ runtime.driver.updatedAtByDpId.set('pV_POWER', now);
119
+ await runtime._updateAliases(values, { connected: true });
120
+ assert.equal(lastWrite(writes, powerPath).ts, 2000000);
121
+ assert.equal(lastWrite(writes, '.aliases.v1.r.pvPowerTotal').ts, now);
122
+ runtime.driver.updatedAtByDpId.set('bATTERY_POWER', now);
123
+ await runtime._updateAliases(values, { connected: true, diagnosticsOnly: true });
124
+ assert.equal(lastWrite(writes, powerPath).ts, 2000000);
125
+ await runtime._updateAliases(values, { connected: true });
126
+ assert.equal(lastWrite(writes, powerPath).ts, now);
127
+ // A composite measurement requires renewed evidence for every source it uses.
128
+ runtime.aliasDefs = [{ relId: 'devices.sample.aliases.v1.r.power', type: 'number', rw: 'ro', kind: 'computed', get: v => v.bATTERY_POWER + v.pV_POWER }];
129
+ await runtime._updateAliases(values, { connected: true });
130
+ const compositeAt = lastWrite(writes, powerPath).ts;
131
+ now += 5000;
132
+ runtime.driver.updatedAtByDpId.set('bATTERY_POWER', now);
133
+ await runtime._updateAliases(values, { connected: true });
134
+ assert.equal(lastWrite(writes, powerPath).ts, compositeAt);
135
+ });
136
+
137
+ test('FENECON 780 controller block / 882 target changes only controller route and retains all verified read aliases', () => {
138
+ const { runtime, template, adapter, cfg } = createRuntime('ess.fenecon.FeneconHomeEssImpl', 'modbusTcp', { feneconCtrlBalancingOffset: -110 });
139
+ const driver = new ModbusDriver(adapter, cfg, template, {});
140
+ const target = template.datapoints.find(dp => dp.id === 'sET_GRID_ACTIVE_POWER');
141
+ assert.equal(driver._addr(target.source.write), 882);
142
+ const before = buildSemanticAliasDefinitions({ baseId: runtime.baseId, template });
143
+ const after = buildSemanticAliasDefinitions({ baseId: runtime.baseId, template, getDpById: id => runtime.dpById.get(id) });
144
+ assert.deepEqual(after.coverage, before.coverage);
145
+ for (const [id, address] of [['eSS0_ACTIVE_POWER', 604], ['gRID_POWER', 315], ['pV_DC_POWER', 339], ['mIN_POWER_SETPOINT', 702]]) {
146
+ assert.equal(driver._addr(runtime.dpById.get(id).source.read), address);
147
+ }
148
+ assert.equal(after.definitions.length, 8);
149
+ });
@@ -0,0 +1,163 @@
1
+ 'use strict';
2
+
3
+ const test = require('node:test');
4
+ const assert = require('node:assert/strict');
5
+ const Module = require('node:module');
6
+ const templates = require('../lib/templates.json').templates;
7
+ const policy = require('../lib/device-alias-semantics-v1.json');
8
+ const { buildSemanticAliasDefinitions } = require('../lib/deviceAliasSemantics');
9
+ const { buildManifest, cloneStandardDefinition } = require('../lib/aliasContract');
10
+
11
+ function loadRuntime() {
12
+ const original = Module._load;
13
+ Module._load = function (request, parent, isMain) {
14
+ if (request === 'modbus-serial') return class ModbusRTU {};
15
+ if (request === 'serialport') return { SerialPort: class SerialPort {} };
16
+ if (request === 'mqtt') return { connect() { throw new Error('unexpected MQTT connection'); } };
17
+ if (request === 'axios') return {};
18
+ return original.call(this, request, parent, isMain);
19
+ };
20
+ try { return require('../lib/deviceRuntime').DeviceRuntime; }
21
+ finally { Module._load = original; }
22
+ }
23
+ const DeviceRuntime = loadRuntime();
24
+
25
+ function runtimeFor(id) {
26
+ const template = templates.find(item => item.id === id);
27
+ assert.ok(template, id);
28
+ const adapter = { log: { debug() {}, info() {}, warn() {}, error() {} } };
29
+ const runtime = new DeviceRuntime(adapter, { id: 'audit', templateId: id, category: template.category, connection: {} }, template, {});
30
+ for (const dp of template.datapoints) runtime.dpById.set(dp.id, dp);
31
+ const defs = runtime._buildAliasDefinitions();
32
+ runtime.aliasDefs = defs;
33
+ return { runtime, template, defs, byPath: new Map(defs.map(def => [def.relId.replace('devices.audit.aliases.', ''), def])) };
34
+ }
35
+
36
+ test('all 195 profiles retain existing aliases; new semantics are additive, source-bound and read-only', () => {
37
+ let additions = 0;
38
+ const coveredProfiles = new Set();
39
+ for (const template of templates) {
40
+ const { runtime, defs, byPath } = runtimeFor(template.id);
41
+ const expected = buildSemanticAliasDefinitions({ baseId: runtime.baseId, template });
42
+ for (const def of expected.definitions) {
43
+ const path = def.relId.replace('devices.audit.aliases.', '');
44
+ const actual = byPath.get(`v1.${path}`);
45
+ assert.ok(actual, `${template.id}: ${path}`);
46
+ assert.equal(actual.rw, 'ro');
47
+ assert.equal(actual.unit, 'W');
48
+ assert.equal(actual.writeDpId, undefined);
49
+ assert.equal(actual.preferCommandValue, undefined);
50
+ assert.equal(byPath.has(path), false, `new canonical alias must not add/replace legacy: ${template.id}/${path}`);
51
+ assert.equal(actual.fromDevice(null), null);
52
+ assert.equal(actual.fromDevice('1'), null);
53
+ assert.equal(actual.fromDevice(NaN), null);
54
+ assert.equal(actual.fromDevice(Infinity), null);
55
+ additions++;
56
+ coveredProfiles.add(template.id);
57
+ }
58
+ // Every pre-existing canonical path is still built from its exact legacy
59
+ // definition, with the same target, access mode and canonical unit conversion.
60
+ const checked = new Set();
61
+ for (const def of defs.filter(item => !item.relId.includes('.aliases.v1.'))) {
62
+ const normal = cloneStandardDefinition(def, { baseId: runtime.baseId, deviceClass: runtime.aliasDeviceClass, getDpById: id => runtime.dpById.get(id) });
63
+ if (!normal || checked.has(normal.relId)) continue;
64
+ checked.add(normal.relId);
65
+ const actual = defs.find(item => item.relId === normal.relId);
66
+ assert.ok(actual, `${template.id}/${normal.relId}`);
67
+ for (const key of ['dpId', 'writeDpId', 'rw', 'type', 'role', 'unit', 'kind']) assert.equal(actual[key], normal[key], `${template.id}/${key}`);
68
+ }
69
+ const manifest = buildManifest(runtime.aliasContractInfo, template, runtime.cfg);
70
+ assert.deepEqual(manifest.semanticCoverage, expected.coverage);
71
+ assert.deepEqual(runtime.aliasContractInfo.missingRequired, []);
72
+ }
73
+ assert.equal(templates.length, 195);
74
+ assert.equal(additions, 89);
75
+ assert.equal(coveredProfiles.size, 25);
76
+ });
77
+
78
+ test('FENECON keeps battery power separate from ESS converter/DC PV and does not fabricate 706 readback', () => {
79
+ const { byPath } = runtimeFor('ess.fenecon.FeneconHomeEssImpl');
80
+ const expected = {
81
+ 'r.essActivePower': 'eSS0_ACTIVE_POWER', 'r.nvpPower': 'gRID_POWER',
82
+ 'r.consumptionTotal': 'lOAD_POWER', 'r.minPowerSetpointW': 'mIN_POWER_SETPOINT',
83
+ 'r.maxPowerSetpointW': 'mAX_POWER_SETPOINT', 'r.pvPowerDc': 'pV_DC_POWER',
84
+ 'r.pvPowerAc': 'pV_AC_POWER', 'r.pvPowerTotal': 'pV_POWER_SUM',
85
+ };
86
+ for (const [path, dpId] of Object.entries(expected)) {
87
+ const def = byPath.get(`v1.${path}`);
88
+ assert.equal(def.dpId, dpId);
89
+ assert.equal(def.fromDevice(2.5), 2500);
90
+ assert.equal(def.fromDevice(-2.5), -2500);
91
+ }
92
+ assert.equal(byPath.has('v1.r.powerSetpointReadbackW'), false);
93
+ assert.equal(byPath.get('v1.ctrl.powerSetpointW').writeDpId, 'sET_ACTIVE_POWER');
94
+ assert.equal(byPath.get('v1.ctrl.gridSetpointW').writeDpId, 'sET_GRID_ACTIVE_POWER');
95
+ });
96
+
97
+ test('both SolaX profiles share W units and signed limits, with genuine readable target and no invented grid target', () => {
98
+ for (const [id, scale] of [['ess.solax.Ems1000ModbusTcp', 1000], ['ess.solax.SolaXHybridX1X3Ess', 1]]) {
99
+ const { byPath } = runtimeFor(id);
100
+ assert.equal(byPath.get('v1.r.minPowerSetpointW').fromDevice(2), -2 * scale);
101
+ assert.equal(byPath.get('v1.r.maxPowerSetpointW').fromDevice(3), 3 * scale);
102
+ assert.equal(byPath.get('v1.r.minPowerSetpointW').fromDevice(-2), null);
103
+ assert.equal(byPath.get('v1.r.maxPowerSetpointW').fromDevice(-2), null);
104
+ assert.equal(byPath.get('v1.r.powerSetpointReadbackW').fromDevice(-4), -4 * scale);
105
+ assert.equal(byPath.get('v1.r.powerSetpointReadbackW').dpId, 'sET_ACTIVE_POWER');
106
+ assert.equal(byPath.has('v1.ctrl.gridSetpointW'), false);
107
+ assert.equal(byPath.has('v1.r.nvpPower'), false, 'unverified grid sign must not become an automatic NVP source');
108
+ assert.equal(byPath.has('v1.r.pvPowerAc'), false);
109
+ assert.equal(byPath.has('v1.r.pvPowerDc'), false);
110
+ }
111
+ });
112
+
113
+ test('readback is actual polling data and cannot acknowledge queued or failed commands', async () => {
114
+ const { runtime } = runtimeFor('ess.solax.Ems1000ModbusTcp');
115
+ const writes = new Map();
116
+ runtime._setStateCached = async (id, value) => writes.set(id, value);
117
+ runtime._lastCommandedValueByDpId.set('sET_ACTIVE_POWER', 9);
118
+ const id = 'devices.audit.aliases.v1.r.powerSetpointReadbackW';
119
+ await runtime._ackWrittenValue(runtime.dpById.get('sET_ACTIVE_POWER'), 9);
120
+ assert.equal(writes.has(id), false, 'write acknowledgement must not synthesize a device readback');
121
+ await runtime._updateAliases({ sET_ACTIVE_POWER: 2 }, { connected: true });
122
+ assert.equal(writes.get(id), 2000);
123
+ writes.clear();
124
+ await runtime._ackWrittenValue(runtime.dpById.get('sET_ACTIVE_POWER'), 8);
125
+ assert.equal(writes.has(id), false);
126
+ await runtime._updateAliases({ sOC: 50 }, { connected: true });
127
+ assert.equal(writes.has(id), false);
128
+ });
129
+
130
+ test('VARTA sign conversion and DEYE MPPT aggregation remain canonical without new control capability', () => {
131
+ const varta = runtimeFor('ess.varta.pulseNeo.modbusTcpV14').byPath;
132
+ assert.equal(varta.get('v1.r.essActivePower').fromDevice(1400), -1400);
133
+ assert.equal(varta.get('v1.r.nvpPower').fromDevice(-900), 900);
134
+ assert.equal(varta.get('v1.r.pvPowerAc').dpId, 'pV_POWER');
135
+ const deye = runtimeFor('ess.deye.threePhaseHv.modbusRtu').byPath;
136
+ assert.equal(deye.get('v1.r.pvPowerDc').dpId, 'canonical.pvPower');
137
+ assert.equal(deye.has('v1.ctrl.powerSetpointW'), false);
138
+ assert.equal(deye.has('v1.r.powerSetpointReadbackW'), false);
139
+ });
140
+
141
+ test('unknown, write-only, missing, remapped and differently scaled sources remain unavailable', () => {
142
+ const original = templates.find(item => item.id === 'ess.solax.SolaXHybridX1X3Ess');
143
+ for (const mutate of [
144
+ t => { t.id = 'custom.storage'; },
145
+ t => { t.datapoints = t.datapoints.filter(dp => dp.id !== 'sET_ACTIVE_POWER'); },
146
+ t => { t.datapoints.find(dp => dp.id === 'sET_ACTIVE_POWER').rw = 'wo'; },
147
+ t => { t.datapoints.find(dp => dp.id === 'sET_ACTIVE_POWER').unit = 'kW'; },
148
+ t => { t.datapoints.find(dp => dp.id === 'sET_ACTIVE_POWER').source.read.address = 999; },
149
+ t => { delete t.datapoints.find(dp => dp.id === 'sET_ACTIVE_POWER').source.read; },
150
+ ]) {
151
+ const template = structuredClone(original);
152
+ mutate(template);
153
+ const result = buildSemanticAliasDefinitions({ baseId: 'devices.custom', template });
154
+ assert.equal(result.coverage['r.powerSetpointReadbackW'].status, 'unavailable');
155
+ assert.equal(result.definitions.some(def => def.relId.endsWith('.powerSetpointReadbackW')), false);
156
+ }
157
+ for (const [id, profile] of Object.entries(policy.profiles)) {
158
+ for (const binding of Object.values(profile)) assert.ok(binding.source, `${id}/${binding.dpId}`);
159
+ }
160
+ const fox = runtimeFor('ess.foxess.FoxESSH3Ess').byPath;
161
+ assert.equal(fox.has('v1.r.minPowerSetpointW'), false, 'assumed FoxESS direction is not a verified signed bound');
162
+ assert.equal(fox.has('v1.r.maxPowerSetpointW'), false);
163
+ });