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.
- package/NEXOWATT_EOS_BUILD_INFO.json +11 -14
- package/README.md +7 -3
- package/START_HIER_9.0.18.md +47 -0
- package/START_HIER_9.0.19.md +52 -0
- package/adminWww/.vite/manifest.json +114 -114
- package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +13759 -13759
- package/adminWww/assets/{AdapterUpdateDialog-Cpo3dAfY.js → AdapterUpdateDialog-JOf2z4Vg.js} +1 -1
- package/adminWww/assets/{Adapters-n2ukPDdC.js → Adapters-C9fcSdWm.js} +1 -1
- package/adminWww/assets/{ConfigManager-BVZ6_Ebo.js → ConfigManager-BeeLlT6D.js} +1 -1
- package/adminWww/assets/{Enums-CQ6yHG2W.js → Enums-FqnXWl8U.js} +1 -1
- package/adminWww/assets/{Fields-CaJqzoW-.js → Fields-DMgrt5Pi.js} +1 -1
- package/adminWww/assets/{Files-DfvpKGa3.js → Files-CIHtt12g.js} +1 -1
- package/adminWww/assets/{Hosts-3xLBsdG6.js → Hosts-fPLBzvTy.js} +1 -1
- package/adminWww/assets/{Instances-B7hKEhyw.js → Instances-4XaVQlrT.js} +1 -1
- package/adminWww/assets/{Intro-BV4kYZdT.js → Intro-5TKriiLO.js} +1 -1
- package/adminWww/assets/{Logs-DpL9eY69.js → Logs-33zcIds-.js} +1 -1
- package/adminWww/assets/{Objects-dN06jhQk.js → Objects-CNQPVbNG.js} +1 -1
- package/adminWww/assets/{Overview-Lip63_ej.js → Overview-BskXGOc8.js} +1 -1
- package/adminWww/assets/{State-BSO2X_xN.js → State-C8SJ_Iqo.js} +1 -1
- package/adminWww/assets/{UsedResources-DvqzszKI.js → UsedResources-CgqRa9ei.js} +1 -1
- package/adminWww/assets/{Users-Csqd1xA-.js → Users-0JVYWR9u.js} +1 -1
- package/adminWww/assets/{bootstrap-C3HM8kNL.js → bootstrap-D16lu6rd.js} +3 -3
- package/adminWww/assets/{hostInit-DdxBUeXQ.js → hostInit-C8YZJuzi.js} +1 -1
- package/adminWww/assets/{icons-material-D1Tb_725.js → icons-material-CiNJ_6Ur.js} +1 -1
- package/adminWww/assets/{index-BOujTMyH.js → index-DA9Sphgh.js} +2 -2
- package/adminWww/assets/{installSVGRenderer-BZyrUVAo.js → installSVGRenderer-DPdkRa_d.js} +1 -1
- package/adminWww/assets/{mf-entry-bootstrap-0-3418586b.js → mf-entry-bootstrap-0-a7ab91de.js} +2 -2
- package/adminWww/index.html +23 -23
- package/adminWww/mf-manifest.json +1 -1
- package/adminWww/mf-stats.json +1 -1
- package/adminWww/{remoteEntry-eos-9.0.17.js → remoteEntry-eos-9.0.19.js} +1 -1
- package/adminWww/remoteEntry.js +1 -1
- package/build/lib/eosCookieNamespace.js +12 -2
- package/build/lib/eosCookieNamespace.js.map +1 -1
- package/build/lib/eosDeviceEmsPlan.js +1147 -0
- package/build/lib/eosDeviceEmsPlan.js.map +1 -0
- package/build/lib/eosDeviceEmsService.js +473 -0
- package/build/lib/eosDeviceEmsService.js.map +1 -0
- package/build/lib/eosModuleHost.js +227 -51
- package/build/lib/eosModuleHost.js.map +1 -1
- package/build/lib/eosModuleHttp.js +1 -1
- package/build/lib/eosModuleHttp.js.map +1 -1
- package/build/lib/web.js +31 -0
- package/build/lib/web.js.map +1 -1
- package/docs/reports/unified-9.0.18/ALIAS_V1_COVERAGE.json +5056 -0
- package/docs/reports/unified-9.0.18/ALIAS_V1_VERTRAG.md +257 -0
- package/docs/reports/unified-9.0.18/ANFORDERUNGEN.md +55 -0
- package/docs/reports/unified-9.0.18/CUSTOMER_TARIFF_REVIEW.md +33 -0
- package/docs/reports/unified-9.0.18/GERAETE_EMS_EINRICHTUNG.md +86 -0
- package/docs/reports/unified-9.0.18/INSTALLER_LIFECYCLE_REVIEW.md +29 -0
- package/docs/reports/unified-9.0.18/KUNDENTARIF_EINRICHTUNG.md +27 -0
- package/docs/reports/unified-9.0.18/PRUEFBERICHT.md +87 -0
- package/docs/reports/unified-9.0.18/UNABHAENGIGER_REVIEW.md +63 -0
- package/docs/reports/unified-9.0.18/raw/INDEX.json +331 -0
- package/docs/reports/unified-9.0.18/raw/audit-full.log +345 -0
- package/docs/reports/unified-9.0.18/raw/audit-full.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/audit-runtime.log +23 -0
- package/docs/reports/unified-9.0.18/raw/audit-runtime.result.json +15 -0
- package/docs/reports/unified-9.0.18/raw/backend-final.log +5 -0
- package/docs/reports/unified-9.0.18/raw/backend-final.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/frontend-build.log +152 -0
- package/docs/reports/unified-9.0.18/raw/frontend-build.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/installer-build.log +26 -0
- package/docs/reports/unified-9.0.18/raw/installer-build.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/keygen-source.json +6 -0
- package/docs/reports/unified-9.0.18/raw/lint-final.log +5 -0
- package/docs/reports/unified-9.0.18/raw/lint-final.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/modules-build.log +5 -0
- package/docs/reports/unified-9.0.18/raw/modules-build.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/node22-tests-final.log +9859 -0
- package/docs/reports/unified-9.0.18/raw/node22-tests-final.result.json +13 -0
- package/docs/reports/unified-9.0.18/raw/node22-typecheck-final.log +7 -0
- package/docs/reports/unified-9.0.18/raw/node22-typecheck-final.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/node22-version.log +1 -0
- package/docs/reports/unified-9.0.18/raw/node24-tests-final.log +1663 -0
- package/docs/reports/unified-9.0.18/raw/node24-tests-final.result.json +13 -0
- package/docs/reports/unified-9.0.18/raw/node24-typecheck-final.log +5 -0
- package/docs/reports/unified-9.0.18/raw/node24-typecheck-final.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/node24-version.log +1 -0
- package/docs/reports/unified-9.0.18/raw/sbom-runtime.log +7 -0
- package/docs/reports/unified-9.0.18/raw/sbom-runtime.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/sbom-vendor-check.log +1 -0
- package/docs/reports/unified-9.0.18/raw/sbom-vendor-check.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/ui-docs-check.log +6 -0
- package/docs/reports/unified-9.0.18/raw/ui-docs-check.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/ui-runtime-final.log +7 -0
- package/docs/reports/unified-9.0.18/raw/ui-runtime-final.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/ui-runtime-sync.log +6 -0
- package/docs/reports/unified-9.0.18/raw/ui-runtime-sync.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/ui-sbom-check.log +6 -0
- package/docs/reports/unified-9.0.18/raw/ui-sbom-check.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/ui-sbom-final.log +14 -0
- package/docs/reports/unified-9.0.18/raw/ui-sbom-final.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/ui-secret-final.log +6 -0
- package/docs/reports/unified-9.0.18/raw/ui-secret-final.result.json +14 -0
- package/docs/reports/unified-9.0.18/raw/ui-security-final.log +8 -0
- package/docs/reports/unified-9.0.18/raw/ui-security-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/ALIAS_MESSWERTFRISCHE.md +31 -0
- package/docs/reports/unified-9.0.19/COMMISSIONING_PLAN_REVIEW.md +56 -0
- package/docs/reports/unified-9.0.19/EMS_ABSCHLUSSREVIEW.md +43 -0
- package/docs/reports/unified-9.0.19/EMS_KATEGORIEN_ABDECKUNG.md +66 -0
- package/docs/reports/unified-9.0.19/EMS_VERGLEICH_UND_KOPPLUNG.md +25 -0
- package/docs/reports/unified-9.0.19/EVCS_STATE_OBJECTS.md +47 -0
- package/docs/reports/unified-9.0.19/GERAETE_EMS_EINRICHTUNG.md +100 -0
- package/docs/reports/unified-9.0.19/GERAETE_STARTAUSFALL.md +37 -0
- package/docs/reports/unified-9.0.19/INSTALLER_LIFECYCLE_REVIEW.md +59 -0
- package/docs/reports/unified-9.0.19/LEGACY_REGRESSION_REVIEW.md +42 -0
- package/docs/reports/unified-9.0.19/MODBUS_AUTHORIZATION_READS.md +25 -0
- package/docs/reports/unified-9.0.19/PRUEFBERICHT.md +56 -0
- package/docs/reports/unified-9.0.19/RUNTIME_START_UEBERNAHME.md +33 -0
- package/docs/reports/unified-9.0.19/SMA_RECEIVER_LIFECYCLE.md +42 -0
- package/docs/reports/unified-9.0.19/STATIC_REVIEW_DE.md +11 -0
- package/docs/reports/unified-9.0.19/TARIFF_PRICE_VALUES_REVIEW.md +31 -0
- package/docs/reports/unified-9.0.19/TARIF_VIERTELSTUNDEN_RUNTIME.md +17 -0
- package/docs/reports/unified-9.0.19/UNABHAENGIGER_REVIEW.md +49 -0
- package/docs/reports/unified-9.0.19/raw/INDEX.json +751 -0
- package/docs/reports/unified-9.0.19/raw/audit-full.log +345 -0
- package/docs/reports/unified-9.0.19/raw/audit-full.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/audit-runtime.log +23 -0
- package/docs/reports/unified-9.0.19/raw/audit-runtime.result.json +15 -0
- package/docs/reports/unified-9.0.19/raw/backend-final.log +5 -0
- package/docs/reports/unified-9.0.19/raw/backend-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/devices-hosted-typecheck-node22.log +0 -0
- package/docs/reports/unified-9.0.19/raw/devices-hosted-typecheck-node22.result.json +15 -0
- package/docs/reports/unified-9.0.19/raw/devices-hosted-typecheck-node24.log +0 -0
- package/docs/reports/unified-9.0.19/raw/devices-hosted-typecheck-node24.result.json +15 -0
- package/docs/reports/unified-9.0.19/raw/devices-incident-build.log +5 -0
- package/docs/reports/unified-9.0.19/raw/devices-incident-host-final.log +70 -0
- package/docs/reports/unified-9.0.19/raw/devices-incident-lease-918-before.log +26 -0
- package/docs/reports/unified-9.0.19/raw/devices-incident-lease-after.log +9 -0
- package/docs/reports/unified-9.0.19/raw/devices-incident-metadata-after.log +11 -0
- package/docs/reports/unified-9.0.19/raw/devices-incident-metadata-before.log +28 -0
- package/docs/reports/unified-9.0.19/raw/devices-incident-web-pipeline.log +22 -0
- package/docs/reports/unified-9.0.19/raw/frontend-build.log +152 -0
- package/docs/reports/unified-9.0.19/raw/frontend-build.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/installer-build.log +26 -0
- package/docs/reports/unified-9.0.19/raw/installer-build.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/keygen-source.json +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-auto-pv.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-auto-pv.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-charging-grid-cap-clamp.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-charging-grid-cap-clamp.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-charging-grid-cap-safe.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-charging-grid-cap-safe.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-charging-mode-recovery.log +539 -0
- package/docs/reports/unified-9.0.19/raw/legacy-charging-mode-recovery.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-core-limits-phase1.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-core-limits-phase1.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-core-limits-phase2.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-core-limits-phase2.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-core-limits-tariff-final.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-core-limits-tariff-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-energy-wallet-final.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-energy-wallet-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-farm-dispatch-loader-current.log +2 -0
- package/docs/reports/unified-9.0.19/raw/legacy-farm-dispatch-loader-current.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-final-write-envelope.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-final-write-envelope.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-history-http.log +39 -0
- package/docs/reports/unified-9.0.19/raw/legacy-history-http.result.json +15 -0
- package/docs/reports/unified-9.0.19/raw/legacy-import-grid-budget.log +30 -0
- package/docs/reports/unified-9.0.19/raw/legacy-import-grid-budget.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-import-grid-contract-current.log +2 -0
- package/docs/reports/unified-9.0.19/raw/legacy-import-grid-contract-current.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-live-mode-loader-current.log +203 -0
- package/docs/reports/unified-9.0.19/raw/legacy-live-mode-loader-current.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-load-grid-sanity.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-load-grid-sanity.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-ocpp-stability.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-ocpp-stability.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-ocpp21-storage-safety.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-ocpp21-storage-safety.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-permanent-grid-protection.log +18 -0
- package/docs/reports/unified-9.0.19/raw/legacy-permanent-grid-protection.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-dp-persistence.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-dp-persistence.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-farm-dispatch-recovery.log +16 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-farm-dispatch-recovery.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-functional-safety.log +6 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-functional-safety.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-topology-loader-current.log +2 -0
- package/docs/reports/unified-9.0.19/raw/legacy-storage-topology-loader-current.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/legacy-test-loader.cjs +47 -0
- package/docs/reports/unified-9.0.19/raw/lint-final.log +16 -0
- package/docs/reports/unified-9.0.19/raw/lint-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/modules-build.log +5 -0
- package/docs/reports/unified-9.0.19/raw/modules-build.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/node22-tests-final.log +10719 -0
- package/docs/reports/unified-9.0.19/raw/node22-tests-final.result.json +13 -0
- package/docs/reports/unified-9.0.19/raw/node22-typecheck-final.log +7 -0
- package/docs/reports/unified-9.0.19/raw/node22-typecheck-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/node22-version.log +1 -0
- package/docs/reports/unified-9.0.19/raw/node24-tests-final.log +1805 -0
- package/docs/reports/unified-9.0.19/raw/node24-tests-final.result.json +13 -0
- package/docs/reports/unified-9.0.19/raw/node24-typecheck-final.log +5 -0
- package/docs/reports/unified-9.0.19/raw/node24-typecheck-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/node24-version.log +1 -0
- package/docs/reports/unified-9.0.19/raw/sbom-runtime.log +7 -0
- package/docs/reports/unified-9.0.19/raw/sbom-runtime.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/sbom-vendor-check.log +1 -0
- package/docs/reports/unified-9.0.19/raw/sbom-vendor-check.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/tariff-price-chain-919.log +11 -0
- package/docs/reports/unified-9.0.19/raw/tariff-price-chain-919.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/tariff-price-chain-old-918.log +68 -0
- package/docs/reports/unified-9.0.19/raw/tariff-price-chain-old-918.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/ui-docs-check.log +6 -0
- package/docs/reports/unified-9.0.19/raw/ui-docs-check.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/ui-runtime-final.log +7 -0
- package/docs/reports/unified-9.0.19/raw/ui-runtime-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/ui-runtime-sync.log +6 -0
- package/docs/reports/unified-9.0.19/raw/ui-runtime-sync.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/ui-sbom-check.log +6 -0
- package/docs/reports/unified-9.0.19/raw/ui-sbom-check.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/ui-sbom-final.log +6 -0
- package/docs/reports/unified-9.0.19/raw/ui-sbom-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/ui-secret-final.log +6 -0
- package/docs/reports/unified-9.0.19/raw/ui-secret-final.result.json +14 -0
- package/docs/reports/unified-9.0.19/raw/ui-security-final.log +8 -0
- package/docs/reports/unified-9.0.19/raw/ui-security-final.result.json +14 -0
- package/io-package.json +12 -12
- package/modules/devices/admin/alias-contract-v1.json +189 -0
- package/modules/devices/admin/ems-assignment.d.ts +16 -0
- package/modules/devices/admin/ems-assignment.js +356 -0
- package/modules/devices/admin/host-bridge.js +76 -4
- package/modules/devices/admin/index.html +40 -1
- package/modules/devices/admin/index_m.js +158 -2
- package/modules/devices/admin/style.css +32 -4
- package/modules/devices/checks/emsAssignment.check.js +132 -0
- package/modules/devices/contracts.d.ts +1 -1
- package/modules/devices/eslint.hosted.config.mjs +1 -1
- package/modules/devices/index.js +64 -16
- package/modules/devices/lib/alias-contract-v1.json +189 -0
- package/modules/devices/lib/aliasContract.js +7 -1
- package/modules/devices/lib/device-alias-semantics-v1.json +1605 -0
- package/modules/devices/lib/deviceAliasFreshness.js +65 -0
- package/modules/devices/lib/deviceAliasSemantics.js +109 -0
- package/modules/devices/lib/deviceRuntime.js +204 -127
- package/modules/devices/lib/drivers/modbus.js +18 -3
- package/modules/devices/lib/drivers/speedwire.js +42 -22
- package/modules/devices/test/aliasContractV1.test.js +1 -1
- package/modules/devices/test/deviceAliasFreshness.test.js +149 -0
- package/modules/devices/test/deviceAliasSemantics.test.js +163 -0
- package/modules/devices/test/emsAssignmentUi.test.js +298 -0
- package/modules/devices/test/modbusAuthorizationReads.test.js +112 -0
- package/modules/devices/test/runtimeLiveness.test.js +1 -1
- package/modules/devices/test/speedwireLifecycle.test.js +118 -0
- package/modules/devices/tsconfig.alias-semantics.json +17 -0
- package/modules/devices/tsconfig.ems-ui.json +9 -0
- package/modules/devices/tsconfig.hosted.json +1 -1
- package/package.json +11 -7
- package/release-manifests/unified/build-environment.cdx.json +1483 -7370
- package/release-manifests/unified/files.json +392 -121
- package/release-manifests/unified/frontend.cdx.json +2688 -5952
- package/release-manifests/unified/installer.cdx.json +2053 -821
- package/release-manifests/unified/obsolete-admin-assets.json +172 -6
- package/release-manifests/unified/runtime.cdx.json +40 -3283
- package/release-manifests/unified/validation.json +15 -15
- package/tools/eos-release-check.cjs +1 -1
- package/tools/eos-release-manifest.cjs +5 -5
- package/ui/docs/security/eslint-reviewed-findings.json +32 -18
- package/ui/ems/datapoints.js +22 -1
- package/ui/ems/engine.js +54 -7
- package/ui/ems/module-manager.js +44 -21
- package/ui/ems/modules/core-limits.js +5 -3
- package/ui/ems/modules/energy-wallet.js +31 -32
- package/ui/ems/modules/storage-control.js +5 -4
- package/ui/ems/modules/tarif-vis.js +36 -24
- package/ui/ems/modules/tariff-provider.js +259 -59
- package/ui/ems/services/tariff-provider-registry.js +11 -8
- package/ui/io-package.json +5 -1
- package/ui/lib/customer-tariff.js +245 -0
- package/ui/lib/installer-lifecycle.js +220 -0
- package/ui/lib/storage-farm-overview.js +115 -0
- package/ui/lib/tariff-price.js +115 -0
- package/ui/main.js +400 -163
- package/ui/package.json +14 -4
- package/ui/www/app.js +47 -134
- package/ui/www/customer-tariff.css +21 -0
- package/ui/www/customer-tariff.js +333 -0
- package/ui/www/ems-apps.html +2 -0
- package/ui/www/ems-apps.js +29 -7
- package/ui/www/index.html +2 -0
- package/ui/www/licenses/smarthome-markdown-components.json +156 -156
- package/ui/www/manifest.webmanifest +2 -2
- package/ui/www/power-measurements.js +62 -0
- package/ui/www/settings.html +47 -0
- package/ui/www/storagefarm-summary.css +17 -0
- package/ui/www/storagefarm-summary.js +136 -0
- package/ui/www/storagefarm.html +16 -1
- package/ui/www/storagefarm.js +10 -22
- package/ui/www/tariff-display.js +161 -0
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 NexoWatt. All rights reserved.
|
|
3
|
+
* Confidential and Proprietary.
|
|
4
|
+
* Use, modification or distribution without express written permission is prohibited.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
|
+
*
|
|
9
|
+
* Quelle: src-ts/runtime-executables/lib/customer-tariff.ts
|
|
10
|
+
* Quell-Hash: sha256:5db65b97227afa18549301a412a220aa573ada0e57bfb766424bde7d611b3683
|
|
11
|
+
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
|
+
*
|
|
13
|
+
* Zweck:
|
|
14
|
+
* Diese JavaScript-Datei ist das ausführbare Build-Artefakt für lib/customer-tariff.js.
|
|
15
|
+
* Die fachliche Bearbeitung erfolgt ab 0.7.131 in der TypeScript-Quelle.
|
|
16
|
+
* Ab 0.7.132 sind doppelte Legacy-JS-Bäume wie .nwcore entfernt.
|
|
17
|
+
*
|
|
18
|
+
* Pflege-Regel:
|
|
19
|
+
* 1. Änderung zuerst in src-ts/runtime-executables/ vornehmen.
|
|
20
|
+
* 2. npm run sync:ts-runtime-executables ausführen.
|
|
21
|
+
* 3. npm run test:runtime-executables prüfen.
|
|
22
|
+
*/
|
|
23
|
+
"use strict";
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.customerTariffView = customerTariffView;
|
|
26
|
+
exports.prepareCustomerTariffChange = prepareCustomerTariffChange;
|
|
27
|
+
/**
|
|
28
|
+
* NexoWatt Quellcode-Erklärung (DE)
|
|
29
|
+
* Aufgabe: Begrenzt Kundeneinstellungen auf den gemeinsamen Anlagentarif.
|
|
30
|
+
* Daten und Wirkung: Anbieter aus fester Liste, bekannte HTTPS-Endpunkte und
|
|
31
|
+
* begrenzte Vertragswerte. Zugangsdaten werden nur angenommen, nie ausgegeben.
|
|
32
|
+
* Ein Anbieterwechsel übernimmt keine fremden Provider-Zugangsdaten; bisherige
|
|
33
|
+
* Werte bleiben ausschließlich im geschützten Konfigurationsstate erhalten.
|
|
34
|
+
* Zusammenhang: Der Aufrufer prüft Sitzung, CSRF, Lizenz und AppCenter-Revision.
|
|
35
|
+
* Bei Änderungen: Fremdfelder, URLs, alte Revisionen, geheime Daten und die
|
|
36
|
+
* ausdrückliche Zustimmung zur Zuordnung der vier Tarif-Lesepunkte prüfen.
|
|
37
|
+
*/
|
|
38
|
+
const http_error_boundary_1 = require("./http-error-boundary");
|
|
39
|
+
const PROVIDERS = ['manual-dp', 'tibber', 'energyzero', 'entsoe', 'market-profile'];
|
|
40
|
+
const ENDPOINTS = Object.freeze({
|
|
41
|
+
tibber: 'https://api.tibber.com/v1-beta/gql',
|
|
42
|
+
energyzero: 'https://public.api.energyzero.nl/public/v1/prices',
|
|
43
|
+
entsoe: 'https://web-api.tp.entsoe.eu/api',
|
|
44
|
+
});
|
|
45
|
+
const PRICE_KEYS = ['priceCurrent', 'priceAverage', 'priceTodayJson', 'priceTomorrowJson'];
|
|
46
|
+
const PRICE_SUFFIXES = new Map([['priceCurrent', 'currentPriceEurPerKwh'], ['priceAverage', 'averagePriceEurPerKwh'], ['priceTodayJson', 'pricesTodayJson'], ['priceTomorrowJson', 'pricesTomorrowJson']]);
|
|
47
|
+
const FORMULA_DEFAULTS = { marketMultiplier: 1, supplierMarkupEurPerKwh: 0, gridVariableEurPerKwh: 0, taxEurPerKwh: 0, otherVariableEurPerKwh: 0, vatPct: 0, priceIncludesVat: true };
|
|
48
|
+
const RESERVED_CREDENTIAL_INPUTS = new Set(['__KEEP__']);
|
|
49
|
+
const FIELDS = new Set(['enabled', 'providerId', 'sourceId', 'providerProfileId', 'country', 'homeId', 'priceComponent', 'formula', 'credentials', 'useForTariff']);
|
|
50
|
+
function rec(value) { return value !== null && typeof value === 'object' && !Array.isArray(value) ? value : {}; }
|
|
51
|
+
function copy(value) { return JSON.parse(JSON.stringify(value)); }
|
|
52
|
+
function invalid(message) { throw (0, http_error_boundary_1.createPublicHttpError)(422, 'EOS_TARIFF_INVALID', message); }
|
|
53
|
+
function text(value, limit) {
|
|
54
|
+
if (typeof value !== 'string' || value.length > limit || /[\u0000-\u001f\u007f]/u.test(value))
|
|
55
|
+
invalid('Ein Tariftext oder Zugangswert ist ungültig.');
|
|
56
|
+
return value.trim();
|
|
57
|
+
}
|
|
58
|
+
function own(value, key) { return Object.hasOwn(value, key); }
|
|
59
|
+
function storedText(value, fallback) { return typeof value === 'string' && value.length <= 256 ? value : fallback; }
|
|
60
|
+
function source(provider) { return provider.providerId === 'market-profile' ? storedText(provider.sourceId, provider.country === 'NL' ? 'energyzero' : 'entsoe') : storedText(provider.providerId, 'manual-dp'); }
|
|
61
|
+
function knownEndpoint(provider) { const expected = Reflect.get(ENDPOINTS, source(provider)); return typeof expected === 'string' && (!provider.endpoint || provider.endpoint === expected); }
|
|
62
|
+
function managedPoints(namespace) {
|
|
63
|
+
if (!/^(?:eos-admin|nexowatt-ui)\.\d+$/.test(namespace))
|
|
64
|
+
invalid('Der Tarifbereich ist nicht verfügbar.');
|
|
65
|
+
return Object.fromEntries([...PRICE_SUFFIXES].map(([key, suffix]) => [key, `${namespace}.tariffProvider.${suffix}`]));
|
|
66
|
+
}
|
|
67
|
+
function formulaView(value) {
|
|
68
|
+
const candidate = rec(value);
|
|
69
|
+
return Object.fromEntries(Object.entries(FORMULA_DEFAULTS).map(([key, fallback]) => {
|
|
70
|
+
const raw = Reflect.get(candidate, key);
|
|
71
|
+
return [key, typeof fallback === 'boolean' ? (typeof raw === 'boolean' ? raw : fallback) : (typeof raw === 'number' && Number.isFinite(raw) ? raw : fallback)];
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
function useForTariff(root, namespace) {
|
|
75
|
+
const points = rec(root.datapoints);
|
|
76
|
+
const expected = managedPoints(namespace);
|
|
77
|
+
return PRICE_KEYS.every(key => Reflect.get(points, key) === Reflect.get(expected, key));
|
|
78
|
+
}
|
|
79
|
+
/** Ausschließlich freigegebene Anzeige-Daten; keine internen URLs oder Geheimnisse. */
|
|
80
|
+
function customerTariffView(root, namespace, registry, snapshot) {
|
|
81
|
+
const provider = rec(root.tariffProvider);
|
|
82
|
+
const credentials = rec(provider.credentials);
|
|
83
|
+
const providerId = storedText(provider.providerId, 'manual-dp');
|
|
84
|
+
const resolved = source(provider);
|
|
85
|
+
const current = rec(snapshot);
|
|
86
|
+
const matchesCurrent = current.providerId === providerId && current.sourceId === storedText(provider.sourceId, providerId);
|
|
87
|
+
let state = 'unknown';
|
|
88
|
+
if (provider.enabled !== true || providerId === 'manual-dp')
|
|
89
|
+
state = 'disabled';
|
|
90
|
+
else if (matchesCurrent) {
|
|
91
|
+
state = current.fresh === true ? 'ready' : (current.status === 'error' || current.error ? 'error' : 'pending');
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
scope: 'system',
|
|
95
|
+
config: { enabled: provider.enabled === true, providerId, sourceId: storedText(provider.sourceId, resolved),
|
|
96
|
+
providerProfileId: storedText(provider.providerProfileId, 'local-provider'), country: provider.country === 'NL' ? 'NL' : 'DE',
|
|
97
|
+
homeId: typeof provider.homeId === 'string' ? provider.homeId.slice(0, 128) : '',
|
|
98
|
+
priceComponent: storedText(provider.priceComponent, resolved === 'energyzero' ? 'allInPriceIncludingVat' : 'total'),
|
|
99
|
+
formula: formulaView(provider.formula), useForTariff: useForTariff(root, namespace) },
|
|
100
|
+
credentialsPresent: { accessToken: resolved === 'tibber' && knownEndpoint(provider) && typeof credentials.accessToken === 'string' && credentials.accessToken.length > 0,
|
|
101
|
+
securityToken: resolved === 'entsoe' && knownEndpoint(provider) && typeof credentials.securityToken === 'string' && credentials.securityToken.length > 0 },
|
|
102
|
+
providers: (Array.isArray(registry.providers) ? registry.providers : [])
|
|
103
|
+
.filter(row => PROVIDERS.includes(rec(row).id))
|
|
104
|
+
.map(row => rec(row).id === 'market-profile' ? { ...rec(row), name: 'Anbieterprofil mit Marktpreisquelle', directApi: false,
|
|
105
|
+
description: 'ENTSO-E oder EnergyZero mit Vertragsbestandteilen; kein direkter API-Zugang zum genannten Anbieter.' } : rec(row)),
|
|
106
|
+
profiles: Array.isArray(registry.profiles) ? registry.profiles : [],
|
|
107
|
+
configuredExternally: !PROVIDERS.includes(providerId) || (providerId !== 'manual-dp' && !knownEndpoint(provider)),
|
|
108
|
+
status: { state, ...(matchesCurrent && typeof current.ts === 'number' && Number.isFinite(current.ts) ? { lastUpdate: current.ts } : {}) },
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/** Pure targeted patch: no app-enable flag, limits, arbitrary mappings, endpoint or script input. */
|
|
112
|
+
function prepareCustomerTariffChange(root, incoming, namespace, registry) {
|
|
113
|
+
if (incoming === null || typeof incoming !== 'object' || Array.isArray(incoming))
|
|
114
|
+
invalid('Die Tarifeinstellungen sind ungültig.');
|
|
115
|
+
const submitted = rec(incoming);
|
|
116
|
+
for (const key of Object.keys(submitted))
|
|
117
|
+
if (!FIELDS.has(key))
|
|
118
|
+
invalid('Die Anfrage enthält Einstellungen außerhalb des Kundentarifs.');
|
|
119
|
+
const previous = rec(root.tariffProvider);
|
|
120
|
+
const next = copy(previous);
|
|
121
|
+
const providerId = own(submitted, 'providerId') ? text(submitted.providerId, 32) : storedText(previous.providerId, 'manual-dp');
|
|
122
|
+
if (!PROVIDERS.includes(providerId))
|
|
123
|
+
invalid('Dieser Anschluss wird vom Installateur verwaltet. Bitte einen angebotenen Anbieter wählen.');
|
|
124
|
+
next.providerId = providerId;
|
|
125
|
+
// Explicit customer saves request Tibber's actual quarter-hour data, independently
|
|
126
|
+
// of a legacy hourly setting. Other provider contracts remain unchanged.
|
|
127
|
+
if (providerId === 'tibber')
|
|
128
|
+
next.resolutionMinutes = 15;
|
|
129
|
+
if (own(submitted, 'enabled') && typeof submitted.enabled !== 'boolean')
|
|
130
|
+
invalid('Die Tarifaktivierung ist ungültig.');
|
|
131
|
+
next.enabled = own(submitted, 'enabled') ? submitted.enabled : previous.enabled === true;
|
|
132
|
+
const country = own(submitted, 'country') ? text(submitted.country, 2) : previous.country === 'NL' ? 'NL' : 'DE';
|
|
133
|
+
if (!['DE', 'NL'].includes(country))
|
|
134
|
+
invalid('Als Tarifland sind Deutschland und die Niederlande verfügbar.');
|
|
135
|
+
next.country = country;
|
|
136
|
+
next.timeZone = country === 'NL' ? 'Europe/Amsterdam' : 'Europe/Berlin';
|
|
137
|
+
const requestedSource = own(submitted, 'sourceId') ? text(submitted.sourceId, 32) : (previous.providerId === 'market-profile' ? storedText(previous.sourceId, country === 'NL' ? 'energyzero' : 'entsoe') : (country === 'NL' ? 'energyzero' : 'entsoe'));
|
|
138
|
+
if (providerId === 'market-profile' && !['entsoe', 'energyzero'].includes(requestedSource))
|
|
139
|
+
invalid('Für Anbieterprofile bitte ENTSO-E oder EnergyZero wählen.');
|
|
140
|
+
if (providerId !== 'market-profile' && own(submitted, 'sourceId') && requestedSource !== providerId)
|
|
141
|
+
invalid('Die Preisquelle passt nicht zum ausgewählten Anbieter.');
|
|
142
|
+
next.sourceId = providerId === 'market-profile' ? requestedSource : providerId;
|
|
143
|
+
const resolved = source(next);
|
|
144
|
+
if (resolved === 'energyzero' && country !== 'NL')
|
|
145
|
+
invalid('EnergyZero ist für das Tarifland Niederlande vorgesehen.');
|
|
146
|
+
if (own(submitted, 'providerProfileId')) {
|
|
147
|
+
const id = text(submitted.providerProfileId, 64);
|
|
148
|
+
if (!(Array.isArray(registry.profiles) ? registry.profiles : []).some(row => rec(row).id === id))
|
|
149
|
+
invalid('Das Anbieterprofil ist unbekannt.');
|
|
150
|
+
next.providerProfileId = id;
|
|
151
|
+
}
|
|
152
|
+
else if (!next.providerProfileId)
|
|
153
|
+
next.providerProfileId = 'local-provider';
|
|
154
|
+
if (own(submitted, 'homeId'))
|
|
155
|
+
next.homeId = text(submitted.homeId, 128);
|
|
156
|
+
if (own(submitted, 'priceComponent')) {
|
|
157
|
+
const component = text(submitted.priceComponent, 40);
|
|
158
|
+
if (!['total', 'allInPriceIncludingVat', 'basePriceIncludingVat', 'market'].includes(component))
|
|
159
|
+
invalid('Die Preiskomponente ist ungültig.');
|
|
160
|
+
next.priceComponent = component;
|
|
161
|
+
}
|
|
162
|
+
else if (source(previous) !== resolved || !next.priceComponent)
|
|
163
|
+
next.priceComponent = resolved === 'energyzero' ? 'allInPriceIncludingVat' : 'total';
|
|
164
|
+
if (own(submitted, 'formula')) {
|
|
165
|
+
if (submitted.formula === null || typeof submitted.formula !== 'object' || Array.isArray(submitted.formula))
|
|
166
|
+
invalid('Die Preisbestandteile sind ungültig.');
|
|
167
|
+
const formula = { ...rec(previous.formula) };
|
|
168
|
+
for (const [key, value] of Object.entries(rec(submitted.formula))) {
|
|
169
|
+
if (!own(FORMULA_DEFAULTS, key))
|
|
170
|
+
invalid('Ein Preisbestandteil ist unbekannt.');
|
|
171
|
+
if (key === 'priceIncludesVat') {
|
|
172
|
+
if (typeof value !== 'boolean')
|
|
173
|
+
invalid('Die Mehrwertsteuerangabe ist ungültig.');
|
|
174
|
+
}
|
|
175
|
+
else if (typeof value !== 'number' || !Number.isFinite(value) || value < (key === 'marketMultiplier' || key === 'vatPct' ? 0 : -10) || value > (key === 'vatPct' ? 100 : 10))
|
|
176
|
+
invalid('Ein Preisbestandteil liegt außerhalb des zulässigen Bereichs.');
|
|
177
|
+
Reflect.set(formula, key, value);
|
|
178
|
+
}
|
|
179
|
+
next.formula = formula;
|
|
180
|
+
}
|
|
181
|
+
const sameSource = previous.providerId === providerId && source(previous) === resolved && knownEndpoint(previous);
|
|
182
|
+
const previousCredentials = rec(previous.credentials);
|
|
183
|
+
const credentials = sameSource ? copy(previousCredentials) : {};
|
|
184
|
+
if (!sameSource && Object.keys(previousCredentials).length) {
|
|
185
|
+
// Retention only. These archived credentials are never consumed by a provider client.
|
|
186
|
+
const retained = rec(previous.retainedProviderCredentials);
|
|
187
|
+
const key = source(previous);
|
|
188
|
+
const entries = Object.entries(retained).filter(([name]) => ['manual-dp', 'tibber', 'entsoe', 'energyzero', 'custom-rest', 'ostrom'].includes(name));
|
|
189
|
+
next.retainedProviderCredentials = Object.fromEntries([...entries.filter(([name]) => name !== key), [key, { credentials: copy(previousCredentials), endpoint: typeof previous.endpoint === 'string' ? previous.endpoint : '', providerId: previous.providerId || 'manual-dp' }]].slice(-7));
|
|
190
|
+
}
|
|
191
|
+
if (own(submitted, 'credentials')) {
|
|
192
|
+
if (submitted.credentials === null || typeof submitted.credentials !== 'object' || Array.isArray(submitted.credentials))
|
|
193
|
+
invalid('Die Zugangsdaten sind ungültig.');
|
|
194
|
+
for (const [key, value] of Object.entries(rec(submitted.credentials))) {
|
|
195
|
+
if ((key !== 'accessToken' || resolved !== 'tibber') && (key !== 'securityToken' || resolved !== 'entsoe'))
|
|
196
|
+
invalid('Das Zugangsfeld passt nicht zum ausgewählten Anbieter.');
|
|
197
|
+
const secret = text(value, 4096);
|
|
198
|
+
if (RESERVED_CREDENTIAL_INPUTS.has(secret))
|
|
199
|
+
invalid('Bitte einen neuen Token eingeben oder das Feld leer lassen.');
|
|
200
|
+
if (secret)
|
|
201
|
+
Reflect.set(credentials, key, secret);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
if (next.enabled === true && ((resolved === 'tibber' && (typeof credentials.accessToken !== 'string' || !credentials.accessToken.trim())) || (resolved === 'entsoe' && (typeof credentials.securityToken !== 'string' || !credentials.securityToken.trim()))))
|
|
205
|
+
invalid('Für diesen Anbieterwechsel bitte den passenden Zugangstoken eingeben.');
|
|
206
|
+
next.credentials = credentials;
|
|
207
|
+
if (resolved !== 'manual-dp')
|
|
208
|
+
next.endpoint = Reflect.get(ENDPOINTS, resolved);
|
|
209
|
+
if (resolved === 'entsoe')
|
|
210
|
+
next.biddingZone = country === 'NL' ? '10YNL----------L' : '10Y1001A1001A82H';
|
|
211
|
+
if (!sameSource && resolved !== 'manual-dp')
|
|
212
|
+
next.unit = 'EUR/kWh';
|
|
213
|
+
// Existing active tariff operation is retained, never implicitly activated by a new connection.
|
|
214
|
+
next.activateTariffLogic = typeof previous.activateTariffLogic === 'boolean' ? previous.activateTariffLogic : previous.enabled === true;
|
|
215
|
+
next.automaticMode = typeof previous.automaticMode === 'boolean' ? previous.automaticMode : previous.enabled === true;
|
|
216
|
+
next.timeoutMs = 5000;
|
|
217
|
+
let wantedMapping = own(submitted, 'useForTariff') ? submitted.useForTariff : useForTariff(root, namespace);
|
|
218
|
+
if (typeof wantedMapping !== 'boolean')
|
|
219
|
+
invalid('Die Zustimmung zur Tarifzuordnung ist ungültig.');
|
|
220
|
+
if (resolved === 'manual-dp')
|
|
221
|
+
wantedMapping = false;
|
|
222
|
+
next.autoCoupleDatapoints = wantedMapping;
|
|
223
|
+
const oldPoints = rec(root.datapoints);
|
|
224
|
+
const expected = managedPoints(namespace);
|
|
225
|
+
let datapoints;
|
|
226
|
+
if (wantedMapping && resolved !== 'manual-dp') {
|
|
227
|
+
if (!useForTariff(root, namespace))
|
|
228
|
+
next.customerPreviousPriceDatapoints = Object.fromEntries(PRICE_KEYS.map(key => [key, typeof Reflect.get(oldPoints, key) === 'string' ? Reflect.get(oldPoints, key) : null]));
|
|
229
|
+
datapoints = { ...copy(oldPoints), ...expected };
|
|
230
|
+
}
|
|
231
|
+
else if ((own(submitted, 'useForTariff') || resolved === 'manual-dp') && !wantedMapping && useForTariff(root, namespace)) {
|
|
232
|
+
const saved = rec(previous.customerPreviousPriceDatapoints);
|
|
233
|
+
if (PRICE_KEYS.every(key => own(saved, key))) {
|
|
234
|
+
datapoints = copy(oldPoints);
|
|
235
|
+
for (const key of PRICE_KEYS) {
|
|
236
|
+
const value = Reflect.get(saved, key);
|
|
237
|
+
if (typeof value === 'string')
|
|
238
|
+
Reflect.set(datapoints, key, value);
|
|
239
|
+
else
|
|
240
|
+
Reflect.deleteProperty(datapoints, key);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return { tariffProvider: next, ...(datapoints ? { datapoints } : {}) };
|
|
245
|
+
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 NexoWatt. All rights reserved.
|
|
3
|
+
* Confidential and Proprietary.
|
|
4
|
+
* Use, modification or distribution without express written permission is prohibited.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
|
+
*
|
|
9
|
+
* Quelle: src-ts/runtime-executables/lib/installer-lifecycle.ts
|
|
10
|
+
* Quell-Hash: sha256:df3487fcf381e39bedfa5d78a6ba0f47de44caa51e7e9aae0ab0cb7b420e550b
|
|
11
|
+
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
|
+
*
|
|
13
|
+
* Zweck:
|
|
14
|
+
* Diese JavaScript-Datei ist das ausführbare Build-Artefakt für lib/installer-lifecycle.js.
|
|
15
|
+
* Die fachliche Bearbeitung erfolgt ab 0.7.131 in der TypeScript-Quelle.
|
|
16
|
+
* Ab 0.7.132 sind doppelte Legacy-JS-Bäume wie .nwcore entfernt.
|
|
17
|
+
*
|
|
18
|
+
* Pflege-Regel:
|
|
19
|
+
* 1. Änderung zuerst in src-ts/runtime-executables/ vornehmen.
|
|
20
|
+
* 2. npm run sync:ts-runtime-executables ausführen.
|
|
21
|
+
* 3. npm run test:runtime-executables prüfen.
|
|
22
|
+
*/
|
|
23
|
+
"use strict";
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.installerRevision = installerRevision;
|
|
26
|
+
exports.assertInstallerRevision = assertInstallerRevision;
|
|
27
|
+
exports.provisionInstallerObjects = provisionInstallerObjects;
|
|
28
|
+
exports.awaitEmsTransition = awaitEmsTransition;
|
|
29
|
+
exports.assertDeviceAppActivations = assertDeviceAppActivations;
|
|
30
|
+
exports.numericMeasurement = numericMeasurement;
|
|
31
|
+
exports.activeDeviceProfileReferences = activeDeviceProfileReferences;
|
|
32
|
+
/**
|
|
33
|
+
* NexoWatt Quellcode-Erklärung (DE)
|
|
34
|
+
* Aufgabe: Schützt AppCenter-Zuordnungen vor veralteten Speicherformularen und
|
|
35
|
+
* legt fehlende eigene Datenpunktobjekte vor der Laufzeitübernahme an.
|
|
36
|
+
* Daten und Wirkung: Eine flüchtig geschützte HMAC-Revision verlässt den Server,
|
|
37
|
+
* niemals Konfigurationswerte oder der HMAC-Schlüssel. Pro Objektgruppe gibt es
|
|
38
|
+
* höchstens zwei Versuche; fehlende Messwerte bleiben ohne künstlichen Nullwert.
|
|
39
|
+
* Zusammenhang: Automatische Gerätezuordnung und manuelles Speichern verwenden
|
|
40
|
+
* denselben AppCenter-Mutationsschutz. Keine App oder Stellfreigabe wird erteilt.
|
|
41
|
+
* Bei Änderungen: Veraltete nichtleere Listen, Ownership-Verlust, fehlgeschlagene
|
|
42
|
+
* Objektanlage und unveränderte Kundenwerte prüfen; Neustarts verwerfen alte Revisionen.
|
|
43
|
+
*/
|
|
44
|
+
const node_crypto_1 = require("node:crypto");
|
|
45
|
+
const http_error_boundary_1 = require("./http-error-boundary");
|
|
46
|
+
const revisionSecret = (0, node_crypto_1.randomBytes)(32);
|
|
47
|
+
function record(value) {
|
|
48
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value) ? value : {};
|
|
49
|
+
}
|
|
50
|
+
function canonical(value) {
|
|
51
|
+
if (Array.isArray(value))
|
|
52
|
+
return value.map(canonical);
|
|
53
|
+
if (value !== null && typeof value === 'object') {
|
|
54
|
+
return Object.fromEntries(Object.entries(value).sort(([a], [b]) => a.localeCompare(b)).map(([key, item]) => [key, canonical(item)]));
|
|
55
|
+
}
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
/** Stable within this runtime across key ordering; restart invalidates old forms.
|
|
59
|
+
* An ephemeral HMAC key prevents public revisions from becoming a secret-value guessing oracle. */
|
|
60
|
+
function installerRevision(patch) {
|
|
61
|
+
return (0, node_crypto_1.createHmac)('sha256', revisionSecret).update(JSON.stringify(canonical(record(patch)))).digest('hex');
|
|
62
|
+
}
|
|
63
|
+
/** Older clients remain compatible until automatic bindings need protection.
|
|
64
|
+
* Once present, a missing or stale token must never replace a newer nonempty row list. */
|
|
65
|
+
function assertInstallerRevision(expected, patch) {
|
|
66
|
+
const bindings = record(record(record(patch).eosDeviceEms).bindings);
|
|
67
|
+
const required = Object.keys(bindings).length > 0;
|
|
68
|
+
if ((expected === undefined || expected === null) && !required)
|
|
69
|
+
return;
|
|
70
|
+
if (typeof expected !== 'string' || !/^[a-f0-9]{64}$/.test(expected) || expected !== installerRevision(patch)) {
|
|
71
|
+
throw (0, http_error_boundary_1.createPublicHttpError)(409, 'EOS_INSTALLER_CONFIG_CHANGED', 'Die EMS-Zuordnung wurde inzwischen geändert. Deine Eingaben bleiben erhalten. Bitte den aktuellen Stand über „Neu laden“ laden und die Änderungen vergleichen, bevor du erneut speicherst.');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/** Bounded retries tolerate a transient controller failure. No deletion, state reset or detached work. */
|
|
75
|
+
async function provisionInstallerObjects(options) {
|
|
76
|
+
for (const step of options.steps) {
|
|
77
|
+
let completed = false;
|
|
78
|
+
for (let attempt = 0; attempt < 2; attempt++) {
|
|
79
|
+
if (!options.canWrite())
|
|
80
|
+
throw (0, http_error_boundary_1.createPublicHttpError)(409, 'EOS_UI_OWNERSHIP_REQUIRED', 'Die Systemfreigabe ist nicht mehr gültig. Einstellungen wurden nicht neu übernommen.');
|
|
81
|
+
try {
|
|
82
|
+
await step();
|
|
83
|
+
completed = true;
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
catch { /* Retry only idempotent object creation. */ }
|
|
87
|
+
}
|
|
88
|
+
if (!completed)
|
|
89
|
+
throw (0, http_error_boundary_1.createPublicHttpError)(503, 'EOS_EMS_OBJECT_PROVISION_FAILED', 'Die benötigten EMS-Datenpunktobjekte konnten nicht angelegt werden. Es wurde kein erfolgreicher Abschluss gemeldet; Verbindung prüfen und erneut speichern.');
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/** A timed-out old cycle remains fenced; callers must not start its replacement.
|
|
93
|
+
* The pending operation is still observed, so a late failure is never unhandled. */
|
|
94
|
+
async function awaitEmsTransition(operation, timeoutMs = 5000) {
|
|
95
|
+
const budget = Number.isFinite(timeoutMs) ? Math.max(1, Math.min(5000, Math.round(timeoutMs))) : 5000;
|
|
96
|
+
let timer;
|
|
97
|
+
const timeout = new Promise((_resolve, reject) => {
|
|
98
|
+
timer = setTimeout(() => { reject(new Error('EOS_EMS_CONFIG_WAIT_TIMEOUT')); }, budget);
|
|
99
|
+
});
|
|
100
|
+
try {
|
|
101
|
+
await Promise.race([operation, timeout]);
|
|
102
|
+
}
|
|
103
|
+
finally {
|
|
104
|
+
if (timer !== undefined)
|
|
105
|
+
clearTimeout(timer);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/** New device commissioning cannot silently promise an app denied by the live license. */
|
|
109
|
+
function assertDeviceAppActivations(current, planned, allowed) {
|
|
110
|
+
const before = record(record(record(current).emsApps).apps);
|
|
111
|
+
const after = record(record(record(planned).emsApps).apps);
|
|
112
|
+
for (const [id, value] of Object.entries(after)) {
|
|
113
|
+
const app = record(value);
|
|
114
|
+
const previous = record(Reflect.get(before, id));
|
|
115
|
+
if (app.installed === true && app.enabled === true &&
|
|
116
|
+
(previous.installed !== true || previous.enabled !== true) && !allowed(id)) {
|
|
117
|
+
throw (0, http_error_boundary_1.createPublicHttpError)(403, 'EOS_EMS_APP_LICENSE_REQUIRED', 'Die gewählte EMS-Funktion ist durch die aktuelle Systemfreigabe nicht verfügbar. Die Gerätezuordnung wurde nicht als aktiv übernommen.');
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/** Measurements are numbers, never coerced boolean states, missing values or collections. */
|
|
122
|
+
function numericMeasurement(value) {
|
|
123
|
+
if (typeof value !== 'number' && typeof value !== 'string')
|
|
124
|
+
return null;
|
|
125
|
+
if (typeof value === 'string' && value.trim() === '')
|
|
126
|
+
return null;
|
|
127
|
+
const parsed = Number(value);
|
|
128
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
129
|
+
}
|
|
130
|
+
/** Collect only active controller sections, excluding pure UI links and disabled rows.
|
|
131
|
+
* Values remain exact object IDs. The hosted bridge resolves aliases with bounded reads.
|
|
132
|
+
* This prevents replacing a protocol/profile beneath a running controller. */
|
|
133
|
+
function activeDeviceProfileReferences(value) {
|
|
134
|
+
const config = record(value);
|
|
135
|
+
const apps = record(record(config.emsApps).apps);
|
|
136
|
+
const active = (id, flag) => {
|
|
137
|
+
const stored = record(Reflect.get(apps, id));
|
|
138
|
+
return Object.keys(stored).length > 0 ? stored.installed === true && stored.enabled === true : Reflect.get(config, flag) === true;
|
|
139
|
+
};
|
|
140
|
+
const singleStorage = record(config.storage);
|
|
141
|
+
const singleActive = active('storage', 'enableStorageControl') && !(record(singleStorage._eosDevice).v === 1 && singleStorage.enabled === false);
|
|
142
|
+
const read = new Set();
|
|
143
|
+
const write = new Set();
|
|
144
|
+
const writeKey = /(?:write|^set|^target|^output(?:Object)?Id$|^(?:pv)?feedInLimit|^pvLimit|^runObjectId$|^maxChargeObjectId$|^maxDischargeObjectId$|^phaseSwitchId$|^chargeEnableObjectId$|^dischargeEnableObjectId$|^feneconGridSetpoint|^e3dcSetPower|^enableId$)/i;
|
|
145
|
+
let visited = 0;
|
|
146
|
+
const walk = (item, depth = 0) => {
|
|
147
|
+
if (depth > 12 || ++visited > 20000)
|
|
148
|
+
throw new Error('EOS_DEVICES_PROFILE_CHECK_UNAVAILABLE');
|
|
149
|
+
if (Array.isArray(item)) {
|
|
150
|
+
for (const row of item)
|
|
151
|
+
walk(row, depth + 1);
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const row = record(item);
|
|
155
|
+
if (row.enabled === false)
|
|
156
|
+
return;
|
|
157
|
+
for (const [key, child] of Object.entries(row)) {
|
|
158
|
+
if (key === '_eosDevice' || key === 'eosDeviceEms')
|
|
159
|
+
continue;
|
|
160
|
+
if (typeof child === 'string' && /(?:Id|ObjectId)$/.test(key) && child.length > 0 && child.length <= 512) {
|
|
161
|
+
(writeKey.test(key) ? write : read).add(child);
|
|
162
|
+
}
|
|
163
|
+
else if (child !== null && typeof child === 'object')
|
|
164
|
+
walk(child, depth + 1);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
if (active('charging', 'enableChargingManagement'))
|
|
168
|
+
walk(record(config.settingsConfig).evcsList);
|
|
169
|
+
if (active('peak', 'enablePeakShaving') || record(record(config.peakShaving).atypical).enabled === true)
|
|
170
|
+
walk(config.peakShaving);
|
|
171
|
+
// The established legacy single-storage contract is app-authoritative.
|
|
172
|
+
if (singleActive)
|
|
173
|
+
walk({ ...singleStorage, enabled: true });
|
|
174
|
+
if (active('storagefarm', 'enableStorageFarm'))
|
|
175
|
+
walk({ ...record(config.storageFarm), enabled: true });
|
|
176
|
+
if (active('dynamicGrid', 'enableDynamicGrid'))
|
|
177
|
+
walk(config.dynamicGridConnection);
|
|
178
|
+
for (const [appId, flag, sections] of [
|
|
179
|
+
['thermal', 'enableThermalControl', ['thermal', 'thermalControl']],
|
|
180
|
+
['heatingrod', 'enableHeatingRodControl', ['heatingRod']],
|
|
181
|
+
['threshold', 'enableThresholdControl', ['threshold']],
|
|
182
|
+
['generator', 'enableGeneratorControl', ['generator']],
|
|
183
|
+
['bhkw', 'enableBhkwControl', ['bhkw']],
|
|
184
|
+
['relay', 'enableRelayControl', ['relay']],
|
|
185
|
+
])
|
|
186
|
+
if (active(appId, flag))
|
|
187
|
+
for (const section of sections)
|
|
188
|
+
walk(Reflect.get(config, section));
|
|
189
|
+
// Grid protection is a mandatory controller. Profile changes require unmapping
|
|
190
|
+
// its actual measurement/actuator first, never disabling protection itself.
|
|
191
|
+
walk(config.gridConstraints);
|
|
192
|
+
walk(config.nvpTopology);
|
|
193
|
+
const datapoints = record(config.datapoints);
|
|
194
|
+
for (const key of ['gridPointPower', 'gridPointPowerRaw', 'gridBuyPower', 'gridSellPower', 'gridPointImportPower', 'gridPointExportPower', 'gridPointConnected', 'gridPointWatchdog']) {
|
|
195
|
+
const id = Reflect.get(datapoints, key);
|
|
196
|
+
if (typeof id === 'string' && id.length > 0 && id.length <= 512)
|
|
197
|
+
read.add(id);
|
|
198
|
+
}
|
|
199
|
+
// These global measurement keys are real runtime fallbacks for enabled
|
|
200
|
+
// battery/charging controllers, not merely display references in that case.
|
|
201
|
+
const controllerMeasurementKeys = [];
|
|
202
|
+
if (singleActive)
|
|
203
|
+
controllerMeasurementKeys.push('batteryPower', 'storageChargePower', 'storageDischargePower', 'storageSoc', 'storageCapacityKwh');
|
|
204
|
+
if (singleActive || active('storagefarm', 'enableStorageFarm') || active('charging', 'enableChargingManagement'))
|
|
205
|
+
controllerMeasurementKeys.push('pvPower');
|
|
206
|
+
for (const key of controllerMeasurementKeys) {
|
|
207
|
+
const id = Reflect.get(datapoints, key);
|
|
208
|
+
if (typeof id === 'string' && id.length > 0 && id.length <= 512)
|
|
209
|
+
read.add(id);
|
|
210
|
+
}
|
|
211
|
+
const slots = record(record(config.vis).flowSlots);
|
|
212
|
+
for (const slot of Array.isArray(slots.consumers) ? slots.consumers : []) {
|
|
213
|
+
const ctrl = record(record(slot).ctrl);
|
|
214
|
+
if (ctrl.enabled === true)
|
|
215
|
+
walk(ctrl);
|
|
216
|
+
}
|
|
217
|
+
if (read.size + write.size > 1024)
|
|
218
|
+
throw new Error('EOS_DEVICES_PROFILE_CHECK_UNAVAILABLE');
|
|
219
|
+
return { read: [...read], write: [...write] };
|
|
220
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 NexoWatt. All rights reserved.
|
|
3
|
+
* Confidential and Proprietary.
|
|
4
|
+
* Use, modification or distribution without express written permission is prohibited.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
|
+
*
|
|
9
|
+
* Quelle: src-ts/runtime-executables/lib/storage-farm-overview.ts
|
|
10
|
+
* Quell-Hash: sha256:986c2eaeb7ce486a4360bbe18dc61a3661f1df228174984453a53e9d6e385804
|
|
11
|
+
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
|
+
*
|
|
13
|
+
* Zweck:
|
|
14
|
+
* Diese JavaScript-Datei ist das ausführbare Build-Artefakt für lib/storage-farm-overview.js.
|
|
15
|
+
* Die fachliche Bearbeitung erfolgt ab 0.7.131 in der TypeScript-Quelle.
|
|
16
|
+
* Ab 0.7.132 sind doppelte Legacy-JS-Bäume wie .nwcore entfernt.
|
|
17
|
+
*
|
|
18
|
+
* Pflege-Regel:
|
|
19
|
+
* 1. Änderung zuerst in src-ts/runtime-executables/ vornehmen.
|
|
20
|
+
* 2. npm run sync:ts-runtime-executables ausführen.
|
|
21
|
+
* 3. npm run test:runtime-executables prüfen.
|
|
22
|
+
*/
|
|
23
|
+
"use strict";
|
|
24
|
+
/**
|
|
25
|
+
* NexoWatt Quellcode-Erklärung (DE)
|
|
26
|
+
* Aufgabe: Bildet eine gemeinsame, lesende Farmübersicht aus frischen Messproben
|
|
27
|
+
* und der bekannten Nennkapazität ihrer aktiv konfigurierten Mitglieder.
|
|
28
|
+
* Daten und Wirkung: Unvollständige Leistungssummen bleiben null; gültige SoCs
|
|
29
|
+
* liefern einen ausdrücklich als Teilmittel gekennzeichneten arithmetischen Mittelwert.
|
|
30
|
+
* Zusammenhang: main.ts liefert bereits normalisierte, frisch geprüfte Proben.
|
|
31
|
+
* Diese Anzeige ändert weder alte Regler-SoCs noch Limits, Freigaben oder Sollwerte.
|
|
32
|
+
* Bei Änderungen: Gegenläufige Batterieflüsse, Offline-Mitglieder, fehlende
|
|
33
|
+
* Kapazitäten, doppelte Quellen und echte Nullwerte getrennt prüfen.
|
|
34
|
+
*/
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.buildFarmOverview = buildFarmOverview;
|
|
37
|
+
function finite(value) { return typeof value === 'number' && Number.isFinite(value); }
|
|
38
|
+
function rounded(value, digits = 0) {
|
|
39
|
+
const factor = 10 ** digits;
|
|
40
|
+
return Math.round(value * factor) / factor;
|
|
41
|
+
}
|
|
42
|
+
function coverage(valid, total) { return { valid, total, complete: total > 0 && valid === total }; }
|
|
43
|
+
/** Conflicting duplicate member readings invalidate that metric instead of silently picking one. */
|
|
44
|
+
function commonSample(a, b) { return a === b ? a : null; }
|
|
45
|
+
function buildFarmOverview(members, sources, updatedAt) {
|
|
46
|
+
const unique = new Map();
|
|
47
|
+
for (const row of members) {
|
|
48
|
+
const normalized = {
|
|
49
|
+
key: row.key,
|
|
50
|
+
fresh: row.fresh === true,
|
|
51
|
+
batteryPowerW: row.fresh && finite(row.batteryPowerW) ? row.batteryPowerW : null,
|
|
52
|
+
socPct: finite(row.socPct) && row.socPct >= 0 && row.socPct <= 100 ? row.socPct : null,
|
|
53
|
+
capacityKWh: finite(row.capacityKWh) && row.capacityKWh > 0 ? row.capacityKWh : null,
|
|
54
|
+
};
|
|
55
|
+
const previous = unique.get(row.key);
|
|
56
|
+
unique.set(row.key, previous ? {
|
|
57
|
+
key: row.key, fresh: previous.fresh && normalized.fresh,
|
|
58
|
+
batteryPowerW: commonSample(previous.batteryPowerW, normalized.batteryPowerW),
|
|
59
|
+
socPct: commonSample(previous.socPct, normalized.socPct),
|
|
60
|
+
capacityKWh: commonSample(previous.capacityKWh, normalized.capacityKWh),
|
|
61
|
+
} : normalized);
|
|
62
|
+
}
|
|
63
|
+
let fresh = 0;
|
|
64
|
+
let batteryValid = 0;
|
|
65
|
+
let socValid = 0;
|
|
66
|
+
let capacityValid = 0;
|
|
67
|
+
let net = 0;
|
|
68
|
+
let charge = 0;
|
|
69
|
+
let discharge = 0;
|
|
70
|
+
let soc = 0;
|
|
71
|
+
let capacity = 0;
|
|
72
|
+
for (const row of unique.values()) {
|
|
73
|
+
if (row.fresh)
|
|
74
|
+
fresh++;
|
|
75
|
+
if (row.batteryPowerW !== null) {
|
|
76
|
+
batteryValid++;
|
|
77
|
+
net += row.batteryPowerW;
|
|
78
|
+
charge += Math.max(0, -row.batteryPowerW);
|
|
79
|
+
discharge += Math.max(0, row.batteryPowerW);
|
|
80
|
+
}
|
|
81
|
+
if (row.socPct !== null) {
|
|
82
|
+
socValid++;
|
|
83
|
+
soc += row.socPct;
|
|
84
|
+
}
|
|
85
|
+
if (row.capacityKWh !== null) {
|
|
86
|
+
capacityValid++;
|
|
87
|
+
capacity += row.capacityKWh;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const pvSources = new Map();
|
|
91
|
+
for (const row of sources) {
|
|
92
|
+
const value = finite(row.powerW) && row.powerW >= 0 ? row.powerW : null;
|
|
93
|
+
const previous = pvSources.get(row.key);
|
|
94
|
+
pvSources.set(row.key, previous === undefined ? value : commonSample(previous, value));
|
|
95
|
+
}
|
|
96
|
+
let pvValid = 0;
|
|
97
|
+
let pv = 0;
|
|
98
|
+
for (const value of pvSources.values())
|
|
99
|
+
if (value !== null) {
|
|
100
|
+
pvValid++;
|
|
101
|
+
pv += value;
|
|
102
|
+
}
|
|
103
|
+
const batteryCoverage = coverage(batteryValid, unique.size);
|
|
104
|
+
const capacityCoverage = coverage(capacityValid, unique.size);
|
|
105
|
+
const pvCoverage = coverage(pvValid, pvSources.size);
|
|
106
|
+
return {
|
|
107
|
+
v: 1, updatedAt, members: { total: unique.size, fresh },
|
|
108
|
+
battery: { ...batteryCoverage, netW: batteryCoverage.complete ? rounded(net) : null,
|
|
109
|
+
chargeW: batteryCoverage.complete ? rounded(charge) : null, dischargeW: batteryCoverage.complete ? rounded(discharge) : null },
|
|
110
|
+
soc: { ...coverage(socValid, unique.size), meanPct: socValid > 0 ? rounded(soc / socValid, 1) : null },
|
|
111
|
+
capacity: { ...capacityCoverage, totalKWh: capacityCoverage.complete ? rounded(capacity, 3) : null,
|
|
112
|
+
knownKWh: capacityValid > 0 ? rounded(capacity, 3) : null },
|
|
113
|
+
pv: { ...pvCoverage, powerW: pvCoverage.complete ? rounded(pv) : null },
|
|
114
|
+
};
|
|
115
|
+
}
|