homebridge-enphase-envoy 10.3.0 → 10.3.1-beta.1
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/README.md +2 -2
- package/package.json +2 -2
- package/src/customcharacteristics.js +0 -16
- package/src/envoydata.js +17 -14
- package/src/envoydevice.js +12 -14
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ The `homebridge-enphase-envoy` plugin integrates Enphase Envoy solar energy moni
|
|
|
24
24
|
| Package | Installation | Role | Required |
|
|
25
25
|
| --- | --- | --- | --- |
|
|
26
26
|
| [Homebridge](https://github.com/homebridge/homebridge) | [Homebridge Wiki](https://github.com/homebridge/homebridge/wiki) | HomeKit Bridge | Required |
|
|
27
|
-
| [
|
|
27
|
+
| [Homebridge UI](https://github.com/homebridge/homebridge-config-ui-x) | [Homebridge UI Wiki](https://github.com/homebridge/homebridge-config-ui-x/wiki) | Homebridge Web User Interface | Recommended |
|
|
28
28
|
| [Enphase Envoy](https://www.npmjs.com/package/homebridge-enphase-envoy) | [Plug-In Wiki](https://github.com/grzegorz914/homebridge-enphase-envoy/wiki) | Homebridge Plug-In | Required |
|
|
29
29
|
|
|
30
30
|
## Supported hardware
|
|
@@ -90,7 +90,7 @@ The `homebridge-enphase-envoy` plugin integrates Enphase Envoy solar energy moni
|
|
|
90
90
|
### Configuration
|
|
91
91
|
|
|
92
92
|
* Running this plugin as a [Child Bridge](https://github.com/homebridge/homebridge/wiki/Child-Bridges) is **highly recommended**. This prevents Homebridge from crashing if the plugin crashes.
|
|
93
|
-
* Installation and use of [Homebridge
|
|
93
|
+
* Installation and use of [Homebridge UI](https://github.com/homebridge/homebridge-config-ui-x) to configure this plugin is **highly recommended**.
|
|
94
94
|
* The `sample-config.json` can be edited and used as an alternative for advanced users.
|
|
95
95
|
|
|
96
96
|
<p align="center">
|
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.
|
|
5
|
+
"version": "10.3.1-beta.1",
|
|
6
6
|
"description": "Homebridge p7ugin for Photovoltaic Energy System manufactured by Enphase.",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "grzegorz914",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"LICENSE"
|
|
32
32
|
],
|
|
33
33
|
"engines": {
|
|
34
|
-
"homebridge": "^1.9.0 || ^2.0.0 || ^2.0.0-beta.30 || ^2.0.0-alpha.
|
|
34
|
+
"homebridge": "^1.9.0 || ^2.0.0 || ^2.0.0-beta.30 || ^2.0.0-alpha.60",
|
|
35
35
|
"node": "^20 || ^22 || ^24"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
@@ -1554,22 +1554,6 @@ export default (api) => {
|
|
|
1554
1554
|
}
|
|
1555
1555
|
Characteristic.EncAggSoc = EncAggSoc;
|
|
1556
1556
|
|
|
1557
|
-
class EncAggRatedPower extends Characteristic {
|
|
1558
|
-
constructor() {
|
|
1559
|
-
super('ENC rated power', '00000208-000B-1000-8000-0026BB765291');
|
|
1560
|
-
this.setProps({
|
|
1561
|
-
format: Formats.FLOAT,
|
|
1562
|
-
unit: 'kW',
|
|
1563
|
-
maxValue: 1000,
|
|
1564
|
-
minValue: -1000,
|
|
1565
|
-
minStep: 0.001,
|
|
1566
|
-
perms: [Perms.PAIRED_READ, Perms.NOTIFY]
|
|
1567
|
-
});
|
|
1568
|
-
this.value = this.getDefaultValue();
|
|
1569
|
-
}
|
|
1570
|
-
}
|
|
1571
|
-
Characteristic.EncAggRatedPower = EncAggRatedPower;
|
|
1572
|
-
|
|
1573
1557
|
class EncAggBackupEnergy extends Characteristic {
|
|
1574
1558
|
constructor() {
|
|
1575
1559
|
super('ENC backup energy', '00000209-000B-1000-8000-0026BB765291');
|
package/src/envoydata.js
CHANGED
|
@@ -412,7 +412,7 @@ class EnvoyData extends EventEmitter {
|
|
|
412
412
|
.on('updateEnsemble', () => this.handleWithLock('updateEnsemble', async () => {
|
|
413
413
|
const updateEnsemble = this.feature.ensemble.inventory.supported ? await this.updateEnsembleInventory() : false;
|
|
414
414
|
if (updateEnsemble && this.feature.ensemble.status.supported) await this.updateEnsembleStatus();
|
|
415
|
-
if (updateEnsemble && this.feature.
|
|
415
|
+
if (updateEnsemble && this.feature.ensemble.power.supported) await this.updateEnsemblePower();
|
|
416
416
|
|
|
417
417
|
const updateEnchargeSettings = updateEnsemble && this.feature.inventory.esubs.encharges.settings.supported ? await this.updateEnchargesSettings() : false;
|
|
418
418
|
if (updateEnchargeSettings && this.feature.inventory.esubs.encharges.tariff.supported) await this.updateTariff();
|
|
@@ -2038,20 +2038,19 @@ class EnvoyData extends EventEmitter {
|
|
|
2038
2038
|
|
|
2039
2039
|
try {
|
|
2040
2040
|
const response = await this.axiosInstance.get(ApiUrls.EnsemblePower);
|
|
2041
|
-
const responseData = response.data;
|
|
2041
|
+
const responseData = response.data ?? {};
|
|
2042
2042
|
if (this.logDebug) this.emit('debug', `Ensemble power response:`, responseData);
|
|
2043
2043
|
|
|
2044
|
-
const devices = responseData.devices
|
|
2044
|
+
const devices = responseData.devices || [];
|
|
2045
2045
|
if (devices.length === 0) return false;
|
|
2046
2046
|
|
|
2047
2047
|
// update encharges
|
|
2048
2048
|
const enchargesRealPowerSummary = [];
|
|
2049
2049
|
const encharges = this.pv.inventory.esubs.encharges.devices || [];
|
|
2050
|
-
for (const
|
|
2051
|
-
const
|
|
2052
|
-
const encharge = encharges.find(device => device.serialNumber === serialNumber);
|
|
2050
|
+
for (const encharge of encharges) {
|
|
2051
|
+
const device = devices.find(device => device.serial_num === encharge.serialNumber);
|
|
2053
2052
|
if (this.logDebug) this.emit('debug', `Ensemble device power:`, device);
|
|
2054
|
-
if (!
|
|
2053
|
+
if (!device) continue;
|
|
2055
2054
|
|
|
2056
2055
|
encharge.power = {
|
|
2057
2056
|
serialNumber: device.serial_num,
|
|
@@ -2060,8 +2059,8 @@ class EnvoyData extends EventEmitter {
|
|
|
2060
2059
|
soc: device.soc,
|
|
2061
2060
|
};
|
|
2062
2061
|
|
|
2063
|
-
if (this.functions.isValidValue(encharge.power.realPower)) enchargesRealPowerSummary.push(encharge.power.realPower);
|
|
2064
2062
|
this.feature.inventory.esubs.encharges.power.supported = true;
|
|
2063
|
+
if (this.functions.isValidValue(encharge.power.realPower)) enchargesRealPowerSummary.push(encharge.power.realPower);
|
|
2065
2064
|
}
|
|
2066
2065
|
|
|
2067
2066
|
// Calculate encharges real power summary in kW
|
|
@@ -2091,7 +2090,7 @@ class EnvoyData extends EventEmitter {
|
|
|
2091
2090
|
const enchargesSettingsSupported = 'enc_settings' in enchargesSettings;
|
|
2092
2091
|
if (!enchargesSettingsSupported) return false;
|
|
2093
2092
|
|
|
2094
|
-
const settings
|
|
2093
|
+
const settings = {
|
|
2095
2094
|
enable: enchargesSettings.enc_settings.enable, // boolean
|
|
2096
2095
|
country: enchargesSettings.enc_settings.country, // string
|
|
2097
2096
|
currentLimit: enchargesSettings.enc_settings.current_limit, // float
|
|
@@ -2772,12 +2771,16 @@ class EnvoyData extends EventEmitter {
|
|
|
2772
2771
|
const getEnsemble = tokenRequired && this.feature.inventory.esubs.supported ? await this.updateEnsembleInventory() : false;
|
|
2773
2772
|
if (getEnsemble) {
|
|
2774
2773
|
await this.updateEnsembleStatus();
|
|
2775
|
-
if (this.feature.inventory.esubs.encharges.installed)
|
|
2776
|
-
|
|
2777
|
-
|
|
2774
|
+
if (this.feature.inventory.esubs.encharges.installed) {
|
|
2775
|
+
await this.updateEnsemblePower();
|
|
2776
|
+
await this.updateEnchargesSettings();
|
|
2777
|
+
await this.updateTariff();
|
|
2778
|
+
}
|
|
2778
2779
|
|
|
2779
|
-
|
|
2780
|
-
|
|
2780
|
+
if (this.feature.inventory.esubs.enpowers.installed) {
|
|
2781
|
+
await this.updateDryContacts();
|
|
2782
|
+
await this.updateDryContactsSettings();
|
|
2783
|
+
}
|
|
2781
2784
|
|
|
2782
2785
|
const getGenerator = await this.updateGenerator();
|
|
2783
2786
|
if (getGenerator && this.feature.inventory.esubs.generator.installed) await this.updateGeneratorSettings();
|
package/src/envoydevice.js
CHANGED
|
@@ -2257,22 +2257,14 @@ class EnvoyDevice extends EventEmitter {
|
|
|
2257
2257
|
{ type: Characteristic.ReadingTime, label: 'reading time', value: encharge.readingTime },
|
|
2258
2258
|
];
|
|
2259
2259
|
|
|
2260
|
-
if (gridProfileSupported) {
|
|
2261
|
-
characteristics.push(
|
|
2262
|
-
{ type: Characteristic.GridProfile, label: 'grid profile', value: encharge.gridProfile }
|
|
2263
|
-
);
|
|
2264
|
-
}
|
|
2265
|
-
|
|
2260
|
+
if (gridProfileSupported) characteristics.push({ type: Characteristic.GridProfile, label: 'grid profile', value: encharge.gridProfile });
|
|
2266
2261
|
if (enchargesStatusSupported && encharge.status) {
|
|
2267
2262
|
characteristics.push(
|
|
2268
2263
|
{ type: Characteristic.CommInterface, label: 'comm interface', value: encharge.status.commInterfaceStr },
|
|
2269
2264
|
{ type: Characteristic.RatedPower, label: 'rated power', value: encharge.status.ratedPowerKw, unit: 'kW' }
|
|
2270
2265
|
);
|
|
2271
2266
|
}
|
|
2272
|
-
|
|
2273
|
-
if (enchargesPowerSupported && encharge.power) {
|
|
2274
|
-
characteristics.push({ type: Characteristic.RealPower, label: 'real power', value: encharge.power.realPowerKw, unit: 'kW' });
|
|
2275
|
-
}
|
|
2267
|
+
if (enchargesPowerSupported && encharge.power) characteristics.push({ type: Characteristic.RealPower, label: 'real power', value: encharge.power.realPowerKw, unit: 'kW' });
|
|
2276
2268
|
|
|
2277
2269
|
for (const { type, label, value, unit = '', postfix = '' } of characteristics) {
|
|
2278
2270
|
if (!this.functions.isValidValue(value)) continue;
|
|
@@ -3526,10 +3518,16 @@ class EnvoyDevice extends EventEmitter {
|
|
|
3526
3518
|
powerPeak: pcu.powerPeak,
|
|
3527
3519
|
});
|
|
3528
3520
|
|
|
3521
|
+
if (this.logInfo) {
|
|
3522
|
+
this.emit('info', `Microinverter, ${pcuData.serialNumber}, power: ${pcuData.power} W`);
|
|
3523
|
+
this.emit('info', `Microinverter, ${pcuData.serialNumber}, phase: ${pcuData.phase}`);
|
|
3524
|
+
}
|
|
3525
|
+
|
|
3529
3526
|
// Add characteristics
|
|
3530
3527
|
characteristics.push(
|
|
3531
3528
|
{ type: Characteristic.PowerW, value: pcuData.power },
|
|
3532
|
-
{ type: Characteristic.PowerPeakW, value: pcuData.powerPeak }
|
|
3529
|
+
{ type: Characteristic.PowerPeakW, value: pcuData.powerPeak }
|
|
3530
|
+
);
|
|
3533
3531
|
}
|
|
3534
3532
|
|
|
3535
3533
|
// Add detailed info if supported
|
|
@@ -3629,9 +3627,9 @@ class EnvoyDevice extends EventEmitter {
|
|
|
3629
3627
|
plcLevel: nsrb.plcLevel,
|
|
3630
3628
|
};
|
|
3631
3629
|
|
|
3632
|
-
if (this.
|
|
3633
|
-
this.emit('
|
|
3634
|
-
this.emit('
|
|
3630
|
+
if (this.logInfo) {
|
|
3631
|
+
this.emit('info', `Q-Relay, ${nsrbData.serialNumber}, state: ${nsrbData.relay}`);
|
|
3632
|
+
this.emit('info', `Q-Relay, ${nsrbData.serialNumber}, lines: ${nsrbData.linesCount}`);
|
|
3635
3633
|
}
|
|
3636
3634
|
|
|
3637
3635
|
// Create characteristics
|