@enyo-energy/sunspec-sdk 1.4.0 → 1.5.0
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/dist/cjs/sunspec-devices.cjs +16 -3
- package/dist/cjs/sunspec-devices.d.cts +10 -0
- package/dist/cjs/version.cjs +1 -1
- package/dist/cjs/version.d.cts +1 -1
- package/dist/sunspec-devices.d.ts +10 -0
- package/dist/sunspec-devices.js +15 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SunspecCustomDevice = exports.SunspecMeter = exports.SunspecBattery = exports.SunspecInverter = exports.BaseSunspecDevice = void 0;
|
|
4
4
|
exports.detectFeaturesFromRegisters = detectFeaturesFromRegisters;
|
|
5
|
+
exports.ratedDischargePowerW = ratedDischargePowerW;
|
|
5
6
|
exports.sumMpptBatteryPowerW = sumMpptBatteryPowerW;
|
|
6
7
|
exports.selectLiveBatteryPowerW = selectLiveBatteryPowerW;
|
|
7
8
|
exports.filterFeaturesByCalibrationResult = filterFeaturesByCalibrationResult;
|
|
@@ -1396,6 +1397,18 @@ function detectFeaturesFromRegisters(batteryData) {
|
|
|
1396
1397
|
features.push(enyo_battery_appliance_js_1.EnyoBatteryFeature.GridDischarging);
|
|
1397
1398
|
return features;
|
|
1398
1399
|
}
|
|
1400
|
+
/**
|
|
1401
|
+
* Rated discharge power in Watts — the battery's capability, never the live
|
|
1402
|
+
* limit. Model 124 carries no discharge nameplate of its own, so WChaMax stands
|
|
1403
|
+
* in for it. OutWRte must not be folded in: it is the discharge rate the host
|
|
1404
|
+
* writes to cap the battery, so `WChaMax × OutWRte` turned our own "discharge
|
|
1405
|
+
* 0" into a rated power of 0 W, the energy manager stopped offering the
|
|
1406
|
+
* battery, and nothing ever lifted the cap again. The live cap is reported
|
|
1407
|
+
* separately as `activeDischargeLimitW`.
|
|
1408
|
+
*/
|
|
1409
|
+
function ratedDischargePowerW(batteryData) {
|
|
1410
|
+
return batteryData?.wChaMax;
|
|
1411
|
+
}
|
|
1399
1412
|
/**
|
|
1400
1413
|
* Apply the per-feature calibration filter to a register-detected set.
|
|
1401
1414
|
* Exported for unit-test access to the legacy-result fallback branch.
|
|
@@ -1717,7 +1730,7 @@ class SunspecBattery extends BaseSunspecDevice {
|
|
|
1717
1730
|
connectedToApplianceId: inverterApplianceId,
|
|
1718
1731
|
storageMode: this.mapToEnyoStorageMode(storageMode),
|
|
1719
1732
|
maxChargingPowerW: batteryData?.wChaMax,
|
|
1720
|
-
maxDischargePowerW: batteryData
|
|
1733
|
+
maxDischargePowerW: ratedDischargePowerW(batteryData),
|
|
1721
1734
|
activeChargeLimitW: activeChargeLimitW,
|
|
1722
1735
|
activeDischargeLimitW: activeDischargeLimitW,
|
|
1723
1736
|
features,
|
|
@@ -1746,7 +1759,7 @@ class SunspecBattery extends BaseSunspecDevice {
|
|
|
1746
1759
|
connectedToApplianceId: inverterApplianceId,
|
|
1747
1760
|
storageMode: this.mapToEnyoStorageMode(storageMode),
|
|
1748
1761
|
maxChargingPowerW: batteryData?.wChaMax,
|
|
1749
|
-
maxDischargePowerW: batteryData
|
|
1762
|
+
maxDischargePowerW: ratedDischargePowerW(batteryData),
|
|
1750
1763
|
activeChargeLimitW: activeChargeLimitW,
|
|
1751
1764
|
activeDischargeLimitW: activeDischargeLimitW,
|
|
1752
1765
|
features,
|
|
@@ -1915,7 +1928,7 @@ class SunspecBattery extends BaseSunspecDevice {
|
|
|
1915
1928
|
...appliance?.battery,
|
|
1916
1929
|
storageMode: this.mapToEnyoStorageMode(storageMode),
|
|
1917
1930
|
maxChargingPowerW: batteryData?.wChaMax,
|
|
1918
|
-
maxDischargePowerW: batteryData
|
|
1931
|
+
maxDischargePowerW: ratedDischargePowerW(batteryData),
|
|
1919
1932
|
activeChargeLimitW: this.computeActiveChargeLimitW(batteryData),
|
|
1920
1933
|
activeDischargeLimitW: this.computeActiveDischargeLimitW(batteryData),
|
|
1921
1934
|
features,
|
|
@@ -465,6 +465,16 @@ export declare class SunspecInverter extends BaseSunspecDevice {
|
|
|
465
465
|
* control is available; the inverter decides where it goes)
|
|
466
466
|
*/
|
|
467
467
|
export declare function detectFeaturesFromRegisters(batteryData: SunspecBatteryData | null): EnyoBatteryFeature[];
|
|
468
|
+
/**
|
|
469
|
+
* Rated discharge power in Watts — the battery's capability, never the live
|
|
470
|
+
* limit. Model 124 carries no discharge nameplate of its own, so WChaMax stands
|
|
471
|
+
* in for it. OutWRte must not be folded in: it is the discharge rate the host
|
|
472
|
+
* writes to cap the battery, so `WChaMax × OutWRte` turned our own "discharge
|
|
473
|
+
* 0" into a rated power of 0 W, the energy manager stopped offering the
|
|
474
|
+
* battery, and nothing ever lifted the cap again. The live cap is reported
|
|
475
|
+
* separately as `activeDischargeLimitW`.
|
|
476
|
+
*/
|
|
477
|
+
export declare function ratedDischargePowerW(batteryData: SunspecBatteryData | null | undefined): number | undefined;
|
|
468
478
|
/**
|
|
469
479
|
* Apply the per-feature calibration filter to a register-detected set.
|
|
470
480
|
* Exported for unit-test access to the legacy-result fallback branch.
|
package/dist/cjs/version.cjs
CHANGED
package/dist/cjs/version.d.cts
CHANGED
|
@@ -465,6 +465,16 @@ export declare class SunspecInverter extends BaseSunspecDevice {
|
|
|
465
465
|
* control is available; the inverter decides where it goes)
|
|
466
466
|
*/
|
|
467
467
|
export declare function detectFeaturesFromRegisters(batteryData: SunspecBatteryData | null): EnyoBatteryFeature[];
|
|
468
|
+
/**
|
|
469
|
+
* Rated discharge power in Watts — the battery's capability, never the live
|
|
470
|
+
* limit. Model 124 carries no discharge nameplate of its own, so WChaMax stands
|
|
471
|
+
* in for it. OutWRte must not be folded in: it is the discharge rate the host
|
|
472
|
+
* writes to cap the battery, so `WChaMax × OutWRte` turned our own "discharge
|
|
473
|
+
* 0" into a rated power of 0 W, the energy manager stopped offering the
|
|
474
|
+
* battery, and nothing ever lifted the cap again. The live cap is reported
|
|
475
|
+
* separately as `activeDischargeLimitW`.
|
|
476
|
+
*/
|
|
477
|
+
export declare function ratedDischargePowerW(batteryData: SunspecBatteryData | null | undefined): number | undefined;
|
|
468
478
|
/**
|
|
469
479
|
* Apply the per-feature calibration filter to a register-detected set.
|
|
470
480
|
* Exported for unit-test access to the legacy-result fallback branch.
|
package/dist/sunspec-devices.js
CHANGED
|
@@ -1386,6 +1386,18 @@ export function detectFeaturesFromRegisters(batteryData) {
|
|
|
1386
1386
|
features.push(EnyoBatteryFeature.GridDischarging);
|
|
1387
1387
|
return features;
|
|
1388
1388
|
}
|
|
1389
|
+
/**
|
|
1390
|
+
* Rated discharge power in Watts — the battery's capability, never the live
|
|
1391
|
+
* limit. Model 124 carries no discharge nameplate of its own, so WChaMax stands
|
|
1392
|
+
* in for it. OutWRte must not be folded in: it is the discharge rate the host
|
|
1393
|
+
* writes to cap the battery, so `WChaMax × OutWRte` turned our own "discharge
|
|
1394
|
+
* 0" into a rated power of 0 W, the energy manager stopped offering the
|
|
1395
|
+
* battery, and nothing ever lifted the cap again. The live cap is reported
|
|
1396
|
+
* separately as `activeDischargeLimitW`.
|
|
1397
|
+
*/
|
|
1398
|
+
export function ratedDischargePowerW(batteryData) {
|
|
1399
|
+
return batteryData?.wChaMax;
|
|
1400
|
+
}
|
|
1389
1401
|
/**
|
|
1390
1402
|
* Apply the per-feature calibration filter to a register-detected set.
|
|
1391
1403
|
* Exported for unit-test access to the legacy-result fallback branch.
|
|
@@ -1707,7 +1719,7 @@ export class SunspecBattery extends BaseSunspecDevice {
|
|
|
1707
1719
|
connectedToApplianceId: inverterApplianceId,
|
|
1708
1720
|
storageMode: this.mapToEnyoStorageMode(storageMode),
|
|
1709
1721
|
maxChargingPowerW: batteryData?.wChaMax,
|
|
1710
|
-
maxDischargePowerW: batteryData
|
|
1722
|
+
maxDischargePowerW: ratedDischargePowerW(batteryData),
|
|
1711
1723
|
activeChargeLimitW: activeChargeLimitW,
|
|
1712
1724
|
activeDischargeLimitW: activeDischargeLimitW,
|
|
1713
1725
|
features,
|
|
@@ -1736,7 +1748,7 @@ export class SunspecBattery extends BaseSunspecDevice {
|
|
|
1736
1748
|
connectedToApplianceId: inverterApplianceId,
|
|
1737
1749
|
storageMode: this.mapToEnyoStorageMode(storageMode),
|
|
1738
1750
|
maxChargingPowerW: batteryData?.wChaMax,
|
|
1739
|
-
maxDischargePowerW: batteryData
|
|
1751
|
+
maxDischargePowerW: ratedDischargePowerW(batteryData),
|
|
1740
1752
|
activeChargeLimitW: activeChargeLimitW,
|
|
1741
1753
|
activeDischargeLimitW: activeDischargeLimitW,
|
|
1742
1754
|
features,
|
|
@@ -1905,7 +1917,7 @@ export class SunspecBattery extends BaseSunspecDevice {
|
|
|
1905
1917
|
...appliance?.battery,
|
|
1906
1918
|
storageMode: this.mapToEnyoStorageMode(storageMode),
|
|
1907
1919
|
maxChargingPowerW: batteryData?.wChaMax,
|
|
1908
|
-
maxDischargePowerW: batteryData
|
|
1920
|
+
maxDischargePowerW: ratedDischargePowerW(batteryData),
|
|
1909
1921
|
activeChargeLimitW: this.computeActiveChargeLimitW(batteryData),
|
|
1910
1922
|
activeDischargeLimitW: this.computeActiveDischargeLimitW(batteryData),
|
|
1911
1923
|
features,
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enyo-energy/sunspec-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "enyo Energy Sunspec SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@enyo-energy/appliance-calibration": "0.0.3",
|
|
44
|
-
"@enyo-energy/energy-app-sdk": "1.
|
|
44
|
+
"@enyo-energy/energy-app-sdk": "1.31.0"
|
|
45
45
|
},
|
|
46
46
|
"volta": {
|
|
47
47
|
"node": "22.17.0"
|