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
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/ems/modules/tariff-provider.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:217202ce9ba4fde752c10636edc4f6020ecb9af79ce98d86fedde79c0738ce64
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
'use strict';
|
|
38
38
|
|
|
39
39
|
const { BaseModule } = require('./base');
|
|
40
|
+
const { createHash } = require('node:crypto');
|
|
40
41
|
const {
|
|
41
42
|
fetchProvider,
|
|
42
43
|
splitTodayTomorrow,
|
|
@@ -44,6 +45,35 @@ const {
|
|
|
44
45
|
publicRegistry,
|
|
45
46
|
} = require('../services/tariff-provider-registry');
|
|
46
47
|
|
|
48
|
+
// Only configuration changes hash the normalized configuration, including
|
|
49
|
+
// credentials. The digest is private and is never exposed as a diagnostic.
|
|
50
|
+
function stableConfiguration(value) {
|
|
51
|
+
let nodes = 0;
|
|
52
|
+
const visit = (item, depth) => {
|
|
53
|
+
if (++nodes > 4096 || depth > 16) throw new Error('TARIFF_CONFIGURATION_INVALID');
|
|
54
|
+
if (item === null || ['string', 'boolean', 'number'].includes(typeof item)) return item;
|
|
55
|
+
if (Array.isArray(item)) return item.map(child => visit(child, depth + 1));
|
|
56
|
+
if (!item || typeof item !== 'object') return undefined;
|
|
57
|
+
const entries = [];
|
|
58
|
+
for (const [key, child] of Object.entries(item).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0)) {
|
|
59
|
+
if (['__proto__', 'prototype', 'constructor'].includes(key)) throw new Error('TARIFF_CONFIGURATION_INVALID');
|
|
60
|
+
entries.push([key, visit(child, depth + 1)]);
|
|
61
|
+
}
|
|
62
|
+
return Object.fromEntries(entries);
|
|
63
|
+
};
|
|
64
|
+
const serialized = JSON.stringify(visit(value, 0));
|
|
65
|
+
if (serialized.length > 262144) throw new Error('TARIFF_CONFIGURATION_INVALID');
|
|
66
|
+
return serialized;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const OPERATIONAL_PRICE_STATES = [
|
|
70
|
+
['tariffProvider.currentPriceEurPerKwh', null],
|
|
71
|
+
['tariffProvider.averagePriceEurPerKwh', null],
|
|
72
|
+
['tariffProvider.pricesTodayJson', '[]'],
|
|
73
|
+
['tariffProvider.pricesTomorrowJson', '[]'],
|
|
74
|
+
['tariffProvider.normalizedJson', '[]'],
|
|
75
|
+
];
|
|
76
|
+
|
|
47
77
|
class TariffProviderModule extends BaseModule {
|
|
48
78
|
constructor(adapter, dpRegistry) {
|
|
49
79
|
super(adapter, dpRegistry);
|
|
@@ -58,6 +88,112 @@ class TariffProviderModule extends BaseModule {
|
|
|
58
88
|
this._lastError = '';
|
|
59
89
|
this._consecutiveErrors = 0;
|
|
60
90
|
this._effectiveRefreshMinutes = 0;
|
|
91
|
+
this._generation = 0;
|
|
92
|
+
this._stopped = false;
|
|
93
|
+
this._publicationTail = Promise.resolve();
|
|
94
|
+
this._invalidationPending = false;
|
|
95
|
+
this._mappingPromise = null;
|
|
96
|
+
this._captureConfiguration();
|
|
97
|
+
this._fencePriceReaders();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
_fencePriceReaders() {
|
|
101
|
+
this._priceReaderFence = { ids: new Set(OPERATIONAL_PRICE_STATES.map(([id]) => `${this.adapter.namespace}.${id}`)) };
|
|
102
|
+
this.adapter._nwTariffInvalidation = this._priceReaderFence;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
_captureConfiguration() {
|
|
106
|
+
const serialized = stableConfiguration(this._cfg());
|
|
107
|
+
const signature = createHash('sha256').update(serialized).digest('hex');
|
|
108
|
+
this._configurationSource = this.adapter?.config?.tariffProvider;
|
|
109
|
+
this._configurationCountry = this.adapter?.config?.countryProfile?.country;
|
|
110
|
+
if (signature === this._configurationSignature) return false;
|
|
111
|
+
this._configurationSignature = signature;
|
|
112
|
+
this._configuration = JSON.parse(serialized);
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
_isCurrent(generation) {
|
|
117
|
+
return !this._stopped && !this.adapter?._nwShuttingDown && generation === this._generation;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** Rebind only the tariff readers, including charging-management's direct
|
|
121
|
+
* price keys. Unchanged mappings keep their transformations and caches. */
|
|
122
|
+
async applyTariffMappings() {
|
|
123
|
+
if (this._stopped || !this.dp) return;
|
|
124
|
+
if (this._mappingPromise) await this._mappingPromise;
|
|
125
|
+
const vis = this.adapter.emsEngine?.mm?.modules?.find(entry => entry.key === 'tarifVis')?.instance;
|
|
126
|
+
const dps = this.adapter.config?.datapoints || {};
|
|
127
|
+
const trim = value => typeof value === 'string' ? value.trim() : '';
|
|
128
|
+
const current = vis?._getVisPriceCurrentId?.() || trim(dps.priceCurrent);
|
|
129
|
+
const average = vis?._getVisPriceAverageId?.() || trim(dps.priceAverage);
|
|
130
|
+
const today = vis?._getVisPriceTodayJsonId?.() || trim(dps.priceTodayJson);
|
|
131
|
+
const tomorrow = vis?._getVisPriceTomorrowJsonId?.() || trim(dps.priceTomorrowJson);
|
|
132
|
+
const mappings = [
|
|
133
|
+
['tarif.preisAktuellEurProKwh', current, 'number'], ['priceCurrent', current, 'number'],
|
|
134
|
+
['tarif.preisDurchschnittEurProKwh', average, 'number'], ['priceAverage', average, 'number'],
|
|
135
|
+
['tarif.pricesTodayJson', today, 'string'], ['tarif.pricesTomorrowJson', tomorrow, 'string'],
|
|
136
|
+
];
|
|
137
|
+
const changed = [];
|
|
138
|
+
// Drop all obsolete reader bindings synchronously before the first DB
|
|
139
|
+
// await. A regulation tick can see missing readings, never old curves
|
|
140
|
+
// combined with the first newly registered price.
|
|
141
|
+
for (const [key, objectId, dataType] of mappings) {
|
|
142
|
+
const previous = this.dp.getEntry(key);
|
|
143
|
+
if (previous?.objectId === objectId) continue;
|
|
144
|
+
if (previous) this.dp.remove(key);
|
|
145
|
+
if (objectId) changed.push([key, objectId, dataType]);
|
|
146
|
+
}
|
|
147
|
+
const operation = (async () => {
|
|
148
|
+
for (const [key, objectId, dataType] of changed) {
|
|
149
|
+
if (this._stopped || this.adapter?._nwShuttingDown) return;
|
|
150
|
+
// A canonical €/kWh source never inherits a cent/kWh converter.
|
|
151
|
+
await this.dp.upsert({ key, objectId, dataType, direction: 'in',
|
|
152
|
+
...(dataType === 'number' && objectId.startsWith(`${this.adapter.namespace}.tariffProvider.`)
|
|
153
|
+
? { unit: '€/kWh', scale: 1, offset: 0, invert: false } : {}) });
|
|
154
|
+
}
|
|
155
|
+
})();
|
|
156
|
+
this._mappingPromise = operation;
|
|
157
|
+
try { await operation; }
|
|
158
|
+
finally { if (this._mappingPromise === operation) this._mappingPromise = null; }
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** Called by the save/apply path, not a second scheduler or an EMS restart. */
|
|
162
|
+
invalidateConfiguration() {
|
|
163
|
+
if (this._stopped) return Promise.resolve(false);
|
|
164
|
+
const changed = this._captureConfiguration();
|
|
165
|
+
if (!changed && !this._invalidationPending) return Promise.resolve(false);
|
|
166
|
+
this._invalidationPending = true;
|
|
167
|
+
this._fencePriceReaders();
|
|
168
|
+
const generation = ++this._generation;
|
|
169
|
+
this._intervals = [];
|
|
170
|
+
this._lastFetchMs = 0;
|
|
171
|
+
this._lastSuccessMs = 0;
|
|
172
|
+
this._nextFetchMs = 0;
|
|
173
|
+
this._lastCurrentKey = '';
|
|
174
|
+
this._lastPublishedFresh = null;
|
|
175
|
+
this._lastPublishedSuccessMs = null;
|
|
176
|
+
this._lastError = '';
|
|
177
|
+
this._consecutiveErrors = 0;
|
|
178
|
+
this._effectiveRefreshMinutes = 0;
|
|
179
|
+
// Remove the old provider from the actual EMS cache immediately. This
|
|
180
|
+
// also fences any outstanding registry prime read for those exact IDs.
|
|
181
|
+
const now = Date.now();
|
|
182
|
+
for (const [id, value] of OPERATIONAL_PRICE_STATES) {
|
|
183
|
+
const fullId = `${this.adapter.namespace}.${id}`;
|
|
184
|
+
this.dp?.handleStateChange?.(fullId, null);
|
|
185
|
+
const key = this.adapter.keyFromId?.(fullId);
|
|
186
|
+
if (key) this.adapter.updateValue?.(key, value, now);
|
|
187
|
+
}
|
|
188
|
+
const cfg = this._configuration;
|
|
189
|
+
const status = !cfg.enabled ? 'disabled' : cfg.providerId === 'manual-dp' ? 'manual-datapoints' : 'configuration-changed';
|
|
190
|
+
this.adapter._tariffProviderSnapshot = { ts: now, providerId: cfg.providerId, sourceId: cfg.sourceId,
|
|
191
|
+
enabled: cfg.enabled, status, quality: 'missing', fresh: false,
|
|
192
|
+
currentPriceEurPerKwh: null, averagePriceEurPerKwh: null, intervalCount: 0, lastSuccessMs: 0 };
|
|
193
|
+
return this._publish(cfg, now, status, generation).then(() => {
|
|
194
|
+
if (this._isCurrent(generation)) this._invalidationPending = false;
|
|
195
|
+
return true;
|
|
196
|
+
});
|
|
61
197
|
}
|
|
62
198
|
|
|
63
199
|
async init() {
|
|
@@ -108,14 +244,20 @@ class TariffProviderModule extends BaseModule {
|
|
|
108
244
|
country: String(cfg.country || this.adapter?.config?.countryProfile?.country || 'DE').toUpperCase() === 'NL' ? 'NL' : 'DE',
|
|
109
245
|
timeZone: String(cfg.timeZone || (String(cfg.country || '').toUpperCase() === 'NL' ? 'Europe/Amsterdam' : 'Europe/Berlin')),
|
|
110
246
|
...cfg,
|
|
247
|
+
// Tibber liefert die angeforderte Viertelstundenreihe auch bei einer
|
|
248
|
+
// gespeicherten älteren 60-Minuten-Auswahl. Die Einstellung anderer
|
|
249
|
+
// Provider und der persistierte Kundenstand bleiben unverändert.
|
|
250
|
+
...(this._providerSourceId(cfg) === 'tibber' ? { resolutionMinutes: 15 } : {}),
|
|
111
251
|
// Nach ...cfg begrenzen: eine gespeicherte Alt-Konfiguration darf
|
|
112
252
|
// die 5-s-Gesamtfrist einschließlich OAuth nicht überschreiben.
|
|
113
253
|
timeoutMs: Math.max(1, Math.min(5000, Math.round(Number(cfg.timeoutMs) || 5000))),
|
|
114
254
|
};
|
|
115
255
|
}
|
|
116
256
|
|
|
117
|
-
async _set(id, val) {
|
|
118
|
-
|
|
257
|
+
async _set(id, val, generation = this._generation) {
|
|
258
|
+
if (!this._isCurrent(generation)) return;
|
|
259
|
+
try { await this.adapter.setStateAsync(id, { val, ack: true }); }
|
|
260
|
+
catch (_e) { throw new Error('TARIFF_STATE_WRITE_FAILED'); }
|
|
119
261
|
}
|
|
120
262
|
|
|
121
263
|
_providerSourceId(cfg) {
|
|
@@ -157,9 +299,10 @@ class TariffProviderModule extends BaseModule {
|
|
|
157
299
|
const split = splitTodayTomorrow(this._intervals, nowMs, cfg && cfg.timeZone);
|
|
158
300
|
const hour = this._localHour(nowMs, cfg && cfg.timeZone);
|
|
159
301
|
// Tibber recommends caching today/tomorrow and avoiding frequent
|
|
160
|
-
// price requests. Once tomorrow is available,
|
|
161
|
-
//
|
|
162
|
-
//
|
|
302
|
+
// price requests. Once tomorrow is available, prefer a six-hour
|
|
303
|
+
// cadence; _scheduleNextFetch shortens it when the customer's
|
|
304
|
+
// freshness deadline requires an earlier refresh. During the
|
|
305
|
+
// expected publication window retry hourly until tomorrow exists.
|
|
163
306
|
if (split.tomorrow.length) return Math.max(requested, 360);
|
|
164
307
|
if (hour >= 12 && hour <= 20) return Math.max(requested, 60);
|
|
165
308
|
return Math.max(requested, 180);
|
|
@@ -176,21 +319,41 @@ class TariffProviderModule extends BaseModule {
|
|
|
176
319
|
const provider = this._providerSourceId(cfg);
|
|
177
320
|
const dayKey = Math.floor(Number(nowMs) / (24 * 60 * 60 * 1000));
|
|
178
321
|
const jitter = this._stableJitterFactor(`${this.adapter && this.adapter.namespace || 'nexowatt-ui'}:${provider}:${dayKey}:${this._consecutiveErrors}`);
|
|
179
|
-
|
|
180
|
-
|
|
322
|
+
const now = Number(nowMs);
|
|
323
|
+
let delayMs = effectiveMinutes * 60 * 1000 * jitter;
|
|
324
|
+
let boundedMinutes = effectiveMinutes;
|
|
325
|
+
// A provider's economical fetch cadence must never schedule a known
|
|
326
|
+
// successful curve beyond the customer's existing freshness deadline.
|
|
327
|
+
// Leave time for the bounded request and another attempt; apply this
|
|
328
|
+
// ceiling after jitter, without extending freshness or relabeling data.
|
|
329
|
+
if (this._lastSuccessMs > 0) {
|
|
330
|
+
const freshnessMs = Math.max(30, Math.min(4320, Number(cfg?.maxStaleMinutes) || 180)) * 60 * 1000;
|
|
331
|
+
const remainingMs = this._lastSuccessMs + freshnessMs - now;
|
|
332
|
+
const reserveMs = Math.max(10000, Math.min(300000, freshnessMs * 0.1));
|
|
333
|
+
if (remainingMs > 0) {
|
|
334
|
+
const boundedDelay = Math.min(delayMs, Math.max(60000, remainingMs - reserveMs));
|
|
335
|
+
if (boundedDelay < delayMs) boundedMinutes = boundedDelay / 60000;
|
|
336
|
+
delayMs = boundedDelay;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
this._effectiveRefreshMinutes = Math.round(boundedMinutes * 100) / 100;
|
|
340
|
+
this._nextFetchMs = Math.round(now + delayMs);
|
|
181
341
|
return this._nextFetchMs;
|
|
182
342
|
}
|
|
183
343
|
|
|
184
|
-
async _setTariffSettings(cfg) {
|
|
185
|
-
if (!cfg.enabled || cfg.providerId === 'manual-dp' || !cfg.activateTariffLogic) return;
|
|
344
|
+
async _setTariffSettings(cfg, generation = this._generation) {
|
|
345
|
+
if (!this._isCurrent(generation) || !cfg.enabled || cfg.providerId === 'manual-dp' || !cfg.activateTariffLogic) return;
|
|
186
346
|
const ns = String(this.adapter.namespace || `nexowatt-ui.${this.adapter.instance || 0}`);
|
|
187
347
|
try {
|
|
188
348
|
const dynId = `${ns}.settings.dynamicTariff`;
|
|
189
349
|
const modeId = `${ns}.settings.tariffMode`;
|
|
190
350
|
const dyn = await this.adapter.getForeignStateAsync(dynId).catch(() => null);
|
|
351
|
+
if (!this._isCurrent(generation)) return;
|
|
191
352
|
if (!dyn || dyn.val !== true) await this.adapter.setForeignStateAsync(dynId, true, true);
|
|
353
|
+
if (!this._isCurrent(generation)) return;
|
|
192
354
|
if (cfg.automaticMode) {
|
|
193
355
|
const mode = await this.adapter.getForeignStateAsync(modeId).catch(() => null);
|
|
356
|
+
if (!this._isCurrent(generation)) return;
|
|
194
357
|
if (!mode || Number(mode.val) !== 2) await this.adapter.setForeignStateAsync(modeId, 2, true);
|
|
195
358
|
}
|
|
196
359
|
} catch (e) {
|
|
@@ -198,11 +361,20 @@ class TariffProviderModule extends BaseModule {
|
|
|
198
361
|
}
|
|
199
362
|
}
|
|
200
363
|
|
|
201
|
-
|
|
364
|
+
_publish(cfg, nowMs, statusOverride = '', generation = this._generation) {
|
|
365
|
+
const pending = this._publicationTail.then(() => this._publishCurrent(cfg, nowMs, statusOverride, generation));
|
|
366
|
+
this._publicationTail = pending.catch(() => {});
|
|
367
|
+
return pending;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
async _publishCurrent(cfg, nowMs, statusOverride, generation) {
|
|
371
|
+
if (!this._isCurrent(generation)) return;
|
|
372
|
+
const set = (id, val) => this._set(id, val, generation);
|
|
202
373
|
const split = splitTodayTomorrow(this._intervals, nowMs, cfg.timeZone);
|
|
203
374
|
const ca = currentAndAverage(this._intervals, nowMs);
|
|
204
375
|
const staleAge = this._lastSuccessMs ? nowMs - this._lastSuccessMs : Number.POSITIVE_INFINITY;
|
|
205
|
-
const fresh =
|
|
376
|
+
const fresh = cfg.enabled && cfg.providerId !== 'manual-dp' && this._lastSuccessMs > 0
|
|
377
|
+
&& staleAge <= cfg.maxStaleMinutes * 60 * 1000 && Number.isFinite(ca.current);
|
|
206
378
|
const status = statusOverride || (fresh ? 'ok' : (this._intervals.length ? 'stale' : 'waiting'));
|
|
207
379
|
const quality = this._intervals[0] ? String(this._intervals[0].quality || 'unknown') : 'missing';
|
|
208
380
|
// Never refresh the tariff-control datapoints with stale provider data.
|
|
@@ -217,40 +389,39 @@ class TariffProviderModule extends BaseModule {
|
|
|
217
389
|
// Ein echter Erfolg, Intervallwechsel oder Ablauf benötigt neue Preisstates.
|
|
218
390
|
const publishPrices = statusOverride === 'ok' || this._lastCurrentKey !== publishedKey || this._lastPublishedFresh !== fresh;
|
|
219
391
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
if (publishPrices) {
|
|
226
|
-
await this._set('tariffProvider.currentPriceEurPerKwh', current);
|
|
227
|
-
await this._set('tariffProvider.averagePriceEurPerKwh', average);
|
|
392
|
+
// Operational prices/curves are cleared before the new provider label.
|
|
393
|
+
// Consumers inspect numeric values and timestamps, not only fresh=false.
|
|
394
|
+
if (!fresh && publishPrices) {
|
|
395
|
+
await set('tariffProvider.fresh', false);
|
|
396
|
+
for (const [id, value] of OPERATIONAL_PRICE_STATES) await set(id, value);
|
|
228
397
|
}
|
|
398
|
+
|
|
399
|
+
await set('tariffProvider.enabled', cfg.enabled);
|
|
400
|
+
await set('tariffProvider.providerId', cfg.providerId);
|
|
401
|
+
await set('tariffProvider.sourceId', cfg.sourceId);
|
|
402
|
+
await set('tariffProvider.status', status);
|
|
403
|
+
await set('tariffProvider.quality', quality);
|
|
229
404
|
if (fresh && publishPrices) {
|
|
230
|
-
await
|
|
231
|
-
await
|
|
232
|
-
await this._set('tariffProvider.normalizedJson', JSON.stringify(this._intervals));
|
|
233
|
-
} else if (!fresh && publishPrices) {
|
|
234
|
-
// Explicitly clear the operational curves once their provider freshness
|
|
235
|
-
// expires. The in-memory cache remains available for diagnostics, but no
|
|
236
|
-
// new storage/EVCS tariff action may be started from it.
|
|
237
|
-
await this._set('tariffProvider.pricesTodayJson', '[]');
|
|
238
|
-
await this._set('tariffProvider.pricesTomorrowJson', '[]');
|
|
239
|
-
await this._set('tariffProvider.normalizedJson', '[]');
|
|
405
|
+
await set('tariffProvider.currentPriceEurPerKwh', current);
|
|
406
|
+
await set('tariffProvider.averagePriceEurPerKwh', average);
|
|
240
407
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
408
|
+
if (fresh && publishPrices) {
|
|
409
|
+
await set('tariffProvider.pricesTodayJson', JSON.stringify(split.today));
|
|
410
|
+
await set('tariffProvider.pricesTomorrowJson', JSON.stringify(split.tomorrow));
|
|
411
|
+
await set('tariffProvider.normalizedJson', JSON.stringify(this._intervals));
|
|
412
|
+
}
|
|
413
|
+
if (!this._isCurrent(generation)) return;
|
|
414
|
+
await set('tariffProvider.lastUpdate', nowMs);
|
|
244
415
|
if (this._lastPublishedSuccessMs !== this._lastSuccessMs) {
|
|
245
|
-
await
|
|
246
|
-
this.
|
|
416
|
+
await set('tariffProvider.lastSuccess', this._lastSuccessMs || 0);
|
|
417
|
+
if (!this._isCurrent(generation)) return;
|
|
247
418
|
}
|
|
248
|
-
await
|
|
249
|
-
await
|
|
250
|
-
await
|
|
251
|
-
await
|
|
252
|
-
await
|
|
253
|
-
await
|
|
419
|
+
await set('tariffProvider.nextUpdate', this._nextFetchMs || 0);
|
|
420
|
+
await set('tariffProvider.fresh', fresh);
|
|
421
|
+
await set('tariffProvider.error', this._lastError || '');
|
|
422
|
+
await set('tariffProvider.intervalCount', this._intervals.length);
|
|
423
|
+
await set('tariffProvider.effectiveRefreshMinutes', this._effectiveRefreshMinutes || 0);
|
|
424
|
+
await set('tariffProvider.consecutiveErrors', this._consecutiveErrors || 0);
|
|
254
425
|
const snapshot = {
|
|
255
426
|
ts: nowMs,
|
|
256
427
|
enabled: cfg.enabled,
|
|
@@ -272,17 +443,24 @@ class TariffProviderModule extends BaseModule {
|
|
|
272
443
|
consecutiveErrors: this._consecutiveErrors || 0,
|
|
273
444
|
error: this._lastError || '',
|
|
274
445
|
};
|
|
275
|
-
await
|
|
446
|
+
await set('tariffProvider.statusJson', JSON.stringify(snapshot));
|
|
447
|
+
if (!this._isCurrent(generation)) return;
|
|
448
|
+
this._lastCurrentKey = publishedKey;
|
|
449
|
+
this._lastPublishedFresh = fresh;
|
|
450
|
+
this._lastPublishedSuccessMs = this._lastSuccessMs;
|
|
451
|
+
if (this.adapter._nwTariffInvalidation === this._priceReaderFence) delete this.adapter._nwTariffInvalidation;
|
|
276
452
|
try { this.adapter._tariffProviderSnapshot = snapshot; } catch (_e) {}
|
|
277
453
|
}
|
|
278
454
|
|
|
279
455
|
/** Die Registry validiert alle Intervalle vor der Übernahme. Abruffehler
|
|
280
456
|
* behalten den letzten gültigen Stand und dessen Erfolgszeit; _publish
|
|
281
457
|
* setzt nach Ablauf der vorhandenen Frischegrenze die Preise auf null. */
|
|
282
|
-
async _refresh(cfg, nowMs) {
|
|
458
|
+
async _refresh(cfg, nowMs, generation = this._generation) {
|
|
459
|
+
if (!this._isCurrent(generation)) return;
|
|
283
460
|
this._lastFetchMs = nowMs;
|
|
284
461
|
try {
|
|
285
462
|
const result = await fetchProvider(cfg);
|
|
463
|
+
if (!this._isCurrent(generation)) return;
|
|
286
464
|
const intervals = Array.isArray(result && result.intervals) ? result.intervals : [];
|
|
287
465
|
if (!intervals.length) throw new Error('provider_returned_no_intervals');
|
|
288
466
|
// Historische Parser bleiben für Diagnose verwendbar. Erst hier an
|
|
@@ -295,19 +473,35 @@ class TariffProviderModule extends BaseModule {
|
|
|
295
473
|
this._lastError = '';
|
|
296
474
|
this._consecutiveErrors = 0;
|
|
297
475
|
this._scheduleNextFetch(cfg, this._lastSuccessMs, true);
|
|
298
|
-
await this._publish(cfg, this._lastSuccessMs, 'ok');
|
|
476
|
+
await this._publish(cfg, this._lastSuccessMs, 'ok', generation);
|
|
299
477
|
} catch (e) {
|
|
478
|
+
if (!this._isCurrent(generation)) return;
|
|
479
|
+
if (e && e.message === 'TARIFF_STATE_WRITE_FAILED') {
|
|
480
|
+
this._invalidationPending = true;
|
|
481
|
+
await this.invalidateConfiguration();
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
300
484
|
const failedAt = Date.now();
|
|
301
485
|
this._consecutiveErrors += 1;
|
|
302
486
|
this._lastError = String(e && e.message || e || 'provider_error').slice(0, 500);
|
|
303
487
|
this._scheduleNextFetch(cfg, failedAt, false);
|
|
304
488
|
try { this.adapter.log.warn(`[TariffProvider] ${cfg.providerId}: ${this._lastError}`); } catch (_e) {}
|
|
305
|
-
await this._publish(cfg, failedAt, this._intervals.length ? 'degraded' : 'error');
|
|
489
|
+
await this._publish(cfg, failedAt, this._intervals.length ? 'degraded' : 'error', generation);
|
|
306
490
|
}
|
|
307
491
|
}
|
|
308
492
|
|
|
309
493
|
async tick() {
|
|
310
|
-
|
|
494
|
+
if (this._stopped || this.adapter?._nwShuttingDown) return;
|
|
495
|
+
if (this._mappingPromise) await this._mappingPromise;
|
|
496
|
+
// The common 1-s path compares references only; secrets are not hashed
|
|
497
|
+
// on every regulation tick. Save/import explicitly invokes the hook.
|
|
498
|
+
if (this._invalidationPending || this._configurationSource !== this.adapter?.config?.tariffProvider
|
|
499
|
+
|| this._configurationCountry !== this.adapter?.config?.countryProfile?.country) {
|
|
500
|
+
await this.invalidateConfiguration();
|
|
501
|
+
}
|
|
502
|
+
const cfg = this._configuration;
|
|
503
|
+
const generation = this._generation;
|
|
504
|
+
if (!this._isCurrent(generation)) return;
|
|
311
505
|
const nowMs = Date.now();
|
|
312
506
|
if (!cfg.enabled || cfg.providerId === 'manual-dp') {
|
|
313
507
|
this._intervals = [];
|
|
@@ -315,26 +509,32 @@ class TariffProviderModule extends BaseModule {
|
|
|
315
509
|
this._consecutiveErrors = 0;
|
|
316
510
|
this._effectiveRefreshMinutes = 0;
|
|
317
511
|
this._nextFetchMs = 0;
|
|
318
|
-
|
|
319
|
-
await this.
|
|
320
|
-
await this.
|
|
321
|
-
await this._set('tariffProvider.status', cfg.enabled ? 'manual-datapoints' : 'disabled');
|
|
322
|
-
await this._set('tariffProvider.fresh', false);
|
|
323
|
-
await this._set('tariffProvider.currentPriceEurPerKwh', null);
|
|
324
|
-
await this._set('tariffProvider.averagePriceEurPerKwh', null);
|
|
325
|
-
await this._set('tariffProvider.pricesTodayJson', '[]');
|
|
326
|
-
await this._set('tariffProvider.pricesTomorrowJson', '[]');
|
|
327
|
-
await this._set('tariffProvider.normalizedJson', '[]');
|
|
512
|
+
this._lastSuccessMs = 0;
|
|
513
|
+
await this._publish(cfg, nowMs, cfg.enabled ? 'manual-datapoints' : 'disabled', generation);
|
|
514
|
+
await this._publicationTail;
|
|
328
515
|
return;
|
|
329
516
|
}
|
|
330
517
|
|
|
331
|
-
await this._setTariffSettings(cfg);
|
|
518
|
+
await this._setTariffSettings(cfg, generation);
|
|
519
|
+
if (!this._isCurrent(generation)) return;
|
|
332
520
|
if (!this._fetchPromise && (!this._lastFetchMs || nowMs >= this._nextFetchMs || !this._intervals.length)) {
|
|
333
|
-
|
|
521
|
+
const operation = this._refresh(cfg, nowMs, generation).finally(() => {
|
|
522
|
+
if (this._fetchPromise === operation) this._fetchPromise = null;
|
|
523
|
+
});
|
|
524
|
+
this._fetchPromise = operation;
|
|
334
525
|
await this._fetchPromise;
|
|
526
|
+
await this._publicationTail;
|
|
335
527
|
return;
|
|
336
528
|
}
|
|
337
|
-
await this._publish(cfg, nowMs);
|
|
529
|
+
await this._publish(cfg, nowMs, '', generation);
|
|
530
|
+
await this._publicationTail;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
stop() {
|
|
534
|
+
this._stopped = true;
|
|
535
|
+
this._generation++;
|
|
536
|
+
this._intervals = [];
|
|
537
|
+
this._lastSuccessMs = 0;
|
|
338
538
|
}
|
|
339
539
|
}
|
|
340
540
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* AUTO-GENERATED RUNTIME FILE - NICHT MANUELL BEARBEITEN.
|
|
8
8
|
*
|
|
9
9
|
* Quelle: src-ts/runtime-executables/ems/services/tariff-provider-registry.ts
|
|
10
|
-
* Quell-Hash: sha256:
|
|
10
|
+
* Quell-Hash: sha256:ccedb21357657cc4dd04ef45dba76592fe81aa5154366185d65b0dd524a4cb6b
|
|
11
11
|
* Erzeugung: npm run sync:ts-runtime-executables
|
|
12
12
|
*
|
|
13
13
|
* Zweck:
|
|
@@ -62,7 +62,7 @@ const PROVIDERS = Object.freeze([
|
|
|
62
62
|
sourceType: 'graphql',
|
|
63
63
|
directApi: true,
|
|
64
64
|
requires: ['accessToken'],
|
|
65
|
-
supportsResolution: [15
|
|
65
|
+
supportsResolution: [15],
|
|
66
66
|
description: 'Direkte GraphQL-Integration; persönlicher Token oder registrierter OAuth-Client.',
|
|
67
67
|
},
|
|
68
68
|
{
|
|
@@ -297,7 +297,11 @@ function splitTodayTomorrow(intervals, nowMs = Date.now(), timeZone = 'Europe/Be
|
|
|
297
297
|
}
|
|
298
298
|
};
|
|
299
299
|
const todayKey = dateKey(nowMs);
|
|
300
|
-
|
|
300
|
+
// Advance the local calendar date, not the current instant by 24 hours.
|
|
301
|
+
// DST days have 23/25 hours; adding 24h can select today or the day after.
|
|
302
|
+
const tomorrowCalendar = new Date(`${todayKey}T12:00:00.000Z`);
|
|
303
|
+
tomorrowCalendar.setUTCDate(tomorrowCalendar.getUTCDate() + 1);
|
|
304
|
+
const tomorrowKey = tomorrowCalendar.toISOString().slice(0, 10);
|
|
301
305
|
const today = [];
|
|
302
306
|
const tomorrow = [];
|
|
303
307
|
for (const row of intervals || []) {
|
|
@@ -316,8 +320,8 @@ function currentAndAverage(intervals, nowMs = Date.now()) {
|
|
|
316
320
|
return { current: active ? Number(active.total) : null, average };
|
|
317
321
|
}
|
|
318
322
|
|
|
319
|
-
function buildTibberQuery(
|
|
320
|
-
const resolution =
|
|
323
|
+
function buildTibberQuery() {
|
|
324
|
+
const resolution = 'QUARTER_HOURLY';
|
|
321
325
|
return `query NexoWattPriceInfo { viewer { homes { id appNickname address { address1 postalCode city country } currentSubscription { priceInfo(resolution: ${resolution}) { current { total energy tax startsAt level currency } today { total energy tax startsAt level currency } tomorrow { total energy tax startsAt level currency } } } } } }`;
|
|
322
326
|
}
|
|
323
327
|
|
|
@@ -330,9 +334,8 @@ function normalizeTibber(payload, config = {}) {
|
|
|
330
334
|
const priceInfo = getByPath(home, 'currentSubscription.priceInfo');
|
|
331
335
|
if (!priceInfo || !Array.isArray(priceInfo.today) || !priceInfo.today.length || (priceInfo.tomorrow !== undefined && !Array.isArray(priceInfo.tomorrow))) throw new Error('tibber_no_price_info');
|
|
332
336
|
const rows = [...priceInfo.today, ...(priceInfo.tomorrow || [])];
|
|
333
|
-
const resolutionMinutes = Number(config.resolutionMinutes) <= 15 ? 15 : 60;
|
|
334
337
|
const intervals = normalizeRows(rows, {
|
|
335
|
-
resolutionMinutes,
|
|
338
|
+
resolutionMinutes: 15,
|
|
336
339
|
priceComponent: 'total',
|
|
337
340
|
unit: 'EUR/kWh',
|
|
338
341
|
formula: { priceIncludesVat: true },
|
|
@@ -640,7 +643,7 @@ async function fetchTibber(config = {}, signal) {
|
|
|
640
643
|
'Authorization': `Bearer ${token}`,
|
|
641
644
|
'User-Agent': String(config.userAgent || DEFAULT_USER_AGENT),
|
|
642
645
|
},
|
|
643
|
-
body: JSON.stringify({ query: buildTibberQuery(
|
|
646
|
+
body: JSON.stringify({ query: buildTibberQuery() }),
|
|
644
647
|
}, signal);
|
|
645
648
|
if (!payload || typeof payload !== 'object' || Array.isArray(payload)) throw new Error('tibber_invalid_response');
|
|
646
649
|
if (payload.errors !== undefined && !Array.isArray(payload.errors)) throw new Error('tibber_invalid_response');
|
package/ui/io-package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "nexowatt-ui",
|
|
4
|
-
"version": "9.0.
|
|
4
|
+
"version": "9.0.19",
|
|
5
5
|
"news": {
|
|
6
|
+
"9.0.18": {
|
|
7
|
+
"en": "Automatic supported-device commissioning and explicit EMS/energy-flow roles. Existing mappings and data points are preserved; new control targets require commissioning.",
|
|
8
|
+
"de": "Automatische Zuordnung unterstützter Geräte mit expliziten EMS- und Energiefluss-Rollen. Vorhandene Zuordnungen und Datenpunkte bleiben erhalten; neue Regelziele benötigen eine Inbetriebnahme."
|
|
9
|
+
},
|
|
6
10
|
"9.0.17": {
|
|
7
11
|
"de": "EOS-Sitzungen vom ioBroker Admin getrennt; automatische Änderungen fremder Rechte und Metadaten entfernt; Parallelbetrieb mit Standard-Backitup abgesichert.",
|
|
8
12
|
"en": "Isolate EOS sessions from ioBroker Admin; remove automatic foreign permission and metadata changes; preserve standard Backitup coexistence."
|