homebridge-enphase-envoy 10.2.5-beta.7 → 10.2.5-beta.9
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/package.json +1 -1
- package/src/energymeter.js +10 -11
- package/src/envoydata.js +1 -1
- package/src/envoydevice.js +0 -3
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"private": false,
|
|
3
3
|
"displayName": "Enphase Envoy",
|
|
4
4
|
"name": "homebridge-enphase-envoy",
|
|
5
|
-
"version": "10.2.5-beta.
|
|
5
|
+
"version": "10.2.5-beta.9",
|
|
6
6
|
"description": "Homebridge p7ugin for Photovoltaic Energy System manufactured by Enphase.",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "grzegorz914",
|
package/src/energymeter.js
CHANGED
|
@@ -713,7 +713,7 @@ class EnergyMeter extends EventEmitter {
|
|
|
713
713
|
const obj = {
|
|
714
714
|
type: 'pcu',
|
|
715
715
|
activeCount: this.feature.inventory.pcus.count,
|
|
716
|
-
measurementType: '
|
|
716
|
+
measurementType: 'production',
|
|
717
717
|
readingTime,
|
|
718
718
|
power: production.wattsNow,
|
|
719
719
|
energyToday: production.wattHoursToday,
|
|
@@ -744,7 +744,7 @@ class EnergyMeter extends EventEmitter {
|
|
|
744
744
|
// PCU
|
|
745
745
|
const pcu = {
|
|
746
746
|
type: 'pcu',
|
|
747
|
-
measurementType: '
|
|
747
|
+
measurementType: 'production',
|
|
748
748
|
activeCount: this.feature.inventory?.pcus?.count,
|
|
749
749
|
readingTime,
|
|
750
750
|
power: data.watts_now_pcu,
|
|
@@ -759,7 +759,7 @@ class EnergyMeter extends EventEmitter {
|
|
|
759
759
|
const eimActive = !!data.there_is_an_active_eim;
|
|
760
760
|
const eim = {
|
|
761
761
|
type: 'eim',
|
|
762
|
-
measurementType: '
|
|
762
|
+
measurementType: 'production',
|
|
763
763
|
activeCount: 1,
|
|
764
764
|
readingTime,
|
|
765
765
|
active: eimActive,
|
|
@@ -775,7 +775,7 @@ class EnergyMeter extends EventEmitter {
|
|
|
775
775
|
const rgmActive = !!data.there_is_an_active_rgm;
|
|
776
776
|
const rgm = {
|
|
777
777
|
type: 'rgm',
|
|
778
|
-
measurementType: '
|
|
778
|
+
measurementType: 'production',
|
|
779
779
|
activeCount: 1,
|
|
780
780
|
readingTime,
|
|
781
781
|
active: rgmActive,
|
|
@@ -791,7 +791,7 @@ class EnergyMeter extends EventEmitter {
|
|
|
791
791
|
const pmuActive = !!data.there_is_an_active_pmu;
|
|
792
792
|
const pmu = {
|
|
793
793
|
type: 'pmu',
|
|
794
|
-
measurementType: '
|
|
794
|
+
measurementType: 'production',
|
|
795
795
|
activeCount: 1,
|
|
796
796
|
readingTime,
|
|
797
797
|
active: pmuActive,
|
|
@@ -829,7 +829,7 @@ class EnergyMeter extends EventEmitter {
|
|
|
829
829
|
const obj = {
|
|
830
830
|
type,
|
|
831
831
|
activeCount: 1,
|
|
832
|
-
measurementType: '
|
|
832
|
+
measurementType: 'production',
|
|
833
833
|
readingTime,
|
|
834
834
|
power: data.wattsNow,
|
|
835
835
|
energyToday: data.wattHoursToday,
|
|
@@ -849,7 +849,7 @@ class EnergyMeter extends EventEmitter {
|
|
|
849
849
|
const obj = {
|
|
850
850
|
type: 'eim',
|
|
851
851
|
activeCount: 1,
|
|
852
|
-
measurementType: '
|
|
852
|
+
measurementType: 'net-consumption',
|
|
853
853
|
readingTime,
|
|
854
854
|
power: data.wattsNow,
|
|
855
855
|
energyToday: data.wattHoursToday,
|
|
@@ -893,7 +893,7 @@ class EnergyMeter extends EventEmitter {
|
|
|
893
893
|
const obj = {
|
|
894
894
|
type: 'eim',
|
|
895
895
|
activeCount: 1,
|
|
896
|
-
measurementType:
|
|
896
|
+
measurementType: productionEim.measurementType,
|
|
897
897
|
readingTime: productionEim.readingTime,
|
|
898
898
|
power: productionEim.wNow,
|
|
899
899
|
energyToday,
|
|
@@ -913,14 +913,13 @@ class EnergyMeter extends EventEmitter {
|
|
|
913
913
|
// --- Consumption: EIM ---
|
|
914
914
|
if (keys.includes('consumption') && Array.isArray(data.consumption) && this.feature.meters.consumptionNet.enabled) {
|
|
915
915
|
for (const item of data.consumption) {
|
|
916
|
-
const
|
|
917
|
-
const key = MetersKeyMap[type];
|
|
916
|
+
const key = MetersKeyMap[item.measurementType];
|
|
918
917
|
const energyToday = (item.lines[0]?.whToday || 0) + (item.lines[1]?.whToday || 0) + (item.lines[2]?.whToday || 0);
|
|
919
918
|
const energyLastSevenDays = (item.lines[0]?.whLastSevenDays || 0) + (item.lines[1]?.whLastSevenDays || 0) + (item.lines[2]?.whLastSevenDays || 0);
|
|
920
919
|
const energyLifetime = (item.lines[0]?.whLifetime || 0) + (item.lines[1]?.whLifetime || 0) + (item.lines[2]?.whLifetime || 0);
|
|
921
920
|
const obj = {
|
|
922
921
|
type: 'eim',
|
|
923
|
-
measurementType:
|
|
922
|
+
measurementType: item.measurementType,
|
|
924
923
|
activeCount: 1,
|
|
925
924
|
readingTime: item.readingTime,
|
|
926
925
|
power: item.wNow,
|
package/src/envoydata.js
CHANGED
|
@@ -39,7 +39,7 @@ class EnvoyData extends EventEmitter {
|
|
|
39
39
|
this.checkTokenRunning = false;
|
|
40
40
|
|
|
41
41
|
//url
|
|
42
|
-
this.url = envoyFirmware7xxTokenGenerationMode > 0 ? `https://${this.host}` : `http://${this.host}`;
|
|
42
|
+
this.url = device.envoyFirmware7xxTokenGenerationMode > 0 ? `https://${this.host}` : `http://${this.host}`;
|
|
43
43
|
|
|
44
44
|
//supported functions
|
|
45
45
|
this.feature = {
|
package/src/envoydevice.js
CHANGED
|
@@ -361,9 +361,6 @@ class EnvoyDevice extends EventEmitter {
|
|
|
361
361
|
this.envoyIdFile = envoyIdFile;
|
|
362
362
|
this.envoyTokenFile = envoyTokenFile;
|
|
363
363
|
|
|
364
|
-
//url
|
|
365
|
-
this.url = device.envoyFirmware7xxTokenGenerationMode > 0 ? `https://${this.host}` : `http://${this.host}`;
|
|
366
|
-
|
|
367
364
|
//supported functions
|
|
368
365
|
this.feature = {
|
|
369
366
|
productionState: {
|