homebridge-enphase-envoy 10.3.0-beta.3 → 10.3.0-beta.4
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/CHANGELOG.md +3 -2
- package/index.js +3 -3
- package/package.json +1 -1
- package/src/envoydevice.js +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -13,9 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
13
13
|
|
|
14
14
|
## Changes
|
|
15
15
|
|
|
16
|
-
-
|
|
16
|
+
- extend Eve Energy Meter to support (Production, Consumption Net, Consumption Total)
|
|
17
|
+
- fix [#218](https://github.com/grzegorz914/homebridge-enphase-envoy/issues/218)
|
|
17
18
|
- stability and performance improvements
|
|
18
|
-
- config
|
|
19
|
+
- config schema updated
|
|
19
20
|
- readme updated
|
|
20
21
|
- cleanup
|
|
21
22
|
|
package/index.js
CHANGED
|
@@ -103,9 +103,9 @@ class EnvoyPlatform {
|
|
|
103
103
|
.on('warn', (msg) => logLevel.warn && log.warn(`Device: ${host} ${deviceName}, ${msg}`))
|
|
104
104
|
.on('error', (msg) => logLevel.error && log.error(`Device: ${host} ${deviceName}, ${msg}`));
|
|
105
105
|
|
|
106
|
-
const
|
|
107
|
-
if (
|
|
108
|
-
api.publishExternalAccessories(PluginName,
|
|
106
|
+
const accessories = await envoyDevice.start();
|
|
107
|
+
if (accessories) {
|
|
108
|
+
api.publishExternalAccessories(PluginName, accessories);
|
|
109
109
|
if (logLevel.success) log.success(`Device: ${host} ${deviceName}, Published as external accessory.`);
|
|
110
110
|
|
|
111
111
|
await impulseGenerator.state(false);
|
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.3.0-beta.
|
|
5
|
+
"version": "10.3.0-beta.4",
|
|
6
6
|
"description": "Homebridge p7ugin for Photovoltaic Energy System manufactured by Enphase.",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "grzegorz914",
|
package/src/envoydevice.js
CHANGED
|
@@ -786,7 +786,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
786
786
|
const devices = this.energyMeter ? 2 : 1;
|
|
787
787
|
for (let i = 0; i < devices; i++) {
|
|
788
788
|
switch (i) {
|
|
789
|
-
case 0
|
|
789
|
+
case 0: //PV System
|
|
790
790
|
const envoySerialNumber = this.pv.info.serialNumber;
|
|
791
791
|
const accessoryName = this.name;
|
|
792
792
|
|
|
@@ -2158,7 +2158,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
2158
2158
|
if (this.enchargeBackupLevelSummarySensors.length > 0) {
|
|
2159
2159
|
if (this.logDebug) this.emit('debug', `Prepare ${enchargeName} Backup Level Sensor Services`);
|
|
2160
2160
|
|
|
2161
|
-
this.
|
|
2161
|
+
this.enchargeBackupLevelSummarySensorsServices = [];
|
|
2162
2162
|
for (let i = 0; i < this.enchargeBackupLevelSummarySensors.length; i++) {
|
|
2163
2163
|
const sensor = this.enchargeBackupLevelSummarySensors[i];
|
|
2164
2164
|
const { namePrefix, name, serviceType, characteristicType } = sensor;
|
|
@@ -2174,13 +2174,13 @@ class EnvoyDevice extends EventEmitter {
|
|
|
2174
2174
|
return currentState;
|
|
2175
2175
|
});
|
|
2176
2176
|
|
|
2177
|
-
this.
|
|
2177
|
+
this.enchargeBackupLevelSummarySensorsServices.push(sensorService);
|
|
2178
2178
|
}
|
|
2179
2179
|
}
|
|
2180
2180
|
|
|
2181
2181
|
//devices
|
|
2182
2182
|
this.enchargeServices = [];
|
|
2183
|
-
this.
|
|
2183
|
+
this.enchargeBackupLevelControlServices = [];
|
|
2184
2184
|
|
|
2185
2185
|
for (const encharge of this.pv.inventoryData.esubs.encharges.devices) {
|
|
2186
2186
|
const serialNumber = encharge.serialNumber;
|
|
@@ -2231,7 +2231,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
2231
2231
|
return currentChargeState;
|
|
2232
2232
|
});
|
|
2233
2233
|
|
|
2234
|
-
this.
|
|
2234
|
+
this.enchargeBackupLevelControlServices.push(controlService);
|
|
2235
2235
|
}
|
|
2236
2236
|
|
|
2237
2237
|
if (this.logDebug) this.emit('debug', `Prepare ${enchargeName} ${serialNumber} Service`);
|
|
@@ -3002,7 +3002,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
3002
3002
|
|
|
3003
3003
|
accessories.push(accessory);
|
|
3004
3004
|
break;
|
|
3005
|
-
case 1: //Energy Meter
|
|
3005
|
+
case 1: //EVE Energy Meter
|
|
3006
3006
|
this.fakegatoHistoryServices = [];
|
|
3007
3007
|
this.energyMeterServices = [];
|
|
3008
3008
|
for (const source of this.pv.powerAndEnergyData.data) {
|
|
@@ -4435,7 +4435,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
4435
4435
|
for (const { type, value, valueKey } of characteristics) {
|
|
4436
4436
|
if (!this.functions.isValidValue(value)) continue;
|
|
4437
4437
|
sensor[valueKey] = value;
|
|
4438
|
-
this.
|
|
4438
|
+
this.enchargeBackupLevelSummarySensorsServices?.[i]?.updateCharacteristic(type, value);
|
|
4439
4439
|
};
|
|
4440
4440
|
}
|
|
4441
4441
|
}
|
|
@@ -4784,7 +4784,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
4784
4784
|
for (const { type, value, valueKey } of characteristics1) {
|
|
4785
4785
|
if (!this.functions.isValidValue(value)) continue;
|
|
4786
4786
|
control[valueKey] = value;
|
|
4787
|
-
this.
|
|
4787
|
+
this.enchargeBackupLevelControlServices?.[index]?.updateCharacteristic(type, value);
|
|
4788
4788
|
}
|
|
4789
4789
|
}
|
|
4790
4790
|
|
|
@@ -5168,8 +5168,8 @@ class EnvoyDevice extends EventEmitter {
|
|
|
5168
5168
|
// Update enpower grid mode sensors
|
|
5169
5169
|
for (let i = 0; i < (this.enpowerGridModeSensors?.length ?? 0); i++) {
|
|
5170
5170
|
const sensor = this.enpowerGridModeSensors[i];
|
|
5171
|
-
const { characteristicType } = sensor;
|
|
5172
|
-
const state =
|
|
5171
|
+
const { characteristicType, gridMode } = sensor;
|
|
5172
|
+
const state = gridMode === enpowerData.enpwrGridMode;
|
|
5173
5173
|
|
|
5174
5174
|
// Create characteristics
|
|
5175
5175
|
const characteristics = [
|
|
@@ -5711,7 +5711,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
5711
5711
|
for (const { type, value, valueKey } of characteristics) {
|
|
5712
5712
|
if (!this.functions.isValidValue(value)) continue;
|
|
5713
5713
|
sensor[valueKey] = value;
|
|
5714
|
-
this.
|
|
5714
|
+
this.enchargeBackupLevelSummarySensorsServices?.[i]?.updateCharacteristic(type, value);
|
|
5715
5715
|
};
|
|
5716
5716
|
}
|
|
5717
5717
|
}
|
|
@@ -5785,8 +5785,8 @@ class EnvoyDevice extends EventEmitter {
|
|
|
5785
5785
|
if (this.restFul.enable || this.mqtt.enable) await this.externalIntegrations();
|
|
5786
5786
|
|
|
5787
5787
|
// Prepare HomeKit accessory
|
|
5788
|
-
const
|
|
5789
|
-
return
|
|
5788
|
+
const accessories = await this.prepareAccessory();
|
|
5789
|
+
return accessories;
|
|
5790
5790
|
} catch (error) {
|
|
5791
5791
|
throw new Error(`Start error: ${error}`);
|
|
5792
5792
|
}
|