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
|
@@ -29,6 +29,7 @@ const { MbusDriver } = require('./drivers/mbus');
|
|
|
29
29
|
const { KostalTcpDriver } = require('./drivers/kostalTcp');
|
|
30
30
|
const { KostalRs485Driver } = require('./drivers/kostalRs485');
|
|
31
31
|
const { TaCmiDriver } = require('./drivers/taCmi');
|
|
32
|
+
const { isEnergyFreshnessClass, isEnergyFreshnessAlias, captureAliasSources, hasNewAliasSample } = require('./deviceAliasFreshness');
|
|
32
33
|
|
|
33
34
|
const ABL_EMH1_LIVE_ALIAS_PATHS = new Set([
|
|
34
35
|
'r.currentL1',
|
|
@@ -47,10 +48,10 @@ const ABL_EMH1_LIVE_ALIAS_PATHS = new Set([
|
|
|
47
48
|
// suppresses identical writes, which can make an upstream load-management
|
|
48
49
|
// failsafe classify a healthy charger as stale.
|
|
49
50
|
//
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
// aliases remain change-only to
|
|
51
|
+
// EV charger feedback keeps its established refresh policy below. Operational
|
|
52
|
+
// meter/storage/PV aliases use deviceAliasFreshness as well, with exact sampled
|
|
53
|
+
// source evidence for polled, Speedwire and MQTT data. Static metadata, energy
|
|
54
|
+
// counters and command aliases remain change-only to bound state/history traffic.
|
|
54
55
|
const EV_CHARGER_FRESHNESS_ALIAS_PATHS = new Set([
|
|
55
56
|
'comm.connected',
|
|
56
57
|
'alarm.offline',
|
|
@@ -110,6 +111,9 @@ class DeviceRuntime {
|
|
|
110
111
|
this.driver = null;
|
|
111
112
|
this.pollTimer = null;
|
|
112
113
|
this._pollLoopActive = false;
|
|
114
|
+
this._lifecycleGeneration = 0;
|
|
115
|
+
/** @type {Promise<void> | null} */
|
|
116
|
+
this._initialPollPromise = null;
|
|
113
117
|
|
|
114
118
|
// Stop optional write loop and clear queued writes
|
|
115
119
|
try {
|
|
@@ -190,6 +194,7 @@ class DeviceRuntime {
|
|
|
190
194
|
this._writeThrottleMs = 0;
|
|
191
195
|
this._writeQueueMaxPerTick = 1;
|
|
192
196
|
this._writeQueue = new Map(); // dpId -> { dp, deviceValue, ackByRelId, attempts, isPreWrite, preWriteTriggerDpId }
|
|
197
|
+
this._lastSuccessfulQueuedValueByDpId = new Map();
|
|
193
198
|
this._writeLoopActive = false;
|
|
194
199
|
this._writeTimer = null;
|
|
195
200
|
this._writeLoopBusy = false;
|
|
@@ -219,7 +224,7 @@ class DeviceRuntime {
|
|
|
219
224
|
this._hbLastSourceStamp = 0;
|
|
220
225
|
|
|
221
226
|
// Cache last adapter-written values per state. This avoids flooding ioBroker with
|
|
222
|
-
// unchanged setState() calls on every poll cycle.
|
|
227
|
+
// unchanged setState() calls on every poll cycle. Operational energy/EV
|
|
223
228
|
// aliases can opt into a bounded periodic refresh so their ioBroker timestamp
|
|
224
229
|
// proves that a new device snapshot was actually received.
|
|
225
230
|
this._stateCache = new Map(); // relId -> { val, ack, writtenAt }
|
|
@@ -689,7 +694,7 @@ class DeviceRuntime {
|
|
|
689
694
|
}
|
|
690
695
|
|
|
691
696
|
_computeLiveAliasRefreshMs({ fastIntervalMs, isEventDriven } = {}) {
|
|
692
|
-
if (this.aliasDeviceClass !== 'evCharger') return 0;
|
|
697
|
+
if (this.aliasDeviceClass !== 'evCharger' && !isEnergyFreshnessClass(this.aliasDeviceClass)) return 0;
|
|
693
698
|
|
|
694
699
|
const candidates = [
|
|
695
700
|
this.cfg && this.cfg.liveStatusRefreshMs,
|
|
@@ -730,11 +735,24 @@ class DeviceRuntime {
|
|
|
730
735
|
return !!path && EV_CHARGER_FRESHNESS_ALIAS_PATHS.has(path);
|
|
731
736
|
}
|
|
732
737
|
|
|
733
|
-
_liveAliasRefreshOptions(relId, values, ctx) {
|
|
738
|
+
_liveAliasRefreshOptions(relId, values, ctx, sourceIds = []) {
|
|
734
739
|
if (!(this._liveAliasRefreshMs > 0)) return undefined;
|
|
735
|
-
|
|
736
|
-
if (
|
|
740
|
+
const energyAlias = isEnergyFreshnessAlias(this.aliasDeviceClass, legacyAliasPath(relId));
|
|
741
|
+
if (!this._isEvChargerFreshnessAlias(relId) && !energyAlias) return undefined;
|
|
742
|
+
if (ctx && (ctx.connected === false || ctx.diagnosticsOnly === true)) return undefined;
|
|
737
743
|
if (!values || typeof values !== 'object' || Object.keys(values).length === 0) return undefined;
|
|
744
|
+
if (energyAlias) {
|
|
745
|
+
const path = legacyAliasPath(relId);
|
|
746
|
+
const connectionAlias = path === 'comm.connected' || path === 'alarm.offline';
|
|
747
|
+
if (!hasNewAliasSample({
|
|
748
|
+
protocol: String(this.cfg.protocol || '').toLowerCase(),
|
|
749
|
+
sourceIds: connectionAlias ? Object.keys(values) : sourceIds,
|
|
750
|
+
values,
|
|
751
|
+
lastWriteMs: Number(this._stateCache.get(String(relId))?.writtenAt) || 0,
|
|
752
|
+
sampleTimestamp: Number(this.driver?.lastSeen),
|
|
753
|
+
sourceTimestamps: this.driver?.updatedAtByDpId,
|
|
754
|
+
})) return undefined;
|
|
755
|
+
}
|
|
738
756
|
return { refreshAfterMs: this._liveAliasRefreshMs };
|
|
739
757
|
}
|
|
740
758
|
|
|
@@ -995,10 +1013,10 @@ class DeviceRuntime {
|
|
|
995
1013
|
await this._setStateCached(relId, this._hbLastSeen || now, true);
|
|
996
1014
|
}
|
|
997
1015
|
|
|
998
|
-
// Keep the online state timestamp fresh for EV
|
|
1016
|
+
// Keep the online state timestamp fresh for live energy/EV devices as an additional
|
|
999
1017
|
// liveness signal. This is still tied to real incoming data; no timer fabricates
|
|
1000
1018
|
// freshness while communication is down.
|
|
1001
|
-
if (this.
|
|
1019
|
+
if (this._liveAliasRefreshMs > 0) {
|
|
1002
1020
|
for (const relId of this._hbRelIds('online')) {
|
|
1003
1021
|
await this._setStateCached(relId, true, true, { refreshAfterMs: this._liveAliasRefreshMs });
|
|
1004
1022
|
}
|
|
@@ -4927,12 +4945,12 @@ class DeviceRuntime {
|
|
|
4927
4945
|
const asBool = (typeof v === 'boolean') ? v : (Number.isFinite(Number(v)) ? Number(v) !== 0 : undefined);
|
|
4928
4946
|
if (asBool === false) return stopCurrentA;
|
|
4929
4947
|
if (asBool === true) {
|
|
4930
|
-
// For
|
|
4948
|
+
// For MENNEKES the release switch must not overwrite an already commanded
|
|
4931
4949
|
// dynamic current limit. Min+PV/PV modes often write 6 A first and then
|
|
4932
4950
|
// set run=true; returning a hard-coded 16 A here would cancel that 6 A
|
|
4933
4951
|
// command. Reuse the latest desired current if present, otherwise fall
|
|
4934
4952
|
// back to the configured release current.
|
|
4935
|
-
const key = String(
|
|
4953
|
+
const key = String(currentLimitDp.id);
|
|
4936
4954
|
const lastCmd = this._lastCommandedValueByDpId && this._lastCommandedValueByDpId.has(key)
|
|
4937
4955
|
? Number(this._lastCommandedValueByDpId.get(key))
|
|
4938
4956
|
: NaN;
|
|
@@ -6469,6 +6487,7 @@ class DeviceRuntime {
|
|
|
6469
6487
|
if (this.template?.driverHints?.oemModbusV1003 && def.commandOnlyAlias === true) continue;
|
|
6470
6488
|
|
|
6471
6489
|
let outVal;
|
|
6490
|
+
let sampleSourceIds = [];
|
|
6472
6491
|
|
|
6473
6492
|
if (def.kind === 'dp') {
|
|
6474
6493
|
if (!def.dpId) continue;
|
|
@@ -6491,6 +6510,7 @@ class DeviceRuntime {
|
|
|
6491
6510
|
continue;
|
|
6492
6511
|
}
|
|
6493
6512
|
raw = v[def.dpId];
|
|
6513
|
+
sampleSourceIds = [def.dpId];
|
|
6494
6514
|
}
|
|
6495
6515
|
|
|
6496
6516
|
if (typeof def.fromDevice === 'function') {
|
|
@@ -6502,7 +6522,13 @@ class DeviceRuntime {
|
|
|
6502
6522
|
} else if (def.kind === 'computed') {
|
|
6503
6523
|
if (typeof def.get !== 'function') continue;
|
|
6504
6524
|
try {
|
|
6505
|
-
|
|
6525
|
+
if (isEnergyFreshnessAlias(this.aliasDeviceClass, legacyAliasPath(def.relId))) {
|
|
6526
|
+
const observed = captureAliasSources(v, snapshot => def.get(snapshot, c));
|
|
6527
|
+
outVal = observed.value;
|
|
6528
|
+
sampleSourceIds = observed.sourceIds;
|
|
6529
|
+
} else {
|
|
6530
|
+
outVal = def.get(v, c);
|
|
6531
|
+
}
|
|
6506
6532
|
} catch (e) {
|
|
6507
6533
|
// Never let one broken computed alias kill the device update loop
|
|
6508
6534
|
if (!this._aliasErrTs) this._aliasErrTs = {};
|
|
@@ -6524,7 +6550,7 @@ class DeviceRuntime {
|
|
|
6524
6550
|
def.relId,
|
|
6525
6551
|
outVal,
|
|
6526
6552
|
true,
|
|
6527
|
-
this._liveAliasRefreshOptions(def.relId, v, c),
|
|
6553
|
+
this._liveAliasRefreshOptions(def.relId, v, c, sampleSourceIds),
|
|
6528
6554
|
);
|
|
6529
6555
|
}
|
|
6530
6556
|
}
|
|
@@ -6535,7 +6561,7 @@ class DeviceRuntime {
|
|
|
6535
6561
|
// Metadata and error envelopes can change aliases without proving live
|
|
6536
6562
|
// telemetry. Preserve transport errors and the existing heartbeat state.
|
|
6537
6563
|
const lastError = String(this._stateCache.get(`${this.baseId}.info.lastError`)?.val || '');
|
|
6538
|
-
await this._updateAliases(values || {}, { connected: this._hbOnline === true, lastError }).catch(() => {});
|
|
6564
|
+
await this._updateAliases(values || {}, { connected: this._hbOnline === true, lastError, diagnosticsOnly: true }).catch(() => {});
|
|
6539
6565
|
return;
|
|
6540
6566
|
}
|
|
6541
6567
|
const connected = context.connected !== false;
|
|
@@ -6636,9 +6662,11 @@ class DeviceRuntime {
|
|
|
6636
6662
|
throw new Error(`Unsupported protocol: ${proto}`);
|
|
6637
6663
|
}
|
|
6638
6664
|
|
|
6639
|
-
|
|
6665
|
+
/** @param {{backgroundInitialPoll?: boolean}} [options] */
|
|
6666
|
+
async start({ backgroundInitialPoll = false } = {}) {
|
|
6640
6667
|
if (this.started) return;
|
|
6641
6668
|
this.started = true;
|
|
6669
|
+
const lifecycleGeneration = ++this._lifecycleGeneration;
|
|
6642
6670
|
|
|
6643
6671
|
if (this.cfg.enabled === false) {
|
|
6644
6672
|
this.adapter.log.info(`[${this.cfg.id}] disabled - skipping`);
|
|
@@ -6646,6 +6674,19 @@ class DeviceRuntime {
|
|
|
6646
6674
|
}
|
|
6647
6675
|
|
|
6648
6676
|
this.driver = this._createDriver();
|
|
6677
|
+
const startupDriver = this.driver;
|
|
6678
|
+
const current = () => this.started && this._lifecycleGeneration === lifecycleGeneration && this.driver === startupDriver;
|
|
6679
|
+
/** @param {() => Promise<void>} operation */
|
|
6680
|
+
const runInitial = async operation => {
|
|
6681
|
+
if (!backgroundInitialPoll) { await operation(); return; }
|
|
6682
|
+
// Hosted metadata readiness is independent of the first network response.
|
|
6683
|
+
// Retain the original promise so stop can cancel the transport and drain it.
|
|
6684
|
+
const pending = Promise.resolve().then(operation).catch(() => {
|
|
6685
|
+
if (current()) this.adapter.log.warn(`[${this.cfg.id}] EOS_DEVICES_INITIAL_POLL_FAILED; inspect device connection status`);
|
|
6686
|
+
});
|
|
6687
|
+
this._initialPollPromise = pending;
|
|
6688
|
+
void pending.then(() => { if (this._initialPollPromise === pending) this._initialPollPromise = null; });
|
|
6689
|
+
};
|
|
6649
6690
|
|
|
6650
6691
|
// Heartbeat session init: start "offline" until we receive *real* data.
|
|
6651
6692
|
// (We still keep the counter monotonic across restarts.)
|
|
@@ -6657,6 +6698,7 @@ class DeviceRuntime {
|
|
|
6657
6698
|
await this._setStateCached(this._hbRelId('online'), false, true);
|
|
6658
6699
|
await this._setStateCached(this._hbRelId('lastSeenMs'), 0, true);
|
|
6659
6700
|
await this._resetAblEmh1LiveMeasurements();
|
|
6701
|
+
if (!current()) return;
|
|
6660
6702
|
|
|
6661
6703
|
// Event-driven protocols (no polling)
|
|
6662
6704
|
if (this.cfg.protocol === 'mqtt' || this.cfg.protocol === 'canbus') {
|
|
@@ -6667,15 +6709,18 @@ class DeviceRuntime {
|
|
|
6667
6709
|
await this._setStateCached(`${this.baseId}.info.connection`, false, true);
|
|
6668
6710
|
await this._setStateCached(`${this.baseId}.info.lastError`, '', true);
|
|
6669
6711
|
await this._updateAliases({}, { connected: false, lastError: '' }).catch(() => {});
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6712
|
+
await runInitial(async () => {
|
|
6713
|
+
if (!current()) return;
|
|
6714
|
+
try {
|
|
6715
|
+
await startupDriver.connect(this.getDatapoints());
|
|
6716
|
+
} catch (e) {
|
|
6717
|
+
if (current()) await this._setError(e);
|
|
6718
|
+
}
|
|
6719
|
+
if (!current()) return;
|
|
6720
|
+
// Heartbeat timeout for push protocols
|
|
6721
|
+
this._hbTimeoutMs = this._computeHeartbeatTimeoutMs({ isEventDriven: true });
|
|
6722
|
+
this._startHeartbeatChecker();
|
|
6723
|
+
});
|
|
6679
6724
|
|
|
6680
6725
|
// Both event-driven drivers own their actual transport status; heartbeat
|
|
6681
6726
|
// remains tied to received device data.
|
|
@@ -6772,6 +6817,7 @@ class DeviceRuntime {
|
|
|
6772
6817
|
|
|
6773
6818
|
// Reset per-start runtime state
|
|
6774
6819
|
this._writeQueue.clear();
|
|
6820
|
+
this._lastSuccessfulQueuedValueByDpId.clear();
|
|
6775
6821
|
this._writeBusy = false;
|
|
6776
6822
|
|
|
6777
6823
|
// Optional: restore last control setpoints on start/reconnect (template hinted).
|
|
@@ -6802,11 +6848,12 @@ class DeviceRuntime {
|
|
|
6802
6848
|
|
|
6803
6849
|
|
|
6804
6850
|
const doPoll = async (dps) => {
|
|
6805
|
-
if (!
|
|
6851
|
+
if (!current()) return;
|
|
6806
6852
|
const pollDps = Array.isArray(dps) ? dps : allDps;
|
|
6807
6853
|
try {
|
|
6808
6854
|
const wasOk = this._connOk;
|
|
6809
|
-
const values = await
|
|
6855
|
+
const values = await startupDriver.readDatapoints(pollDps);
|
|
6856
|
+
if (!current()) return;
|
|
6810
6857
|
const hasData = values && typeof values === 'object' && Object.entries(values).some(([id, value]) =>
|
|
6811
6858
|
this.dpById.has(id) && value !== null && value !== undefined &&
|
|
6812
6859
|
(typeof value !== 'number' || Number.isFinite(value))
|
|
@@ -6843,6 +6890,7 @@ class DeviceRuntime {
|
|
|
6843
6890
|
}
|
|
6844
6891
|
|
|
6845
6892
|
for (const [dpId, rawVal] of Object.entries(values)) {
|
|
6893
|
+
if (!current()) return;
|
|
6846
6894
|
const dp = this.dpById.get(dpId);
|
|
6847
6895
|
if (!dp) continue;
|
|
6848
6896
|
|
|
@@ -6866,9 +6914,9 @@ class DeviceRuntime {
|
|
|
6866
6914
|
await this._setStateCached(relId, val, true);
|
|
6867
6915
|
}
|
|
6868
6916
|
|
|
6869
|
-
await this._updateAliases(values, { connected: true, lastError: '' });
|
|
6917
|
+
if (current()) await this._updateAliases(values, { connected: true, lastError: '' });
|
|
6870
6918
|
} catch (e) {
|
|
6871
|
-
await this._setError(e);
|
|
6919
|
+
if (current()) await this._setError(e);
|
|
6872
6920
|
}
|
|
6873
6921
|
};
|
|
6874
6922
|
|
|
@@ -6876,117 +6924,138 @@ class DeviceRuntime {
|
|
|
6876
6924
|
// Some devices close the Modbus session on optional/unsupported registers; templates can
|
|
6877
6925
|
// start with the fast set first so core data comes online immediately.
|
|
6878
6926
|
const initialFastOnly = !!(tplPolling && (tplPolling.initialFastOnly === true || String(tplPolling.initialFastOnly).toLowerCase() === 'true'));
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
this._pollLoopActive = true;
|
|
6883
|
-
|
|
6884
|
-
const self = this;
|
|
6885
|
-
let nextFastAt = Date.now() + fastIntervalMs;
|
|
6886
|
-
let nextSlowAt = useSplitPolling ? (Date.now() + slowIntervalMs) : Number.POSITIVE_INFINITY;
|
|
6887
|
-
|
|
6888
|
-
let loopFn = null;
|
|
6927
|
+
const initializePolling = async () => {
|
|
6928
|
+
await doPoll(initialFastOnly ? fastDps : slowDps);
|
|
6929
|
+
if (!current()) return;
|
|
6889
6930
|
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
const d = Math.max(0, Number(delay) || 0);
|
|
6893
|
-
if (self.pollTimer) {
|
|
6894
|
-
clearTimeout(self.pollTimer);
|
|
6895
|
-
self.pollTimer = null;
|
|
6896
|
-
}
|
|
6897
|
-
self.pollTimer = setTimeout(() => {
|
|
6898
|
-
if (loopFn) loopFn().catch(() => {});
|
|
6899
|
-
}, Math.max(fixedFastCadence ? 25 : 250, d));
|
|
6900
|
-
}
|
|
6931
|
+
// Self-scheduling poll loop (prevents overlaps/backlog and keeps cadence stable).
|
|
6932
|
+
this._pollLoopActive = true;
|
|
6901
6933
|
|
|
6902
|
-
|
|
6903
|
-
|
|
6934
|
+
const self = this;
|
|
6935
|
+
let nextFastAt = Date.now() + fastIntervalMs;
|
|
6936
|
+
let nextSlowAt = useSplitPolling ? (Date.now() + slowIntervalMs) : Number.POSITIVE_INFINITY;
|
|
6904
6937
|
|
|
6905
|
-
|
|
6906
|
-
const now = cycleStartedAt;
|
|
6907
|
-
const runSlow = useSplitPolling && now >= nextSlowAt;
|
|
6938
|
+
let loopFn = null;
|
|
6908
6939
|
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6915
|
-
|
|
6916
|
-
|
|
6917
|
-
|
|
6918
|
-
|
|
6919
|
-
const nextFastBaseAt = fixedFastCadence ? cycleStartedAt : finishedAt;
|
|
6920
|
-
if (runSlow) {
|
|
6921
|
-
nextSlowAt = finishedAt + slowIntervalMs;
|
|
6922
|
-
nextFastAt = Math.max(finishedAt, nextFastBaseAt + fastIntervalMs);
|
|
6923
|
-
} else {
|
|
6924
|
-
nextFastAt = Math.max(finishedAt, nextFastBaseAt + fastIntervalMs);
|
|
6940
|
+
function scheduleNext(delay) {
|
|
6941
|
+
if (!current() || !self._pollLoopActive) return;
|
|
6942
|
+
const d = Math.max(0, Number(delay) || 0);
|
|
6943
|
+
if (self.pollTimer) {
|
|
6944
|
+
clearTimeout(self.pollTimer);
|
|
6945
|
+
self.pollTimer = null;
|
|
6946
|
+
}
|
|
6947
|
+
self.pollTimer = setTimeout(() => {
|
|
6948
|
+
if (loopFn) loopFn().catch(() => {});
|
|
6949
|
+
}, Math.max(fixedFastCadence ? 25 : 250, d));
|
|
6925
6950
|
}
|
|
6926
6951
|
|
|
6927
|
-
|
|
6952
|
+
async function pollLoop() {
|
|
6953
|
+
if (!current() || !self._pollLoopActive || !self.driver) return;
|
|
6928
6954
|
|
|
6929
|
-
|
|
6930
|
-
|
|
6931
|
-
|
|
6932
|
-
|
|
6933
|
-
async function cadenceLoop() {
|
|
6934
|
-
if (!self._pollLoopActive || !self.driver) return;
|
|
6935
|
-
|
|
6936
|
-
const cycleStartedAt = Date.now();
|
|
6937
|
-
const now = cycleStartedAt;
|
|
6938
|
-
const runSlow = useSplitPolling && now >= nextSlowAt;
|
|
6939
|
-
const runFast = now >= nextFastAt;
|
|
6940
|
-
|
|
6941
|
-
const hasQueuedWrites = !!(self._writeQueue && self._writeQueue.size > 0);
|
|
6955
|
+
const cycleStartedAt = Date.now();
|
|
6956
|
+
const now = cycleStartedAt;
|
|
6957
|
+
const runSlow = useSplitPolling && now >= nextSlowAt;
|
|
6942
6958
|
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6946
|
-
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6959
|
+
// Default profiles schedule from completion to avoid catch-up loops. Fast closed-loop
|
|
6960
|
+
// profiles may opt into a fixed start-to-start cadence. If a poll overruns its target,
|
|
6961
|
+
// the self-scheduling loop still never overlaps; it simply continues as soon as safe.
|
|
6962
|
+
if (runSlow) {
|
|
6963
|
+
await doPoll(slowDps);
|
|
6964
|
+
} else {
|
|
6965
|
+
await doPoll(fastDps);
|
|
6950
6966
|
}
|
|
6951
|
-
|
|
6952
|
-
await doPoll(slowDps);
|
|
6953
|
-
const finishedAt = Date.now();
|
|
6954
|
-
const nextFastBaseAt = fixedFastCadence ? cycleStartedAt : finishedAt;
|
|
6955
|
-
nextSlowAt = finishedAt + slowIntervalMs;
|
|
6956
|
-
nextFastAt = Math.max(finishedAt, nextFastBaseAt + fastIntervalMs);
|
|
6957
|
-
} else if (runFast) {
|
|
6958
|
-
await doPoll(fastDps);
|
|
6967
|
+
|
|
6959
6968
|
const finishedAt = Date.now();
|
|
6960
6969
|
const nextFastBaseAt = fixedFastCadence ? cycleStartedAt : finishedAt;
|
|
6961
|
-
|
|
6962
|
-
|
|
6970
|
+
if (runSlow) {
|
|
6971
|
+
nextSlowAt = finishedAt + slowIntervalMs;
|
|
6972
|
+
nextFastAt = Math.max(finishedAt, nextFastBaseAt + fastIntervalMs);
|
|
6973
|
+
} else {
|
|
6974
|
+
nextFastAt = Math.max(finishedAt, nextFastBaseAt + fastIntervalMs);
|
|
6975
|
+
}
|
|
6963
6976
|
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
|
|
6977
|
+
if (!current() || !self._pollLoopActive || !self.driver) return;
|
|
6978
|
+
|
|
6979
|
+
const nextAt = Math.min(nextFastAt, nextSlowAt);
|
|
6980
|
+
scheduleNext(nextAt - Date.now());
|
|
6981
|
+
}
|
|
6982
|
+
|
|
6983
|
+
let writeCyclesSincePoll = 0;
|
|
6984
|
+
async function cadenceLoop() {
|
|
6985
|
+
if (!current() || !self._pollLoopActive || !self.driver) return;
|
|
6986
|
+
|
|
6987
|
+
const cycleStartedAt = Date.now();
|
|
6988
|
+
const now = cycleStartedAt;
|
|
6989
|
+
const runSlow = useSplitPolling && now >= nextSlowAt;
|
|
6990
|
+
const runFast = now >= nextFastAt;
|
|
6991
|
+
|
|
6992
|
+
const hasQueuedWrites = !!(self._writeQueue && self._writeQueue.size > 0);
|
|
6993
|
+
const nextWrite = hasQueuedWrites ? self._pickNextQueuedWrite() : null;
|
|
6994
|
+
const queued = nextWrite && nextWrite[1];
|
|
6995
|
+
// A new zero power/current command gets one extra slot before a due read.
|
|
6996
|
+
// Repeated already-sent zero commands must not keep an offline/freshness
|
|
6997
|
+
// stop loop from obtaining the measurements needed to recover safely.
|
|
6998
|
+
const urgentStop = queued && queued.deviceValue === 0 && !queued.meta?.isPreWrite &&
|
|
6999
|
+
['W', 'kW', 'A'].includes(queued.dp?.unit) &&
|
|
7000
|
+
self._lastSuccessfulQueuedValueByDpId.get(String(queued.dp.id)) !== 0;
|
|
7001
|
+
const readDue = runSlow || runFast;
|
|
7002
|
+
const writeBeforeRead = !readDue || writeCyclesSincePoll === 0 || (urgentStop && writeCyclesSincePoll < 2);
|
|
7003
|
+
|
|
7004
|
+
// Preserve the configured command spacing and the queue's pre-write /
|
|
7005
|
+
// coalescing rules, but bound read starvation when EMS writes every tick.
|
|
7006
|
+
if (hasQueuedWrites && writeBeforeRead) {
|
|
7007
|
+
const maxWrites = Math.max(1, Number(self._writeQueueMaxPerTick || 1));
|
|
7008
|
+
for (let i = 0; i < maxWrites; i++) {
|
|
7009
|
+
await self._flushWriteQueueOnce();
|
|
7010
|
+
if (!self._writeQueue || self._writeQueue.size === 0) break;
|
|
7011
|
+
}
|
|
7012
|
+
writeCyclesSincePoll++;
|
|
7013
|
+
} else if (runSlow) {
|
|
7014
|
+
await doPoll(slowDps);
|
|
7015
|
+
writeCyclesSincePoll = 0;
|
|
7016
|
+
const finishedAt = Date.now();
|
|
7017
|
+
const nextFastBaseAt = fixedFastCadence ? cycleStartedAt : finishedAt;
|
|
7018
|
+
nextSlowAt = finishedAt + slowIntervalMs;
|
|
7019
|
+
nextFastAt = Math.max(finishedAt, nextFastBaseAt + fastIntervalMs);
|
|
7020
|
+
} else if (runFast) {
|
|
7021
|
+
await doPoll(fastDps);
|
|
7022
|
+
writeCyclesSincePoll = 0;
|
|
7023
|
+
const finishedAt = Date.now();
|
|
7024
|
+
const nextFastBaseAt = fixedFastCadence ? cycleStartedAt : finishedAt;
|
|
7025
|
+
nextFastAt = Math.max(finishedAt, nextFastBaseAt + fastIntervalMs);
|
|
7026
|
+
}
|
|
6967
7027
|
|
|
6968
|
-
|
|
6969
|
-
|
|
7028
|
+
if (!current() || !self._pollLoopActive || !self.driver) return;
|
|
7029
|
+
scheduleNext(self._commandCadenceMs);
|
|
7030
|
+
}
|
|
6970
7031
|
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
scheduleNext(self._commandCadenceMs);
|
|
6974
|
-
} else {
|
|
6975
|
-
// Start after the fast interval (initial full refresh has already happened).
|
|
6976
|
-
scheduleNext(nextFastAt - Date.now());
|
|
7032
|
+
// Decide which scheduler to use
|
|
7033
|
+
loopFn = self._useCommandCadenceScheduler ? cadenceLoop : pollLoop;
|
|
6977
7034
|
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
7035
|
+
if (self._useCommandCadenceScheduler) {
|
|
7036
|
+
// Tick-based cadence scheduler (e.g., 1000ms) to stay within strict Modbus timing constraints.
|
|
7037
|
+
scheduleNext(self._commandCadenceMs);
|
|
7038
|
+
} else {
|
|
7039
|
+
// Start after the fast interval (initial full refresh has already happened).
|
|
7040
|
+
scheduleNext(nextFastAt - Date.now());
|
|
6981
7041
|
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
|
|
6986
|
-
|
|
6987
|
-
|
|
6988
|
-
|
|
6989
|
-
|
|
7042
|
+
// If writes are throttled via queue and we do not use the cadence scheduler, start the write loop.
|
|
7043
|
+
if (self._writeQueueEnabled) self._startWriteLoop();
|
|
7044
|
+
}
|
|
7045
|
+
|
|
7046
|
+
// Optional template-defined Modbus watchdog auto-writes (e.g., TESVOLT VK interface).
|
|
7047
|
+
await this._startAutoWatchdogs();
|
|
7048
|
+
if (!current()) return;
|
|
7049
|
+
// Seed watchdog/keepalive command memory from persistent command aliases after restarts.
|
|
7050
|
+
await this._seedSetpointKeepaliveFromCommandAliases().catch(e => {
|
|
7051
|
+
this.adapter.log.debug(`[${this.cfg.id}] SetpointKeepalive seed failed: ${e && e.message ? e.message : e}`);
|
|
7052
|
+
});
|
|
7053
|
+
if (!current()) return;
|
|
7054
|
+
await this._startSetpointKeepalive();
|
|
7055
|
+
if (!current()) return;
|
|
7056
|
+
await this._startSungrowExternalEmsHeartbeat();
|
|
7057
|
+
};
|
|
7058
|
+
await runInitial(initializePolling);
|
|
6990
7059
|
}
|
|
6991
7060
|
|
|
6992
7061
|
_isVartaLogicalWriteError(error) {
|
|
@@ -7224,6 +7293,9 @@ class DeviceRuntime {
|
|
|
7224
7293
|
}
|
|
7225
7294
|
|
|
7226
7295
|
async stop() {
|
|
7296
|
+
++this._lifecycleGeneration;
|
|
7297
|
+
this.started = false;
|
|
7298
|
+
const initialPoll = this._initialPollPromise;
|
|
7227
7299
|
this._pollLoopActive = false;
|
|
7228
7300
|
if (this.pollTimer) {
|
|
7229
7301
|
clearTimeout(this.pollTimer);
|
|
@@ -7300,6 +7372,7 @@ class DeviceRuntime {
|
|
|
7300
7372
|
try { await this.driver.disconnect(); } catch (e) { /* ignore */ }
|
|
7301
7373
|
this.driver = null;
|
|
7302
7374
|
}
|
|
7375
|
+
if (initialPoll) await initialPoll;
|
|
7303
7376
|
this.started = false;
|
|
7304
7377
|
}
|
|
7305
7378
|
|
|
@@ -7633,10 +7706,11 @@ class DeviceRuntime {
|
|
|
7633
7706
|
|
|
7634
7707
|
const result = await this.driver.writeDatapoint(entry.dp, entry.deviceValue);
|
|
7635
7708
|
this._recordWrite(entry.dp.id, { skipPostWriteRepeat: entry.meta?.skipPostWriteRepeat === true });
|
|
7636
|
-
const isCurrent = () => this._writeQueue.get(key) === entry;
|
|
7637
|
-
if (!isCurrent()) return;
|
|
7638
7709
|
const effectiveValue = result && Object.prototype.hasOwnProperty.call(result, 'effectiveValue')
|
|
7639
7710
|
? result.effectiveValue : entry.deviceValue;
|
|
7711
|
+
this._lastSuccessfulQueuedValueByDpId.set(String(entry.dp.id), effectiveValue);
|
|
7712
|
+
const isCurrent = () => this._writeQueue.get(key) === entry;
|
|
7713
|
+
if (!isCurrent()) return;
|
|
7640
7714
|
|
|
7641
7715
|
// Persist last setpoint for restore-on-start/reconnect (best-effort)
|
|
7642
7716
|
await this._persistSetpointValueIfNeeded(entry.dp, effectiveValue).catch(() => {});
|
|
@@ -9401,6 +9475,9 @@ class DeviceRuntime {
|
|
|
9401
9475
|
try {
|
|
9402
9476
|
if (!isCurrent()) return;
|
|
9403
9477
|
if (!def || def.kind !== 'dp') continue;
|
|
9478
|
+
// A write acknowledgement is not device feedback. Additive semantic
|
|
9479
|
+
// readback aliases only change when the driver actually reads the source.
|
|
9480
|
+
if (def.deviceReadOnly === true) continue;
|
|
9404
9481
|
// A Modbus write response confirms transmission, not the charger's
|
|
9405
9482
|
// applied limit. Keep DEPower readback aliases tied to real polling.
|
|
9406
9483
|
if (this.template?.driverHints?.oemModbusV1003 && def.rw !== 'rw' && def.rw !== 'wo') continue;
|
|
@@ -27,6 +27,14 @@ function _errMsg(err) {
|
|
|
27
27
|
try { return (err && err.message) ? String(err.message) : String(err); } catch (_) { return ''; }
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
// Hosted authorization and lifecycle boundaries are not device/register errors.
|
|
31
|
+
// They must abort the whole snapshot without marking valid optional registers
|
|
32
|
+
// unsupported for the subsequent permitted poll.
|
|
33
|
+
function isReadOperationBoundaryError(err) {
|
|
34
|
+
return ['EOS_DEVICES_NOT_AUTHORIZED', 'EOS_DEVICES_STOPPED', 'EOS_MODULE_STOPPED', 'EOS_OWNERSHIP_REQUIRED']
|
|
35
|
+
.includes(_errCode(err) || _errMsg(err));
|
|
36
|
+
}
|
|
37
|
+
|
|
30
38
|
function isTransportError(err) {
|
|
31
39
|
const code = _errCode(err);
|
|
32
40
|
const msg = _errMsg(err);
|
|
@@ -2370,6 +2378,7 @@ class ModbusDriver {
|
|
|
2370
2378
|
return true;
|
|
2371
2379
|
}
|
|
2372
2380
|
} catch (e) {
|
|
2381
|
+
if (isReadOperationBoundaryError(e)) throw e;
|
|
2373
2382
|
// Ignore probe errors and continue scanning.
|
|
2374
2383
|
}
|
|
2375
2384
|
}
|
|
@@ -2398,7 +2407,8 @@ class ModbusDriver {
|
|
|
2398
2407
|
// Ensure discovery has run so we know the correct unitId/base/fc/endian.
|
|
2399
2408
|
try {
|
|
2400
2409
|
await this._maybeDiscoverSunSpec();
|
|
2401
|
-
} catch (
|
|
2410
|
+
} catch (error) {
|
|
2411
|
+
if (isReadOperationBoundaryError(error)) throw error;
|
|
2402
2412
|
// ignore
|
|
2403
2413
|
}
|
|
2404
2414
|
|
|
@@ -2428,6 +2438,7 @@ class ModbusDriver {
|
|
|
2428
2438
|
try {
|
|
2429
2439
|
hdr = await readRegs(base + off, 2);
|
|
2430
2440
|
} catch (e) {
|
|
2441
|
+
if (isReadOperationBoundaryError(e)) throw e;
|
|
2431
2442
|
break;
|
|
2432
2443
|
}
|
|
2433
2444
|
|
|
@@ -2863,6 +2874,7 @@ async readDatapoints(datapoints) {
|
|
|
2863
2874
|
};
|
|
2864
2875
|
|
|
2865
2876
|
const handleGroupReadError = async (fc, g, e, unitId) => {
|
|
2877
|
+
if (isReadOperationBoundaryError(e)) throw e;
|
|
2866
2878
|
const isRequired = groupHasRequiredDp(g);
|
|
2867
2879
|
|
|
2868
2880
|
if (isTransportError(e)) {
|
|
@@ -2998,6 +3010,7 @@ async readDatapoints(datapoints) {
|
|
|
2998
3010
|
const regs = await readRegisterGroupRaw(fc, item.addr, Number(item.len || item.src.length || 1), unitId);
|
|
2999
3011
|
if (storeRegisterItemValue(item, regs, item.addr)) success += 1;
|
|
3000
3012
|
} catch (e) {
|
|
3013
|
+
if (isReadOperationBoundaryError(e)) throw e;
|
|
3001
3014
|
lastErr = e;
|
|
3002
3015
|
if (groupHasRequiredDp(ig)) {
|
|
3003
3016
|
requiredFailure = e;
|
|
@@ -3029,7 +3042,7 @@ async readDatapoints(datapoints) {
|
|
|
3029
3042
|
return s && s.sunspecModel !== undefined && s.sunspecModel !== null;
|
|
3030
3043
|
});
|
|
3031
3044
|
if (needsSunSpec) {
|
|
3032
|
-
try { await this._maybeScanSunSpecModels(); } catch (
|
|
3045
|
+
try { await this._maybeScanSunSpecModels(); } catch (error) { if (isReadOperationBoundaryError(error)) throw error; }
|
|
3033
3046
|
}
|
|
3034
3047
|
|
|
3035
3048
|
const readItems = (datapoints || []).map(dp => {
|
|
@@ -3129,6 +3142,7 @@ async readDatapoints(datapoints) {
|
|
|
3129
3142
|
try {
|
|
3130
3143
|
regs = await readRegisterGroupRaw(fc, g.start, len, unitId);
|
|
3131
3144
|
} catch (e) {
|
|
3145
|
+
if (isReadOperationBoundaryError(e)) throw e;
|
|
3132
3146
|
let fallbackReadOk = false;
|
|
3133
3147
|
if (isModbusIllegalAddressOrValue(e)) {
|
|
3134
3148
|
for (const off of groupFallbackOffsets(g)) {
|
|
@@ -3139,7 +3153,8 @@ async readDatapoints(datapoints) {
|
|
|
3139
3153
|
fallbackReadOk = true;
|
|
3140
3154
|
this._cacheAlfenReadVariantForGroup(g, unitId, off);
|
|
3141
3155
|
break;
|
|
3142
|
-
} catch (
|
|
3156
|
+
} catch (fallbackError) {
|
|
3157
|
+
if (isReadOperationBoundaryError(fallbackError)) throw fallbackError;
|
|
3143
3158
|
// Try the next explicitly configured fallback offset, if any.
|
|
3144
3159
|
}
|
|
3145
3160
|
}
|