@enyo-energy/sunspec-sdk 0.0.47 → 0.0.48

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.
@@ -263,6 +263,7 @@ class SunspecInverter extends BaseSunspecDevice {
263
263
  voltageL1: inverterData.voltageAN || 0,
264
264
  voltageL2: inverterData.voltageBN ?? undefined,
265
265
  voltageL3: inverterData.voltageCN ?? undefined,
266
+ meterValueWh: inverterData.acEnergy,
266
267
  strings: dcStrings
267
268
  }
268
269
  };
@@ -320,6 +321,7 @@ class SunspecInverter extends BaseSunspecDevice {
320
321
  current: mppt.dcCurrent,
321
322
  voltage: mppt.dcVoltage,
322
323
  powerW: mppt.dcPower,
324
+ meterValueWh: mppt.dcEnergy,
323
325
  });
324
326
  }
325
327
  });
@@ -621,6 +621,7 @@ class SunspecModbusClient {
621
621
  V_SF: this.extractValue(buffer, 13, 'int16'),
622
622
  W_SF: this.extractValue(buffer, 10, 'int16'),
623
623
  Hz_SF: this.extractValue(buffer, 12, 'int16'),
624
+ WH_SF: this.extractValue(buffer, 26, 'int16'),
624
625
  DCA_SF: this.extractValue(buffer, 18, 'int16'),
625
626
  DCV_SF: this.extractValue(buffer, 19, 'int16'),
626
627
  DCW_SF: this.extractValue(buffer, 21, 'int16')
@@ -629,6 +630,7 @@ class SunspecModbusClient {
629
630
  this.logRegisterRead(101, 13, 'V_SF', scaleFactors.V_SF, 'int16');
630
631
  this.logRegisterRead(101, 10, 'W_SF', scaleFactors.W_SF, 'int16');
631
632
  this.logRegisterRead(101, 12, 'Hz_SF', scaleFactors.Hz_SF, 'int16');
633
+ this.logRegisterRead(101, 26, 'WH_SF', scaleFactors.WH_SF, 'int16');
632
634
  this.logRegisterRead(101, 18, 'DCA_SF', scaleFactors.DCA_SF, 'int16');
633
635
  this.logRegisterRead(101, 19, 'DCV_SF', scaleFactors.DCV_SF, 'int16');
634
636
  this.logRegisterRead(101, 21, 'DCW_SF', scaleFactors.DCW_SF, 'int16');
@@ -653,6 +655,12 @@ class SunspecModbusClient {
653
655
  dcPower: this.applyScaleFactor(dcPowerRaw, scaleFactors.DCW_SF, 'int16', 'DC Power', 20, 101),
654
656
  operatingState: stateRaw
655
657
  };
658
+ // Read AC Energy (32-bit accumulator) - Offset 24-25
659
+ const acEnergy = this.extractValue(buffer, 24, 'uint32', 2);
660
+ this.logRegisterRead(101, 24, 'AC Energy', acEnergy, 'acc32');
661
+ data.acEnergy = !this.isUnimplementedValue(acEnergy, 'acc32')
662
+ ? acEnergy * Math.pow(10, scaleFactors.WH_SF)
663
+ : undefined;
656
664
  console.debug('[Model 101] Single Phase Inverter Data:', data);
657
665
  return data;
658
666
  }
@@ -9,7 +9,7 @@ exports.getSdkVersion = getSdkVersion;
9
9
  /**
10
10
  * Current version of the enyo Energy App SDK.
11
11
  */
12
- exports.SDK_VERSION = '0.0.47';
12
+ exports.SDK_VERSION = '0.0.48';
13
13
  /**
14
14
  * Gets the current SDK version.
15
15
  * @returns The semantic version string of the SDK
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Current version of the enyo Energy App SDK.
7
7
  */
8
- export declare const SDK_VERSION = "0.0.47";
8
+ export declare const SDK_VERSION = "0.0.48";
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
@@ -259,6 +259,7 @@ export class SunspecInverter extends BaseSunspecDevice {
259
259
  voltageL1: inverterData.voltageAN || 0,
260
260
  voltageL2: inverterData.voltageBN ?? undefined,
261
261
  voltageL3: inverterData.voltageCN ?? undefined,
262
+ meterValueWh: inverterData.acEnergy,
262
263
  strings: dcStrings
263
264
  }
264
265
  };
@@ -316,6 +317,7 @@ export class SunspecInverter extends BaseSunspecDevice {
316
317
  current: mppt.dcCurrent,
317
318
  voltage: mppt.dcVoltage,
318
319
  powerW: mppt.dcPower,
320
+ meterValueWh: mppt.dcEnergy,
319
321
  });
320
322
  }
321
323
  });
@@ -618,6 +618,7 @@ export class SunspecModbusClient {
618
618
  V_SF: this.extractValue(buffer, 13, 'int16'),
619
619
  W_SF: this.extractValue(buffer, 10, 'int16'),
620
620
  Hz_SF: this.extractValue(buffer, 12, 'int16'),
621
+ WH_SF: this.extractValue(buffer, 26, 'int16'),
621
622
  DCA_SF: this.extractValue(buffer, 18, 'int16'),
622
623
  DCV_SF: this.extractValue(buffer, 19, 'int16'),
623
624
  DCW_SF: this.extractValue(buffer, 21, 'int16')
@@ -626,6 +627,7 @@ export class SunspecModbusClient {
626
627
  this.logRegisterRead(101, 13, 'V_SF', scaleFactors.V_SF, 'int16');
627
628
  this.logRegisterRead(101, 10, 'W_SF', scaleFactors.W_SF, 'int16');
628
629
  this.logRegisterRead(101, 12, 'Hz_SF', scaleFactors.Hz_SF, 'int16');
630
+ this.logRegisterRead(101, 26, 'WH_SF', scaleFactors.WH_SF, 'int16');
629
631
  this.logRegisterRead(101, 18, 'DCA_SF', scaleFactors.DCA_SF, 'int16');
630
632
  this.logRegisterRead(101, 19, 'DCV_SF', scaleFactors.DCV_SF, 'int16');
631
633
  this.logRegisterRead(101, 21, 'DCW_SF', scaleFactors.DCW_SF, 'int16');
@@ -650,6 +652,12 @@ export class SunspecModbusClient {
650
652
  dcPower: this.applyScaleFactor(dcPowerRaw, scaleFactors.DCW_SF, 'int16', 'DC Power', 20, 101),
651
653
  operatingState: stateRaw
652
654
  };
655
+ // Read AC Energy (32-bit accumulator) - Offset 24-25
656
+ const acEnergy = this.extractValue(buffer, 24, 'uint32', 2);
657
+ this.logRegisterRead(101, 24, 'AC Energy', acEnergy, 'acc32');
658
+ data.acEnergy = !this.isUnimplementedValue(acEnergy, 'acc32')
659
+ ? acEnergy * Math.pow(10, scaleFactors.WH_SF)
660
+ : undefined;
653
661
  console.debug('[Model 101] Single Phase Inverter Data:', data);
654
662
  return data;
655
663
  }
package/dist/version.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Current version of the enyo Energy App SDK.
7
7
  */
8
- export declare const SDK_VERSION = "0.0.47";
8
+ export declare const SDK_VERSION = "0.0.48";
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
package/dist/version.js CHANGED
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Current version of the enyo Energy App SDK.
7
7
  */
8
- export const SDK_VERSION = '0.0.47';
8
+ export const SDK_VERSION = '0.0.48';
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enyo-energy/sunspec-sdk",
3
- "version": "0.0.47",
3
+ "version": "0.0.48",
4
4
  "description": "enyo Energy Sunspec SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -37,7 +37,7 @@
37
37
  "typescript": "^5.8.3"
38
38
  },
39
39
  "dependencies": {
40
- "@enyo-energy/energy-app-sdk": "^0.0.111"
40
+ "@enyo-energy/energy-app-sdk": "^0.0.113"
41
41
  },
42
42
  "volta": {
43
43
  "node": "22.17.0"