homebridge-enphase-envoy 10.3.0-beta.8 → 10.3.1-beta.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/CHANGELOG.md +1 -1
- package/README.md +2 -2
- package/index.js +1 -2
- package/package.json +1 -1
- package/src/constants.js +4 -0
- package/src/customcharacteristics.js +0 -16
- package/src/envoydata.js +17 -14
- package/src/envoydevice.js +19 -27
package/CHANGELOG.md
CHANGED
|
@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
- after update to v10.0.0 and above the accessory and bridge need to be removed from the homebridge / Home.app and added again
|
|
11
11
|
|
|
12
|
-
## [10.3.0] - (
|
|
12
|
+
## [10.3.0] - (20.10.2025)
|
|
13
13
|
|
|
14
14
|
## Changes
|
|
15
15
|
|
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/index.js
CHANGED
|
@@ -31,7 +31,7 @@ class EnvoyPlatform {
|
|
|
31
31
|
|
|
32
32
|
const deviceName = device.name;
|
|
33
33
|
const host = device.host || (i === 0 ? 'envoy.local' : `envoy-${i + 1}.local`);
|
|
34
|
-
const { envoyFirmware7xxTokenGenerationMode = 0,
|
|
34
|
+
const { envoyFirmware7xxTokenGenerationMode = 0, envoyToken, enlightenUser, enlightenPasswd } = device;
|
|
35
35
|
|
|
36
36
|
const logLevel = {
|
|
37
37
|
devInfo: device.log?.deviceInfo || true,
|
|
@@ -121,7 +121,6 @@ class EnvoyPlatform {
|
|
|
121
121
|
|
|
122
122
|
// start impulse generator
|
|
123
123
|
await impulseGenerator.state(true, [{ name: 'start', sampling: 120000 }]);
|
|
124
|
-
|
|
125
124
|
} catch (error) {
|
|
126
125
|
if (logLevel.error) log.error(`Device: ${host} ${deviceName}, Did finish launching error: ${error}`);
|
|
127
126
|
}
|
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.0",
|
|
6
6
|
"description": "Homebridge p7ugin for Photovoltaic Energy System manufactured by Enphase.",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "grzegorz914",
|
package/src/constants.js
CHANGED
|
@@ -174,10 +174,13 @@ export const ApiCodes = {
|
|
|
174
174
|
"ENCHG_STATE_DISCHARGING": "Encharge state discharging",
|
|
175
175
|
"ENCHG_STATE_IDLE": "Encharge state idle",
|
|
176
176
|
"ENCHG_STATE_READY": "Encharge state ready",
|
|
177
|
+
"ENCMN_MDE_BMU_READY": "Encharge BMU ready",
|
|
177
178
|
"ENCMN_MDE_ENCHARGE_READY": "Encharge mode ready",
|
|
178
179
|
"ENCMN_MDE_ON_GRID": "Encharge mode on grid",
|
|
179
180
|
"ENCMN_MDE_OFF_GRID": "Encharge mode off grid",
|
|
181
|
+
"ENCMN_MDE_PCU_READY": "Encharge Microinverter ready",
|
|
180
182
|
"ENCMN_C6_CC_READY": "C6 Combiner Controller ready",
|
|
183
|
+
"ENCMN_C6_RGM_DEV_CONNECTED": "C6 Revenue Grade Meter connected",
|
|
181
184
|
"ENPOWER": "Enpower",
|
|
182
185
|
"ENS_DEVICE_STATE_READY": "Ensemble state ready",
|
|
183
186
|
"ENPWR_STATE_GRIDMODE_CONFIRM": "Enpower state grid mode confirm",
|
|
@@ -202,6 +205,7 @@ export const ApiCodes = {
|
|
|
202
205
|
"check-wiring": "Check Wiring",
|
|
203
206
|
"close": "Close",
|
|
204
207
|
"closed": "Closed",
|
|
208
|
+
"configured": "Configured",
|
|
205
209
|
"connected": "Connected",
|
|
206
210
|
"consumption": "Consumption Net",
|
|
207
211
|
"discharging": "Discharging",
|
|
@@ -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;
|
|
@@ -3630,7 +3622,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
3630
3622
|
};
|
|
3631
3623
|
|
|
3632
3624
|
if (this.logDebug) {
|
|
3633
|
-
this.emit('debug', `Q-
|
|
3625
|
+
this.emit('debug', `Q-Relay state:`, nsrbData.relay);
|
|
3634
3626
|
this.emit('debug', `Q-Relay lines:`, nsrbData.linesCount);
|
|
3635
3627
|
}
|
|
3636
3628
|
|
|
@@ -4835,8 +4827,8 @@ class EnvoyDevice extends EventEmitter {
|
|
|
4835
4827
|
const info = tariffData.tariff ?? {};
|
|
4836
4828
|
const tariff = {};
|
|
4837
4829
|
tariff.info = {
|
|
4838
|
-
currencyCode: info.currency.code
|
|
4839
|
-
logger: info.logger
|
|
4830
|
+
currencyCode: info.currency.code,
|
|
4831
|
+
logger: info.logger,
|
|
4840
4832
|
date: this.functions.formatTimestamp(info.date, this.pv.homeData.timeZone),
|
|
4841
4833
|
};
|
|
4842
4834
|
|
|
@@ -4844,7 +4836,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
4844
4836
|
const s = info.storage_settings ?? {};
|
|
4845
4837
|
tariff.storageSettings = {
|
|
4846
4838
|
mode: s.mode,
|
|
4847
|
-
operationModeSubType: s.operation_mode_sub_type
|
|
4839
|
+
operationModeSubType: s.operation_mode_sub_type,
|
|
4848
4840
|
reservedSoc: s.reserved_soc,
|
|
4849
4841
|
veryLowSoc: s.very_low_soc,
|
|
4850
4842
|
chargeFromGrid: !!s.charge_from_grid,
|
|
@@ -4891,16 +4883,16 @@ class EnvoyDevice extends EventEmitter {
|
|
|
4891
4883
|
// Schedule
|
|
4892
4884
|
const sched = tariffData.schedule ?? {};
|
|
4893
4885
|
tariff.schedule = {
|
|
4894
|
-
fileName: sched.filename
|
|
4895
|
-
source: sched.source
|
|
4886
|
+
fileName: sched.filename,
|
|
4887
|
+
source: sched.source,
|
|
4896
4888
|
date: this.functions.formatTimestamp(sched.date, this.pv.homeData.timeZone),
|
|
4897
|
-
version: sched.version
|
|
4889
|
+
version: sched.version,
|
|
4898
4890
|
reservedSoc: sched.reserved_soc,
|
|
4899
4891
|
veryLowSoc: sched.very_low_soc,
|
|
4900
4892
|
chargeFromGrid: !!sched.charge_from_grid,
|
|
4901
|
-
battMode: sched.batt_mode
|
|
4902
|
-
batteryMode: sched.battery_mode
|
|
4903
|
-
operationModeSubType: sched.operation_mode_sub_type
|
|
4893
|
+
battMode: sched.batt_mode,
|
|
4894
|
+
batteryMode: sched.battery_mode,
|
|
4895
|
+
operationModeSubType: sched.operation_mode_sub_type,
|
|
4904
4896
|
override: !!sched.override,
|
|
4905
4897
|
overrideBackupSoc: sched.override_backup_soc,
|
|
4906
4898
|
overrideChgDischargeRate: sched.override_chg_discharge_rate,
|
|
@@ -4932,7 +4924,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
4932
4924
|
this.enchargeProfileControlsServices?.[i]?.updateCharacteristic(type, value);
|
|
4933
4925
|
}
|
|
4934
4926
|
}
|
|
4935
|
-
|
|
4927
|
+
|
|
4936
4928
|
// Encharge profile sensors update
|
|
4937
4929
|
for (let i = 0; i < this.enchargeProfileSensors.length; i++) {
|
|
4938
4930
|
const sensor = this.enchargeProfileSensors[i];
|
|
@@ -4955,7 +4947,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
4955
4947
|
// Save updated tariff
|
|
4956
4948
|
this.pv.inventoryData.esubs.encharges.tariff = tariff;
|
|
4957
4949
|
}
|
|
4958
|
-
|
|
4950
|
+
|
|
4959
4951
|
// Add rated power summary in kW
|
|
4960
4952
|
if (enchargesStatusSupported && this.functions.isValidValue(encharges.ratedPowerSumKw)) {
|
|
4961
4953
|
this.pv.inventoryData.esubs.encharges.ratedPowerSumKw = encharges.ratedPowerSumKw;
|
|
@@ -4963,7 +4955,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
4963
4955
|
// Add to ensemble summary characteristics
|
|
4964
4956
|
ensembleSummaryCharacteristics.push({ type: Characteristic.RatedPower, value: encharges.ratedPowerSumKw });
|
|
4965
4957
|
}
|
|
4966
|
-
|
|
4958
|
+
|
|
4967
4959
|
// Add real power summary in kW
|
|
4968
4960
|
if (enchargesPowerSupported && this.functions.isValidValue(encharges.realPowerSumKw)) {
|
|
4969
4961
|
this.pv.inventoryData.esubs.encharges.realPowerSumKw = encharges.realPowerSumKw;
|
|
@@ -4972,7 +4964,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
4972
4964
|
ensembleSummaryCharacteristics.push({ type: Characteristic.RealPower, value: encharges.realPowerSumKw });
|
|
4973
4965
|
}
|
|
4974
4966
|
}
|
|
4975
|
-
|
|
4967
|
+
|
|
4976
4968
|
// Update ensemble summary service
|
|
4977
4969
|
for (const { type, value } of ensembleSummaryCharacteristics) {
|
|
4978
4970
|
if (!this.functions.isValidValue(value)) continue;
|
|
@@ -5073,8 +5065,8 @@ class EnvoyDevice extends EventEmitter {
|
|
|
5073
5065
|
gridActionBool: settings.gridAction !== 'none',
|
|
5074
5066
|
microGridAction: settings.microGridAction,
|
|
5075
5067
|
genAction: settings.genAction,
|
|
5076
|
-
essentialStartTime: settings.essentialStartTime
|
|
5077
|
-
essentialEndTime: settings.essentialEndTime
|
|
5068
|
+
essentialStartTime: settings.essentialStartTime,
|
|
5069
|
+
essentialEndTime: settings.essentialEndTime,
|
|
5078
5070
|
priority: settings.priority,
|
|
5079
5071
|
blackSStart: settings.blackSStart,
|
|
5080
5072
|
override: settings.override ?? 'false',
|
|
@@ -5662,8 +5654,8 @@ class EnvoyDevice extends EventEmitter {
|
|
|
5662
5654
|
// Update ensemble summary service
|
|
5663
5655
|
if (this.feature.inventory.esubs.secctrl.supported) {
|
|
5664
5656
|
const characteristics = [
|
|
5665
|
-
{ type: Characteristic.EncAggBackupEnergy, value: energySumEncKw, valueKey: 'encAggBackupEnergy' },
|
|
5666
5657
|
{ type: Characteristic.EncAggSoc, value: percentFullSumEnc, valueKey: 'encAggSoc' },
|
|
5658
|
+
{ type: Characteristic.EncAggBackupEnergy, value: energySumEncKw, valueKey: 'encAggBackupEnergy' },
|
|
5667
5659
|
];
|
|
5668
5660
|
|
|
5669
5661
|
// Update storage summary services
|