homebridge-enphase-envoy 10.2.6-beta.1 → 10.2.6-beta.10
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 +10 -0
- package/package.json +1 -1
- package/src/customcharacteristics.js +190 -162
- package/src/energymeter.js +0 -2
- package/src/envoydata.js +5 -8
- package/src/envoydevice.js +177 -130
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,16 @@ 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.2.6] - (18.10.2025)
|
|
13
|
+
|
|
14
|
+
## Changes
|
|
15
|
+
|
|
16
|
+
- fix [#216](https://github.com/grzegorz914/homebridge-enphase-envoy/issues/216)
|
|
17
|
+
- fix [#217](https://github.com/grzegorz914/homebridge-enphase-envoy/issues/217)
|
|
18
|
+
- fix wireless connections kit publish
|
|
19
|
+
- added network interface services
|
|
20
|
+
- cleanup
|
|
21
|
+
|
|
12
22
|
## [10.2.5] - (17.10.2025)
|
|
13
23
|
|
|
14
24
|
## Changes
|
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.6-beta.
|
|
5
|
+
"version": "10.2.6-beta.10",
|
|
6
6
|
"description": "Homebridge p7ugin for Photovoltaic Energy System manufactured by Enphase.",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "grzegorz914",
|
|
@@ -251,6 +251,18 @@ export default (api) => {
|
|
|
251
251
|
}
|
|
252
252
|
Characteristic.EnpowerGridMode = EnpowerGridMode;
|
|
253
253
|
|
|
254
|
+
class AddressIp extends Characteristic {
|
|
255
|
+
constructor() {
|
|
256
|
+
super('Address IP', '00000029-000B-1000-8000-0026BB765291');
|
|
257
|
+
this.setProps({
|
|
258
|
+
format: Formats.STRING,
|
|
259
|
+
perms: [Perms.PAIRED_READ, Perms.NOTIFY]
|
|
260
|
+
});
|
|
261
|
+
this.value = this.getDefaultValue();
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
Characteristic.AddressIp = AddressIp;
|
|
265
|
+
|
|
254
266
|
class GeneratorState extends Characteristic {
|
|
255
267
|
constructor() {
|
|
256
268
|
super('Generator state', '00000301-000B-1000-8000-0026BB765291');
|
|
@@ -1073,8 +1085,8 @@ export default (api) => {
|
|
|
1073
1085
|
this.setProps({
|
|
1074
1086
|
format: Formats.FLOAT,
|
|
1075
1087
|
unit: 'A',
|
|
1076
|
-
maxValue:
|
|
1077
|
-
minValue: -
|
|
1088
|
+
maxValue: 1000000,
|
|
1089
|
+
minValue: -1000000,
|
|
1078
1090
|
minStep: 0.1,
|
|
1079
1091
|
perms: [Perms.PAIRED_READ, Perms.NOTIFY]
|
|
1080
1092
|
});
|
|
@@ -1880,56 +1892,7 @@ export default (api) => {
|
|
|
1880
1892
|
}
|
|
1881
1893
|
Service.EnvoyService = EnvoyService;
|
|
1882
1894
|
|
|
1883
|
-
//
|
|
1884
|
-
class WirelessConnectionKitService extends Service {
|
|
1885
|
-
constructor(displayName, subtype) {
|
|
1886
|
-
super(displayName, '00000010-000A-1000-8000-0026BB765291', subtype);
|
|
1887
|
-
// Mandatory Characteristics
|
|
1888
|
-
this.addCharacteristic(Characteristic.Connected);
|
|
1889
|
-
// Optional Characteristics
|
|
1890
|
-
this.addOptionalCharacteristic(Characteristic.Type);
|
|
1891
|
-
this.addOptionalCharacteristic(Characteristic.SignalStrength);
|
|
1892
|
-
this.addOptionalCharacteristic(Characteristic.SignalStrengthMax);
|
|
1893
|
-
this.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
1894
|
-
}
|
|
1895
|
-
}
|
|
1896
|
-
Service.WirelessConnectionKitService = WirelessConnectionKitService;
|
|
1897
|
-
|
|
1898
|
-
//Microinverter service
|
|
1899
|
-
class MicroinverterService extends Service {
|
|
1900
|
-
constructor(displayName, subtype) {
|
|
1901
|
-
super(displayName, '00000007-000A-1000-8000-0026BB765291', subtype);
|
|
1902
|
-
// Mandatory Characteristics
|
|
1903
|
-
this.addCharacteristic(Characteristic.Status);
|
|
1904
|
-
// Optional Characteristics
|
|
1905
|
-
this.addOptionalCharacteristic(Characteristic.Producing);
|
|
1906
|
-
this.addOptionalCharacteristic(Characteristic.Communicating);
|
|
1907
|
-
this.addOptionalCharacteristic(Characteristic.Provisioned);
|
|
1908
|
-
this.addOptionalCharacteristic(Characteristic.Operating);
|
|
1909
|
-
this.addOptionalCharacteristic(Characteristic.GfiClear);
|
|
1910
|
-
this.addOptionalCharacteristic(Characteristic.Phase);
|
|
1911
|
-
this.addOptionalCharacteristic(Characteristic.Firmware);
|
|
1912
|
-
this.addOptionalCharacteristic(Characteristic.PowerW);
|
|
1913
|
-
this.addOptionalCharacteristic(Characteristic.PowerPeakW);
|
|
1914
|
-
this.addOptionalCharacteristic(Characteristic.EnergyTodayWh);
|
|
1915
|
-
this.addOptionalCharacteristic(Characteristic.EnergyYesterdayWh);
|
|
1916
|
-
this.addOptionalCharacteristic(Characteristic.EnergyLastSevenDays);
|
|
1917
|
-
this.addOptionalCharacteristic(Characteristic.EnergyLifetime);
|
|
1918
|
-
this.addOptionalCharacteristic(Characteristic.Current);
|
|
1919
|
-
this.addOptionalCharacteristic(Characteristic.Voltage);
|
|
1920
|
-
this.addOptionalCharacteristic(Characteristic.Frequency);
|
|
1921
|
-
this.addOptionalCharacteristic(Characteristic.CurrentDc);
|
|
1922
|
-
this.addOptionalCharacteristic(Characteristic.VoltageDc);
|
|
1923
|
-
this.addOptionalCharacteristic(Characteristic.Temperature);
|
|
1924
|
-
this.addOptionalCharacteristic(Characteristic.PlcLevel);
|
|
1925
|
-
this.addOptionalCharacteristic(Characteristic.GridProfile);
|
|
1926
|
-
this.addOptionalCharacteristic(Characteristic.ReadingTime);
|
|
1927
|
-
this.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
1928
|
-
}
|
|
1929
|
-
}
|
|
1930
|
-
Service.MicroinverterService = MicroinverterService;
|
|
1931
|
-
|
|
1932
|
-
//qrelay service
|
|
1895
|
+
//Qrelay service
|
|
1933
1896
|
class QrelayService extends Service {
|
|
1934
1897
|
constructor(displayName, subtype) {
|
|
1935
1898
|
super(displayName, '00000002-000A-1000-8000-0026BB765291', subtype);
|
|
@@ -1960,50 +1923,6 @@ export default (api) => {
|
|
|
1960
1923
|
}
|
|
1961
1924
|
Service.QrelayService = QrelayService;
|
|
1962
1925
|
|
|
1963
|
-
//AC Batterie service
|
|
1964
|
-
class AcBatterieService extends Service {
|
|
1965
|
-
constructor(displayName, subtype) {
|
|
1966
|
-
super(displayName, '00000006-000A-1000-8000-0026BB765291', subtype);
|
|
1967
|
-
// Mandatory Characteristics
|
|
1968
|
-
this.addCharacteristic(Characteristic.ChargeState);
|
|
1969
|
-
// Optional Characteristics
|
|
1970
|
-
this.addOptionalCharacteristic(Characteristic.Status);
|
|
1971
|
-
this.addOptionalCharacteristic(Characteristic.Producing);
|
|
1972
|
-
this.addOptionalCharacteristic(Characteristic.Communicating);
|
|
1973
|
-
this.addOptionalCharacteristic(Characteristic.Provisioned);
|
|
1974
|
-
this.addOptionalCharacteristic(Characteristic.Operating);
|
|
1975
|
-
this.addOptionalCharacteristic(Characteristic.GfiClear);
|
|
1976
|
-
this.addOptionalCharacteristic(Characteristic.SleepEnabled);
|
|
1977
|
-
this.addOptionalCharacteristic(Characteristic.PercentFull);
|
|
1978
|
-
this.addOptionalCharacteristic(Characteristic.MaxCellTemp);
|
|
1979
|
-
this.addOptionalCharacteristic(Characteristic.SleepMinSoc);
|
|
1980
|
-
this.addOptionalCharacteristic(Characteristic.SleepMaxSoc);
|
|
1981
|
-
this.addOptionalCharacteristic(Characteristic.Firmware);
|
|
1982
|
-
this.addOptionalCharacteristic(Characteristic.PlcLevel);
|
|
1983
|
-
this.addOptionalCharacteristic(Characteristic.GridProfile);
|
|
1984
|
-
this.addOptionalCharacteristic(Characteristic.ReadingTime);
|
|
1985
|
-
this.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
1986
|
-
}
|
|
1987
|
-
}
|
|
1988
|
-
Service.AcBatterieService = AcBatterieService;
|
|
1989
|
-
|
|
1990
|
-
//AC Batterie summary service
|
|
1991
|
-
class AcBatterieSummaryService extends Service {
|
|
1992
|
-
constructor(displayName, subtype) {
|
|
1993
|
-
super(displayName, '00000005-000A-1000-8000-0026BB765291', subtype);
|
|
1994
|
-
// Mandatory Characteristics
|
|
1995
|
-
this.addCharacteristic(Characteristic.ChargeState);
|
|
1996
|
-
// Optional Characteristics
|
|
1997
|
-
this.addOptionalCharacteristic(Characteristic.Power);
|
|
1998
|
-
this.addOptionalCharacteristic(Characteristic.Energy);
|
|
1999
|
-
this.addOptionalCharacteristic(Characteristic.PercentFull);
|
|
2000
|
-
this.addOptionalCharacteristic(Characteristic.ActiveCount);
|
|
2001
|
-
this.addOptionalCharacteristic(Characteristic.GridProfile);
|
|
2002
|
-
this.addOptionalCharacteristic(Characteristic.ReadingTime);
|
|
2003
|
-
this.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
2004
|
-
}
|
|
2005
|
-
}
|
|
2006
|
-
Service.AcBatterieSummaryService = AcBatterieSummaryService;
|
|
2007
1926
|
|
|
2008
1927
|
//Meters service
|
|
2009
1928
|
class MeterService extends Service {
|
|
@@ -2058,24 +1977,109 @@ export default (api) => {
|
|
|
2058
1977
|
}
|
|
2059
1978
|
Service.PowerAndEnergyService = PowerAndEnergyService;
|
|
2060
1979
|
|
|
2061
|
-
//
|
|
2062
|
-
class
|
|
1980
|
+
//AC Batterie summary service
|
|
1981
|
+
class AcBatterieSummaryService extends Service {
|
|
2063
1982
|
constructor(displayName, subtype) {
|
|
2064
|
-
super(displayName, '
|
|
1983
|
+
super(displayName, '00000005-000A-1000-8000-0026BB765291', subtype);
|
|
1984
|
+
// Mandatory Characteristics
|
|
1985
|
+
this.addCharacteristic(Characteristic.ChargeState);
|
|
1986
|
+
// Optional Characteristics
|
|
1987
|
+
this.addOptionalCharacteristic(Characteristic.Power);
|
|
1988
|
+
this.addOptionalCharacteristic(Characteristic.Energy);
|
|
1989
|
+
this.addOptionalCharacteristic(Characteristic.PercentFull);
|
|
1990
|
+
this.addOptionalCharacteristic(Characteristic.ActiveCount);
|
|
1991
|
+
this.addOptionalCharacteristic(Characteristic.GridProfile);
|
|
1992
|
+
this.addOptionalCharacteristic(Characteristic.ReadingTime);
|
|
1993
|
+
this.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
Service.AcBatterieSummaryService = AcBatterieSummaryService;
|
|
1997
|
+
|
|
1998
|
+
//AC Batterie service
|
|
1999
|
+
class AcBatterieService extends Service {
|
|
2000
|
+
constructor(displayName, subtype) {
|
|
2001
|
+
super(displayName, '00000006-000A-1000-8000-0026BB765291', subtype);
|
|
2002
|
+
// Mandatory Characteristics
|
|
2003
|
+
this.addCharacteristic(Characteristic.ChargeState);
|
|
2004
|
+
// Optional Characteristics
|
|
2005
|
+
this.addOptionalCharacteristic(Characteristic.Status);
|
|
2006
|
+
this.addOptionalCharacteristic(Characteristic.Producing);
|
|
2007
|
+
this.addOptionalCharacteristic(Characteristic.Communicating);
|
|
2008
|
+
this.addOptionalCharacteristic(Characteristic.Provisioned);
|
|
2009
|
+
this.addOptionalCharacteristic(Characteristic.Operating);
|
|
2010
|
+
this.addOptionalCharacteristic(Characteristic.GfiClear);
|
|
2011
|
+
this.addOptionalCharacteristic(Characteristic.SleepEnabled);
|
|
2012
|
+
this.addOptionalCharacteristic(Characteristic.PercentFull);
|
|
2013
|
+
this.addOptionalCharacteristic(Characteristic.MaxCellTemp);
|
|
2014
|
+
this.addOptionalCharacteristic(Characteristic.SleepMinSoc);
|
|
2015
|
+
this.addOptionalCharacteristic(Characteristic.SleepMaxSoc);
|
|
2016
|
+
this.addOptionalCharacteristic(Characteristic.Firmware);
|
|
2017
|
+
this.addOptionalCharacteristic(Characteristic.PlcLevel);
|
|
2018
|
+
this.addOptionalCharacteristic(Characteristic.GridProfile);
|
|
2019
|
+
this.addOptionalCharacteristic(Characteristic.ReadingTime);
|
|
2020
|
+
this.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
Service.AcBatterieService = AcBatterieService;
|
|
2024
|
+
|
|
2025
|
+
|
|
2026
|
+
//Microinverter service
|
|
2027
|
+
class MicroinverterService extends Service {
|
|
2028
|
+
constructor(displayName, subtype) {
|
|
2029
|
+
super(displayName, '00000007-000A-1000-8000-0026BB765291', subtype);
|
|
2065
2030
|
// Mandatory Characteristics
|
|
2066
2031
|
this.addCharacteristic(Characteristic.Status);
|
|
2067
2032
|
// Optional Characteristics
|
|
2033
|
+
this.addOptionalCharacteristic(Characteristic.Producing);
|
|
2068
2034
|
this.addOptionalCharacteristic(Characteristic.Communicating);
|
|
2035
|
+
this.addOptionalCharacteristic(Characteristic.Provisioned);
|
|
2069
2036
|
this.addOptionalCharacteristic(Characteristic.Operating);
|
|
2070
2037
|
this.addOptionalCharacteristic(Characteristic.GfiClear);
|
|
2038
|
+
this.addOptionalCharacteristic(Characteristic.Phase);
|
|
2071
2039
|
this.addOptionalCharacteristic(Characteristic.Firmware);
|
|
2040
|
+
this.addOptionalCharacteristic(Characteristic.PowerW);
|
|
2041
|
+
this.addOptionalCharacteristic(Characteristic.PowerPeakW);
|
|
2042
|
+
this.addOptionalCharacteristic(Characteristic.EnergyTodayWh);
|
|
2043
|
+
this.addOptionalCharacteristic(Characteristic.EnergyYesterdayWh);
|
|
2044
|
+
this.addOptionalCharacteristic(Characteristic.EnergyLastSevenDays);
|
|
2045
|
+
this.addOptionalCharacteristic(Characteristic.EnergyLifetime);
|
|
2046
|
+
this.addOptionalCharacteristic(Characteristic.Current);
|
|
2047
|
+
this.addOptionalCharacteristic(Characteristic.Voltage);
|
|
2048
|
+
this.addOptionalCharacteristic(Characteristic.Frequency);
|
|
2049
|
+
this.addOptionalCharacteristic(Characteristic.CurrentDc);
|
|
2050
|
+
this.addOptionalCharacteristic(Characteristic.VoltageDc);
|
|
2051
|
+
this.addOptionalCharacteristic(Characteristic.Temperature);
|
|
2052
|
+
this.addOptionalCharacteristic(Characteristic.PlcLevel);
|
|
2053
|
+
this.addOptionalCharacteristic(Characteristic.GridProfile);
|
|
2054
|
+
this.addOptionalCharacteristic(Characteristic.ReadingTime);
|
|
2055
|
+
this.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
2056
|
+
}
|
|
2057
|
+
}
|
|
2058
|
+
Service.MicroinverterService = MicroinverterService;
|
|
2059
|
+
|
|
2060
|
+
// Enpower service
|
|
2061
|
+
class EnpowerService extends Service {
|
|
2062
|
+
constructor(displayName, subtype) {
|
|
2063
|
+
super(displayName, '00000008-000A-1000-8000-0026BB765291', subtype);
|
|
2064
|
+
// Mandatory Characteristics
|
|
2065
|
+
this.addCharacteristic(Characteristic.AdminState);
|
|
2066
|
+
// Optional Characteristics
|
|
2067
|
+
this.addOptionalCharacteristic(Characteristic.Communicating);
|
|
2068
|
+
this.addOptionalCharacteristic(Characteristic.CommLevelSubGhz);
|
|
2069
|
+
this.addOptionalCharacteristic(Characteristic.CommLevel24Ghz);
|
|
2070
|
+
this.addOptionalCharacteristic(Characteristic.Temperature);
|
|
2071
|
+
this.addOptionalCharacteristic(Characteristic.OperatingState);
|
|
2072
|
+
this.addOptionalCharacteristic(Characteristic.GridMode);
|
|
2073
|
+
this.addOptionalCharacteristic(Characteristic.EnchgGridMode);
|
|
2074
|
+
this.addOptionalCharacteristic(Characteristic.Status);
|
|
2072
2075
|
this.addOptionalCharacteristic(Characteristic.ReadingTime);
|
|
2073
2076
|
this.addOptionalCharacteristic(Characteristic.CommInterface);
|
|
2074
|
-
this.addOptionalCharacteristic(Characteristic.
|
|
2077
|
+
this.addOptionalCharacteristic(Characteristic.PlcLevel);
|
|
2078
|
+
this.addOptionalCharacteristic(Characteristic.GridProfile);
|
|
2075
2079
|
this.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
2076
2080
|
}
|
|
2077
2081
|
}
|
|
2078
|
-
Service.
|
|
2082
|
+
Service.EnpowerService = EnpowerService;
|
|
2079
2083
|
|
|
2080
2084
|
//Ennsemble service
|
|
2081
2085
|
class EnsembleSummaryService extends Service {
|
|
@@ -2110,6 +2114,81 @@ export default (api) => {
|
|
|
2110
2114
|
}
|
|
2111
2115
|
Service.EnsembleSummaryService = EnsembleSummaryService;
|
|
2112
2116
|
|
|
2117
|
+
//Wireless connection kit service
|
|
2118
|
+
class WirelessConnectionKitService extends Service {
|
|
2119
|
+
constructor(displayName, subtype) {
|
|
2120
|
+
super(displayName, '00000010-000A-1000-8000-0026BB765291', subtype);
|
|
2121
|
+
// Mandatory Characteristics
|
|
2122
|
+
this.addCharacteristic(Characteristic.Type);
|
|
2123
|
+
// Optional Characteristics
|
|
2124
|
+
this.addOptionalCharacteristic(Characteristic.SignalStrength);
|
|
2125
|
+
this.addOptionalCharacteristic(Characteristic.Connected);
|
|
2126
|
+
this.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
2129
|
+
Service.WirelessConnectionKitService = WirelessConnectionKitService;
|
|
2130
|
+
|
|
2131
|
+
//Ensemble inventory service
|
|
2132
|
+
class EnsembleService extends Service {
|
|
2133
|
+
constructor(displayName, subtype) {
|
|
2134
|
+
super(displayName, '00000011-000B-1000-8000-0026BB765291', subtype);
|
|
2135
|
+
// Mandatory Characteristics
|
|
2136
|
+
this.addCharacteristic(Characteristic.Status);
|
|
2137
|
+
// Optional Characteristics
|
|
2138
|
+
this.addOptionalCharacteristic(Characteristic.Communicating);
|
|
2139
|
+
this.addOptionalCharacteristic(Characteristic.Operating);
|
|
2140
|
+
this.addOptionalCharacteristic(Characteristic.GfiClear);
|
|
2141
|
+
this.addOptionalCharacteristic(Characteristic.Firmware);
|
|
2142
|
+
this.addOptionalCharacteristic(Characteristic.ReadingTime);
|
|
2143
|
+
this.addOptionalCharacteristic(Characteristic.CommInterface);
|
|
2144
|
+
this.addOptionalCharacteristic(Characteristic.AdminState);
|
|
2145
|
+
this.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
2146
|
+
}
|
|
2147
|
+
}
|
|
2148
|
+
Service.EnsembleService = EnsembleService;
|
|
2149
|
+
|
|
2150
|
+
//Live data service
|
|
2151
|
+
class LiveDataService extends Service {
|
|
2152
|
+
constructor(displayName, subtype) {
|
|
2153
|
+
super(displayName, '00000012-000A-1000-8000-0026BB765291', subtype);
|
|
2154
|
+
// Mandatory Characteristics
|
|
2155
|
+
this.addCharacteristic(Characteristic.Power);
|
|
2156
|
+
// Optional Characteristics
|
|
2157
|
+
this.addOptionalCharacteristic(Characteristic.PowerL1);
|
|
2158
|
+
this.addOptionalCharacteristic(Characteristic.PowerL2);
|
|
2159
|
+
this.addOptionalCharacteristic(Characteristic.PowerL3);
|
|
2160
|
+
this.addOptionalCharacteristic(Characteristic.ApparentPower);
|
|
2161
|
+
this.addOptionalCharacteristic(Characteristic.ApparentPowerL1);
|
|
2162
|
+
this.addOptionalCharacteristic(Characteristic.ApparentPowerL2);
|
|
2163
|
+
this.addOptionalCharacteristic(Characteristic.ApparentPowerL3);
|
|
2164
|
+
this.addOptionalCharacteristic(Characteristic.ReadingTime);
|
|
2165
|
+
this.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2168
|
+
Service.LiveDataService = LiveDataService;
|
|
2169
|
+
|
|
2170
|
+
//Generator service
|
|
2171
|
+
class GerneratorService extends Service {
|
|
2172
|
+
constructor(displayName, subtype) {
|
|
2173
|
+
super(displayName, '00000013-000A-1000-8000-0026BB765291', subtype);
|
|
2174
|
+
// Mandatory Characteristics
|
|
2175
|
+
this.addCharacteristic(Characteristic.AdminMode);
|
|
2176
|
+
// Optional Characteristics
|
|
2177
|
+
this.addOptionalCharacteristic(Characteristic.Type);
|
|
2178
|
+
this.addOptionalCharacteristic(Characteristic.AdminState);
|
|
2179
|
+
this.addOptionalCharacteristic(Characteristic.OperatingState);
|
|
2180
|
+
this.addOptionalCharacteristic(Characteristic.StartSoc);
|
|
2181
|
+
this.addOptionalCharacteristic(Characteristic.StopSoc);
|
|
2182
|
+
this.addOptionalCharacteristic(Characteristic.ExexOn);
|
|
2183
|
+
this.addOptionalCharacteristic(Characteristic.Shedule);
|
|
2184
|
+
this.addOptionalCharacteristic(Characteristic.Present);
|
|
2185
|
+
this.addOptionalCharacteristic(Characteristic.ReadingTime);
|
|
2186
|
+
this.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
2189
|
+
Service.GerneratorService = GerneratorService;
|
|
2190
|
+
|
|
2191
|
+
|
|
2113
2192
|
//Encharge service
|
|
2114
2193
|
class EnchargeService extends Service {
|
|
2115
2194
|
constructor(displayName, subtype) {
|
|
@@ -2140,34 +2219,10 @@ export default (api) => {
|
|
|
2140
2219
|
}
|
|
2141
2220
|
Service.EnchargeService = EnchargeService;
|
|
2142
2221
|
|
|
2143
|
-
// Enpower service
|
|
2144
|
-
class EnpowerService extends Service {
|
|
2145
|
-
constructor(displayName, subtype) {
|
|
2146
|
-
super(displayName, '00000008-000A-1000-8000-0026BB765291', subtype);
|
|
2147
|
-
// Mandatory Characteristics
|
|
2148
|
-
this.addCharacteristic(Characteristic.AdminState);
|
|
2149
|
-
// Optional Characteristics
|
|
2150
|
-
this.addOptionalCharacteristic(Characteristic.Communicating);
|
|
2151
|
-
this.addOptionalCharacteristic(Characteristic.CommLevelSubGhz);
|
|
2152
|
-
this.addOptionalCharacteristic(Characteristic.CommLevel24Ghz);
|
|
2153
|
-
this.addOptionalCharacteristic(Characteristic.Temperature);
|
|
2154
|
-
this.addOptionalCharacteristic(Characteristic.OperatingState);
|
|
2155
|
-
this.addOptionalCharacteristic(Characteristic.GridMode);
|
|
2156
|
-
this.addOptionalCharacteristic(Characteristic.EnchgGridMode);
|
|
2157
|
-
this.addOptionalCharacteristic(Characteristic.Status);
|
|
2158
|
-
this.addOptionalCharacteristic(Characteristic.ReadingTime);
|
|
2159
|
-
this.addOptionalCharacteristic(Characteristic.CommInterface);
|
|
2160
|
-
this.addOptionalCharacteristic(Characteristic.PlcLevel);
|
|
2161
|
-
this.addOptionalCharacteristic(Characteristic.GridProfile);
|
|
2162
|
-
this.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
2163
|
-
}
|
|
2164
|
-
}
|
|
2165
|
-
Service.EnpowerService = EnpowerService;
|
|
2166
|
-
|
|
2167
2222
|
//Collar service
|
|
2168
2223
|
class CollarService extends Service {
|
|
2169
2224
|
constructor(displayName, subtype) {
|
|
2170
|
-
super(displayName, '
|
|
2225
|
+
super(displayName, '00000015-000A-1000-8000-0026BB765291', subtype);
|
|
2171
2226
|
// Mandatory Characteristics
|
|
2172
2227
|
this.addCharacteristic(Characteristic.AdminState);
|
|
2173
2228
|
// Optional Characteristics
|
|
@@ -2186,7 +2241,7 @@ export default (api) => {
|
|
|
2186
2241
|
//C6 combiner controler service
|
|
2187
2242
|
class C6CombinerControlerService extends Service {
|
|
2188
2243
|
constructor(displayName, subtype) {
|
|
2189
|
-
super(displayName, '
|
|
2244
|
+
super(displayName, '00000016-000A-1000-8000-0026BB765291', subtype);
|
|
2190
2245
|
// Mandatory Characteristics
|
|
2191
2246
|
this.addCharacteristic(Characteristic.AdminState);
|
|
2192
2247
|
// Optional Characteristics
|
|
@@ -2202,7 +2257,7 @@ export default (api) => {
|
|
|
2202
2257
|
//C6 rgm servicee
|
|
2203
2258
|
class C6RgmService extends Service {
|
|
2204
2259
|
constructor(displayName, subtype) {
|
|
2205
|
-
super(displayName, '
|
|
2260
|
+
super(displayName, '00000017-000A-1000-8000-0026BB765291', subtype);
|
|
2206
2261
|
// Mandatory Characteristics
|
|
2207
2262
|
this.addCharacteristic(Characteristic.Status);
|
|
2208
2263
|
// Optional Characteristics
|
|
@@ -2214,46 +2269,19 @@ export default (api) => {
|
|
|
2214
2269
|
}
|
|
2215
2270
|
Service.C6RgmService = C6RgmService;
|
|
2216
2271
|
|
|
2217
|
-
//
|
|
2218
|
-
class
|
|
2219
|
-
constructor(displayName, subtype) {
|
|
2220
|
-
super(displayName, '00000013-000A-1000-8000-0026BB765291', subtype);
|
|
2221
|
-
// Mandatory Characteristics
|
|
2222
|
-
this.addCharacteristic(Characteristic.AdminMode);
|
|
2223
|
-
// Optional Characteristics
|
|
2224
|
-
this.addOptionalCharacteristic(Characteristic.Type);
|
|
2225
|
-
this.addOptionalCharacteristic(Characteristic.AdminState);
|
|
2226
|
-
this.addOptionalCharacteristic(Characteristic.OperatingState);
|
|
2227
|
-
this.addOptionalCharacteristic(Characteristic.StartSoc);
|
|
2228
|
-
this.addOptionalCharacteristic(Characteristic.StopSoc);
|
|
2229
|
-
this.addOptionalCharacteristic(Characteristic.ExexOn);
|
|
2230
|
-
this.addOptionalCharacteristic(Characteristic.Shedule);
|
|
2231
|
-
this.addOptionalCharacteristic(Characteristic.Present);
|
|
2232
|
-
this.addOptionalCharacteristic(Characteristic.ReadingTime);
|
|
2233
|
-
this.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
2234
|
-
}
|
|
2235
|
-
}
|
|
2236
|
-
Service.GerneratorService = GerneratorService;
|
|
2237
|
-
|
|
2238
|
-
//Live data service
|
|
2239
|
-
class LiveDataService extends Service {
|
|
2272
|
+
//Network interafe service
|
|
2273
|
+
class NetworkInterfaceService extends Service {
|
|
2240
2274
|
constructor(displayName, subtype) {
|
|
2241
|
-
super(displayName, '
|
|
2275
|
+
super(displayName, '00000018-000A-1000-8000-0026BB765291', subtype);
|
|
2242
2276
|
// Mandatory Characteristics
|
|
2243
|
-
this.addCharacteristic(Characteristic.
|
|
2277
|
+
this.addCharacteristic(Characteristic.Type);
|
|
2244
2278
|
// Optional Characteristics
|
|
2245
|
-
this.addOptionalCharacteristic(Characteristic.
|
|
2246
|
-
this.addOptionalCharacteristic(Characteristic.
|
|
2247
|
-
this.addOptionalCharacteristic(Characteristic.PowerL3);
|
|
2248
|
-
this.addOptionalCharacteristic(Characteristic.ApparentPower);
|
|
2249
|
-
this.addOptionalCharacteristic(Characteristic.ApparentPowerL1);
|
|
2250
|
-
this.addOptionalCharacteristic(Characteristic.ApparentPowerL2);
|
|
2251
|
-
this.addOptionalCharacteristic(Characteristic.ApparentPowerL3);
|
|
2252
|
-
this.addOptionalCharacteristic(Characteristic.ReadingTime);
|
|
2279
|
+
this.addOptionalCharacteristic(Characteristic.SignalStrength);
|
|
2280
|
+
this.addOptionalCharacteristic(Characteristic.AddressIp);
|
|
2253
2281
|
this.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
2254
2282
|
}
|
|
2255
2283
|
}
|
|
2256
|
-
Service.
|
|
2284
|
+
Service.NetworkInterfaceService = NetworkInterfaceService;
|
|
2257
2285
|
|
|
2258
2286
|
// EVE electric meter
|
|
2259
2287
|
class EvePower extends Characteristic {
|
package/src/energymeter.js
CHANGED
|
@@ -21,8 +21,6 @@ class EnergyMeter extends EventEmitter {
|
|
|
21
21
|
this.log = log;
|
|
22
22
|
this.url = url;
|
|
23
23
|
this.name = deviceName;
|
|
24
|
-
this.host = device.host;
|
|
25
|
-
|
|
26
24
|
this.envoyFirmware7xxTokenGenerationMode = device.envoyFirmware7xxTokenGenerationMode;
|
|
27
25
|
this.enlightenUser = device.enlightenUser;
|
|
28
26
|
this.enlightenPasswd = device.enlightenPasswd;
|
package/src/envoydata.js
CHANGED
|
@@ -13,7 +13,6 @@ class EnvoyData extends EventEmitter {
|
|
|
13
13
|
|
|
14
14
|
//device configuration
|
|
15
15
|
this.url = url;
|
|
16
|
-
this.host = device.host;
|
|
17
16
|
this.envoyFirmware7xxTokenGenerationMode = device.envoyFirmware7xxTokenGenerationMode;
|
|
18
17
|
this.envoyPasswd = device.envoyPasswd;
|
|
19
18
|
this.enlightenUser = device.enlightenUser;
|
|
@@ -27,8 +26,6 @@ class EnvoyData extends EventEmitter {
|
|
|
27
26
|
this.ensembleDataRefreshTime = (device.ensembleDataRefreshTime || 15) * 1000;
|
|
28
27
|
|
|
29
28
|
//log
|
|
30
|
-
this.logDeviceInfo = device.log?.deviceInfo || true;
|
|
31
|
-
this.logInfo = device.log?.info || false;
|
|
32
29
|
this.logWarn = device.log?.warn || true;
|
|
33
30
|
this.logError = device.log?.error || true;
|
|
34
31
|
this.logDebug = device.log?.debug || false;
|
|
@@ -936,7 +933,7 @@ class EnvoyData extends EventEmitter {
|
|
|
936
933
|
this.feature.home.networkInterfaces.count = networkInterfaces.length;
|
|
937
934
|
|
|
938
935
|
this.feature.home.wirelessConnections.supported = wirelessConnections.length > 0;
|
|
939
|
-
this.feature.home.wirelessConnections.installed = wirelessConnections.some(w => w.connected
|
|
936
|
+
this.feature.home.wirelessConnections.installed = wirelessConnections.some(w => w.connected);
|
|
940
937
|
this.feature.home.wirelessConnections.count = wirelessConnections.length;
|
|
941
938
|
this.feature.home.supported = true;
|
|
942
939
|
|
|
@@ -2043,11 +2040,11 @@ class EnvoyData extends EventEmitter {
|
|
|
2043
2040
|
|
|
2044
2041
|
try {
|
|
2045
2042
|
const response = await this.axiosInstance.get(ApiUrls.EnsemblePower);
|
|
2046
|
-
const
|
|
2047
|
-
if (this.logDebug) this.emit('debug', `Ensemble power response:`,
|
|
2043
|
+
const responseData = response.data;
|
|
2044
|
+
if (this.logDebug) this.emit('debug', `Ensemble power response:`, responseData);
|
|
2048
2045
|
|
|
2049
|
-
const
|
|
2050
|
-
if (!
|
|
2046
|
+
const devices = responseData.devices ?? [];
|
|
2047
|
+
if (!devices.length === 0) return false;
|
|
2051
2048
|
|
|
2052
2049
|
// update encharges
|
|
2053
2050
|
const enchargesRealPowerSummary = [];
|
package/src/envoydevice.js
CHANGED
|
@@ -20,7 +20,6 @@ class EnvoyDevice extends EventEmitter {
|
|
|
20
20
|
this.url = url;
|
|
21
21
|
this.device = device;
|
|
22
22
|
this.name = deviceName;
|
|
23
|
-
this.host = device.host;
|
|
24
23
|
this.displayType = device.displayType;
|
|
25
24
|
|
|
26
25
|
this.lockControl = device.lockControl || false;
|
|
@@ -104,9 +103,9 @@ class EnvoyDevice extends EventEmitter {
|
|
|
104
103
|
|
|
105
104
|
//system accessoty
|
|
106
105
|
this.systemAccessory = {
|
|
107
|
-
serviceType: [
|
|
108
|
-
characteristicType: [
|
|
109
|
-
characteristicType1: [
|
|
106
|
+
serviceType: [null, Service.Lightbulb, Service.Fan, Service.HumiditySensor, Service.CarbonMonoxideSensor][device.displayType],
|
|
107
|
+
characteristicType: [null, Characteristic.On, Characteristic.On, Characteristic.StatusActive, Characteristic.CarbonMonoxideDetected][device.displayType],
|
|
108
|
+
characteristicType1: [null, Characteristic.Brightness, Characteristic.RotationSpeed, Characteristic.CurrentRelativeHumidity, Characteristic.CarbonMonoxideLevel][device.displayType],
|
|
110
109
|
state: false,
|
|
111
110
|
level: 0
|
|
112
111
|
}
|
|
@@ -114,98 +113,98 @@ class EnvoyDevice extends EventEmitter {
|
|
|
114
113
|
//production state sensor
|
|
115
114
|
if (this.productionStateSensor.displayType > 0) {
|
|
116
115
|
const sensor = this.productionStateSensor;
|
|
117
|
-
sensor.serviceType = [
|
|
118
|
-
sensor.characteristicType = [
|
|
116
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
117
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
119
118
|
sensor.state = false;
|
|
120
119
|
}
|
|
121
120
|
|
|
122
121
|
//plc level check control
|
|
123
122
|
if (this.plcLevelCheckControl.displayType > 0) {
|
|
124
123
|
const tile = this.plcLevelCheckControl;
|
|
125
|
-
tile.serviceType = [
|
|
126
|
-
tile.characteristicType = [
|
|
124
|
+
tile.serviceType = [null, Service.Switch, Service.Outlet, Service.Lightbulb][tile.displayType];
|
|
125
|
+
tile.characteristicType = [null, Characteristic.On, Characteristic.On, Characteristic.On][tile.displayType];
|
|
127
126
|
tile.state = false;
|
|
128
127
|
}
|
|
129
128
|
|
|
130
129
|
//data sampling control
|
|
131
130
|
if (this.dataSamplingControl.displayType > 0) {
|
|
132
131
|
const tile = this.dataSamplingControl;
|
|
133
|
-
tile.serviceType = [
|
|
134
|
-
tile.characteristicType = [
|
|
132
|
+
tile.serviceType = [null, Service.Switch, Service.Outlet, Service.Lightbulb][tile.displayType];
|
|
133
|
+
tile.characteristicType = [null, Characteristic.On, Characteristic.On, Characteristic.On][tile.displayType];
|
|
135
134
|
tile.state = false;
|
|
136
135
|
}
|
|
137
136
|
|
|
138
137
|
//data sampling sensor
|
|
139
138
|
if (this.dataSamplingSensor.displayType > 0) {
|
|
140
139
|
const sensor = this.dataSamplingSensor;
|
|
141
|
-
sensor.serviceType = [
|
|
142
|
-
sensor.characteristicType = [
|
|
140
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
141
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
143
142
|
sensor.state = false;
|
|
144
143
|
}
|
|
145
144
|
|
|
146
145
|
//power production sensors
|
|
147
146
|
for (const sensor of this.powerProductionLevelSensors) {
|
|
148
|
-
sensor.serviceType = [
|
|
149
|
-
sensor.characteristicType = [
|
|
147
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
148
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
150
149
|
sensor.state = false;
|
|
151
150
|
}
|
|
152
151
|
|
|
153
152
|
for (const sensor of this.energyProductionLevelSensors) {
|
|
154
|
-
sensor.serviceType = [
|
|
155
|
-
sensor.characteristicType = [
|
|
153
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
154
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
156
155
|
sensor.state = false;
|
|
157
156
|
}
|
|
158
157
|
|
|
159
158
|
//power consumption total sensor
|
|
160
159
|
for (const sensor of this.powerConsumptionTotalLevelSensors) {
|
|
161
|
-
sensor.serviceType = [
|
|
162
|
-
sensor.characteristicType = [
|
|
160
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
161
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
163
162
|
sensor.state = false;
|
|
164
163
|
}
|
|
165
164
|
|
|
166
165
|
for (const sensor of this.energyConsumptionTotalLevelSensors) {
|
|
167
|
-
sensor.serviceType = [
|
|
168
|
-
sensor.characteristicType = [
|
|
166
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
167
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
169
168
|
sensor.state = false;
|
|
170
169
|
}
|
|
171
170
|
|
|
172
171
|
//power consumption net sensor
|
|
173
172
|
for (const sensor of this.powerConsumptionNetLevelSensors) {
|
|
174
|
-
sensor.serviceType = [
|
|
175
|
-
sensor.characteristicType = [
|
|
173
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
174
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
176
175
|
sensor.state = false;
|
|
177
176
|
}
|
|
178
177
|
|
|
179
178
|
for (const sensor of this.energyConsumptionNetLevelSensors) {
|
|
180
|
-
sensor.serviceType = [
|
|
181
|
-
sensor.characteristicType = [
|
|
179
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
180
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
182
181
|
sensor.state = false;
|
|
183
182
|
}
|
|
184
183
|
|
|
185
184
|
//grid quality sensors
|
|
186
185
|
for (const sensor of this.gridProductionQualitySensors) {
|
|
187
|
-
sensor.serviceType = [
|
|
188
|
-
sensor.characteristicType = [
|
|
186
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
187
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
189
188
|
sensor.state = false;
|
|
190
189
|
}
|
|
191
190
|
|
|
192
191
|
for (const sensor of this.gridConsumptionTotalQualitySensors) {
|
|
193
|
-
sensor.serviceType = [
|
|
194
|
-
sensor.characteristicType = [
|
|
192
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
193
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
195
194
|
sensor.state = false;
|
|
196
195
|
}
|
|
197
196
|
|
|
198
197
|
for (const sensor of this.gridConsumptionNetQualitySensors) {
|
|
199
|
-
sensor.serviceType = [
|
|
200
|
-
sensor.characteristicType = [
|
|
198
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
199
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
201
200
|
sensor.state = false;
|
|
202
201
|
}
|
|
203
202
|
|
|
204
203
|
//qRelay
|
|
205
204
|
if (this.qRelayStateSensor.displayType > 0) {
|
|
206
205
|
const sensor = this.qRelayStateSensor;
|
|
207
|
-
sensor.serviceType = [
|
|
208
|
-
sensor.characteristicType = [
|
|
206
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
207
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
209
208
|
sensor.state0 = false;
|
|
210
209
|
sensor.state1 = false;
|
|
211
210
|
sensor.state2 = false;
|
|
@@ -215,19 +214,19 @@ class EnvoyDevice extends EventEmitter {
|
|
|
215
214
|
//ac battery
|
|
216
215
|
if (this.acBatterieBackupLevelSummaryAccessory.displayType > 0) {
|
|
217
216
|
const tile = this.acBatterieBackupLevelSummaryAccessory;
|
|
218
|
-
tile.serviceType = [
|
|
219
|
-
tile.characteristicType = [
|
|
220
|
-
tile.characteristicType1 = [
|
|
217
|
+
tile.serviceType = [null, Service.Lightbulb, Service.Fan, Service.HumiditySensor, Service.CarbonMonoxideSensor, Service.Battery][tile.displayType];
|
|
218
|
+
tile.characteristicType = [null, Characteristic.On, Characteristic.On, Characteristic.StatusActive, Characteristic.CarbonMonoxideDetected, Characteristic.StatusLowBattery][tile.displayType];
|
|
219
|
+
tile.characteristicType1 = [null, Characteristic.Brightness, Characteristic.RotationSpeed, Characteristic.CurrentRelativeHumidity, Characteristic.CarbonMonoxideLevel, Characteristic.BatteryLevel][tile.displayType];
|
|
221
220
|
tile.state = false;
|
|
222
221
|
tile.backupLevel = 0;
|
|
223
222
|
}
|
|
224
223
|
|
|
225
224
|
if (this.acBatterieBackupLevelAccessory.displayType > 0) {
|
|
226
225
|
const tile = this.acBatterieBackupLevelAccessory;
|
|
227
|
-
tile.serviceType = [
|
|
228
|
-
tile.characteristicType = [
|
|
229
|
-
tile.characteristicType1 = [
|
|
230
|
-
tile.characteristicType2 = [
|
|
226
|
+
tile.serviceType = [null, Service.Battery][tile.displayType];
|
|
227
|
+
tile.characteristicType = [null, Characteristic.StatusLowBattery][tile.displayType];
|
|
228
|
+
tile.characteristicType1 = [null, Characteristic.BatteryLevel][tile.displayType];
|
|
229
|
+
tile.characteristicType2 = [null, Characteristic.ChargingState][tile.displayType];
|
|
231
230
|
tile.state = false;
|
|
232
231
|
tile.backupLevel = 0;
|
|
233
232
|
tile.chargeState = 0;
|
|
@@ -236,46 +235,46 @@ class EnvoyDevice extends EventEmitter {
|
|
|
236
235
|
//enpower
|
|
237
236
|
if (this.enpowerGridStateControl.displayType > 0) {
|
|
238
237
|
const tile = this.enpowerGridStateControl;
|
|
239
|
-
tile.serviceType = [
|
|
240
|
-
tile.characteristicType = [
|
|
238
|
+
tile.serviceType = [null, Service.Switch, Service.Outlet, Service.Lightbulb][tile.displaqyType];
|
|
239
|
+
tile.characteristicType = [null, Characteristic.On, Characteristic.On, Characteristic.On][tile.displaqyType];
|
|
241
240
|
tile.state = false;
|
|
242
241
|
}
|
|
243
242
|
|
|
244
243
|
if (this.enpowerGridStateSensor.displayType > 0) {
|
|
245
244
|
const sensor = this.enpowerGridStateSensor;
|
|
246
|
-
sensor.serviceType = [
|
|
247
|
-
sensor.characteristicType = [
|
|
245
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
246
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
248
247
|
sensor.state = false;
|
|
249
248
|
}
|
|
250
249
|
|
|
251
250
|
for (const sensor of this.enpowerGridModeSensors) {
|
|
252
|
-
sensor.serviceType = [
|
|
253
|
-
sensor.characteristicType = [
|
|
251
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
252
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
254
253
|
sensor.state = false;
|
|
255
254
|
}
|
|
256
255
|
|
|
257
256
|
//encharge
|
|
258
257
|
if (this.enchargeBackupLevelSummaryAccessory.displayType > 0) {
|
|
259
258
|
const tile = this.enchargeBackupLevelSummaryAccessory;
|
|
260
|
-
tile.serviceType = [
|
|
261
|
-
tile.characteristicType = [
|
|
262
|
-
tile.characteristicType1 = [
|
|
259
|
+
tile.serviceType = [null, Service.Lightbulb, Service.Fan, Service.HumiditySensor, Service.CarbonMonoxideSensor, Service.Battery][tile.displayType];
|
|
260
|
+
tile.characteristicType = [null, Characteristic.On, Characteristic.On, Characteristic.StatusActive, Characteristic.CarbonMonoxideDetected, Characteristic.StatusLowBattery][tile.displayType];
|
|
261
|
+
tile.characteristicType1 = [null, Characteristic.Brightness, Characteristic.RotationSpeed, Characteristic.CurrentRelativeHumidity, Characteristic.CarbonMonoxideLevel, Characteristic.BatteryLevel][tile.displayType];
|
|
263
262
|
tile.state = false;
|
|
264
263
|
tile.backupLevel = 0;
|
|
265
264
|
}
|
|
266
265
|
|
|
267
266
|
for (const sensor of this.enchargeBackupLevelSummarySensors) {
|
|
268
|
-
sensor.serviceType = [
|
|
269
|
-
sensor.characteristicType = [
|
|
267
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
268
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
270
269
|
sensor.state = false;
|
|
271
270
|
}
|
|
272
271
|
|
|
273
272
|
if (this.enchargeBackupLevelAccessory.displayType > 0) {
|
|
274
273
|
const tile = this.enchargeBackupLevelAccessory;
|
|
275
|
-
tile.serviceType = [
|
|
276
|
-
tile.characteristicType1 = [
|
|
277
|
-
tile.characteristicType = [
|
|
278
|
-
tile.characteristicType2 = [
|
|
274
|
+
tile.serviceType = [null, Service.Battery][tile.displayType];
|
|
275
|
+
tile.characteristicType1 = [null, Characteristic.StatusLowBattery][tile.displayType];
|
|
276
|
+
tile.characteristicType = [null, Characteristic.BatteryLevel][tile.displayType];
|
|
277
|
+
tile.characteristicType2 = [null, Characteristic.ChargingState][tile.displayType];
|
|
279
278
|
tile.state = false;
|
|
280
279
|
tile.backupLevel = 0;
|
|
281
280
|
tile.chargeState = 0;
|
|
@@ -283,77 +282,77 @@ class EnvoyDevice extends EventEmitter {
|
|
|
283
282
|
|
|
284
283
|
if (this.enchargeStateSensor.displayType > 0) {
|
|
285
284
|
const sensor = this.enchargeStateSensor;
|
|
286
|
-
sensor.serviceType = [
|
|
287
|
-
sensor.characteristicType = [
|
|
285
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
286
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
288
287
|
sensor.state = false;
|
|
289
288
|
}
|
|
290
289
|
|
|
291
290
|
for (const tile of this.enchargeProfileControls) {
|
|
292
|
-
tile.serviceType = [
|
|
293
|
-
tile.characteristicType = [
|
|
291
|
+
tile.serviceType = [null, Service.Lightbulb][tile.displayType];
|
|
292
|
+
tile.characteristicType = [null, Characteristic.On][tile.displayType];
|
|
294
293
|
tile.state = false;
|
|
295
294
|
tile.reservedSoc = 0;
|
|
296
295
|
tile.previousState = null;
|
|
297
296
|
}
|
|
298
297
|
|
|
299
298
|
for (const sensor of this.enchargeProfileSensors) {
|
|
300
|
-
sensor.serviceType = [
|
|
301
|
-
sensor.characteristicType = [
|
|
299
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
300
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
302
301
|
sensor.state = false;
|
|
303
302
|
}
|
|
304
303
|
|
|
305
304
|
if (this.enchargeGridStateSensor.displayType > 0) {
|
|
306
305
|
const sensor = this.enchargeGridStateSensor;
|
|
307
|
-
sensor.serviceType = [
|
|
308
|
-
sensor.characteristicType = [
|
|
306
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
307
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
309
308
|
sensor.state = false;
|
|
310
309
|
}
|
|
311
310
|
|
|
312
311
|
for (const sensor of this.enchargeGridModeSensors) {
|
|
313
|
-
sensor.serviceType = [
|
|
314
|
-
sensor.characteristicType = [
|
|
312
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
313
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
315
314
|
sensor.state = false;
|
|
316
315
|
}
|
|
317
316
|
|
|
318
317
|
//solar
|
|
319
318
|
if (this.solarGridStateSensor.displayType > 0) {
|
|
320
319
|
const sensor = this.solarGridStateSensor;
|
|
321
|
-
sensor.serviceType = [
|
|
322
|
-
sensor.characteristicType = [
|
|
320
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
321
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
323
322
|
sensor.state = false;
|
|
324
323
|
}
|
|
325
324
|
|
|
326
325
|
for (const sensor of this.solarGridModeSensors) {
|
|
327
|
-
sensor.serviceType = [
|
|
328
|
-
sensor.characteristicType = [
|
|
326
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
327
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
329
328
|
sensor.state = false;
|
|
330
329
|
}
|
|
331
330
|
|
|
332
331
|
//generator
|
|
333
332
|
if (this.generatorStateControl.displayType > 0) {
|
|
334
333
|
const tile = this.generatorStateControl;
|
|
335
|
-
tile.serviceType = [
|
|
336
|
-
tile.characteristicType = [
|
|
334
|
+
tile.serviceType = [null, Service.Switch, Service.Outlet, Service.Lightbulb][tile.displaqyType];
|
|
335
|
+
tile.characteristicType = [null, Characteristic.On, Characteristic.On, Characteristic.On][tile.displaqyType];
|
|
337
336
|
tile.state = false;
|
|
338
337
|
}
|
|
339
338
|
|
|
340
339
|
if (this.generatorStateSensor.displayType > 0) {
|
|
341
340
|
const sensor = this.generatorStateSensor;
|
|
342
|
-
sensor.serviceType = [
|
|
343
|
-
sensor.characteristicType = [
|
|
341
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
342
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
344
343
|
sensor.state = false;
|
|
345
344
|
}
|
|
346
345
|
|
|
347
346
|
for (const tile of this.generatorModeContols) {
|
|
348
|
-
tile.serviceType = [
|
|
349
|
-
tile.characteristicType = [
|
|
347
|
+
tile.serviceType = [null, Service.Switch, Service.Outlet, Service.Lightbulb][tile.displayType];
|
|
348
|
+
tile.characteristicType = [null, Characteristic.On, Characteristic.On, Characteristic.On][tile.displayType];
|
|
350
349
|
tile.state = false;
|
|
351
350
|
tile.previousState = null;
|
|
352
351
|
}
|
|
353
352
|
|
|
354
353
|
for (const sensor of this.generatorModeSensors) {
|
|
355
|
-
sensor.serviceType = [
|
|
356
|
-
sensor.characteristicType = [
|
|
354
|
+
sensor.serviceType = [null, Service.MotionSensor, Service.OccupancySensor, Service.ContactSensor][sensor.displayType];
|
|
355
|
+
sensor.characteristicType = [null, Characteristic.MotionDetected, Characteristic.OccupancyDetected, Characteristic.ContactSensorState][sensor.displayType];
|
|
357
356
|
sensor.state = false;
|
|
358
357
|
}
|
|
359
358
|
|
|
@@ -742,6 +741,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
742
741
|
const plcLevelNrsbsSupported = this.feature.plcLevel.nsrbs.supported;
|
|
743
742
|
const plcLevelAcbsSupported = this.feature.plcLevel.acbs.supported;
|
|
744
743
|
const envoySupported = this.feature.home.supported;
|
|
744
|
+
const networkInterfacesInstalled = this.feature.home.networkInterfaces.installed;
|
|
745
745
|
const wirelessConnectionsInstalled = this.feature.home.wirelessConnections.installed;
|
|
746
746
|
const metersInstalled = this.feature.meters.installed;
|
|
747
747
|
const pcuInstalled = this.feature.inventory.pcus.installed;
|
|
@@ -1210,9 +1210,43 @@ class EnvoyDevice extends EventEmitter {
|
|
|
1210
1210
|
});
|
|
1211
1211
|
}
|
|
1212
1212
|
|
|
1213
|
+
this.envoyService = service;
|
|
1214
|
+
|
|
1215
|
+
// Network Interfaces
|
|
1216
|
+
if (networkInterfacesInstalled) {
|
|
1217
|
+
this.networkInterfacesServices = [];
|
|
1218
|
+
|
|
1219
|
+
for (const networkInterface of home.network.interfaces) {
|
|
1220
|
+
const interfaceType = networkInterface.type;
|
|
1221
|
+
if (this.logDebug) this.emit('debug', `Prepare Network Interface ${interfaceType} Service`);
|
|
1222
|
+
|
|
1223
|
+
const networkInterfaceService = accessory.addService(Service.NetworkInterfaceService, `Network Interface ${interfaceType}`, `networkInterfaceService${interfaceType}`);
|
|
1224
|
+
networkInterfaceService.setCharacteristic(Characteristic.ConfiguredName, `Network Interface ${interfaceType}`);
|
|
1225
|
+
|
|
1226
|
+
const Characteristics1 = [
|
|
1227
|
+
{ type: Characteristic.Type, label: 'type', value: networkInterface.type },
|
|
1228
|
+
{ type: Characteristic.AddressIp, label: 'address IP ', value: networkInterface.ip },
|
|
1229
|
+
{ type: Characteristic.SignalStrength, label: 'signal strength', value: networkInterface.signalStrength, unit: '%' }
|
|
1230
|
+
];
|
|
1231
|
+
|
|
1232
|
+
for (const { type, value, label, unit = '', postfix = '' } of Characteristics1) {
|
|
1233
|
+
if (!this.functions.isValidValue(value)) continue;
|
|
1234
|
+
|
|
1235
|
+
networkInterfaceService.getCharacteristic(type)
|
|
1236
|
+
.onGet(async () => {
|
|
1237
|
+
const currentValue = value;
|
|
1238
|
+
if (this.logInfo) this.emit('info', `Network Interface ${interfaceType}, ${label}: ${unit !== '' ? `${currentValue} ${unit}` : postfix !== '' ? `${postfix}` : `${currentValue}`}`);
|
|
1239
|
+
return currentValue;
|
|
1240
|
+
});
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
this.networkInterfacesServices.push(networkInterfaceService);
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1213
1247
|
// Wireless connection kits
|
|
1214
1248
|
if (wirelessConnectionsInstalled) {
|
|
1215
|
-
this.
|
|
1249
|
+
this.wirelessConnectionsKitServices = [];
|
|
1216
1250
|
|
|
1217
1251
|
for (const wirelessConnection of home.wirelessKits) {
|
|
1218
1252
|
const connectionType = wirelessConnection.type;
|
|
@@ -1224,8 +1258,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
1224
1258
|
const wirelessCharacteristics = [
|
|
1225
1259
|
{ type: Characteristic.Type, label: 'type', value: wirelessConnection.type },
|
|
1226
1260
|
{ type: Characteristic.Connected, label: 'state', value: wirelessConnection.connected, postfix: `${wirelessConnection.connected ? 'Connected' : 'Disconnected'}` },
|
|
1227
|
-
{ type: Characteristic.SignalStrength, label: 'signal strength', value: wirelessConnection.signalStrength, unit: '%' }
|
|
1228
|
-
{ type: Characteristic.SignalStrengthMax, label: 'signal strength max', value: wirelessConnection.signalStrengthMax, unit: '%' },
|
|
1261
|
+
{ type: Characteristic.SignalStrength, label: 'signal strength', value: wirelessConnection.signalStrength, unit: '%' }
|
|
1229
1262
|
];
|
|
1230
1263
|
|
|
1231
1264
|
for (const { type, value, label, unit = '', postfix = '' } of wirelessCharacteristics) {
|
|
@@ -1239,11 +1272,9 @@ class EnvoyDevice extends EventEmitter {
|
|
|
1239
1272
|
});
|
|
1240
1273
|
}
|
|
1241
1274
|
|
|
1242
|
-
this.
|
|
1275
|
+
this.wirelessConnectionsKitServices.push(wirelessService);
|
|
1243
1276
|
}
|
|
1244
1277
|
}
|
|
1245
|
-
|
|
1246
|
-
this.envoyService = service;
|
|
1247
1278
|
}
|
|
1248
1279
|
|
|
1249
1280
|
//meters
|
|
@@ -2052,10 +2083,10 @@ class EnvoyDevice extends EventEmitter {
|
|
|
2052
2083
|
if (this.logDebug) this.emit('debug', `Prepare ${enchargeName} Backup Level Summary Service`);
|
|
2053
2084
|
|
|
2054
2085
|
const control = this.enchargeBackupLevelSummaryAccessory;
|
|
2055
|
-
const { namePrefix,
|
|
2086
|
+
const { namePrefix, serviceType, characteristicType, characteristicType1 } = control;
|
|
2056
2087
|
const serviceName = namePrefix ? `${accessoryName} ${enchargeName}` : enchargeName;
|
|
2057
2088
|
|
|
2058
|
-
const controlService = accessory.addService(serviceType, serviceName, `
|
|
2089
|
+
const controlService = accessory.addService(serviceType, serviceName, `enchargeBackupLevelSummaryAccessoryService`);
|
|
2059
2090
|
controlService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
2060
2091
|
controlService.setCharacteristic(Characteristic.ConfiguredName, serviceName);
|
|
2061
2092
|
controlService.getCharacteristic(characteristicType)
|
|
@@ -2097,14 +2128,14 @@ class EnvoyDevice extends EventEmitter {
|
|
|
2097
2128
|
}
|
|
2098
2129
|
});
|
|
2099
2130
|
|
|
2100
|
-
this.
|
|
2131
|
+
this.enchargeBackupLevelSummaryAccessoryService = controlService;
|
|
2101
2132
|
}
|
|
2102
2133
|
|
|
2103
2134
|
//backup level summary sensors
|
|
2104
2135
|
if (this.enchargeBackupLevelSummarySensors.length > 0) {
|
|
2105
2136
|
if (this.logDebug) this.emit('debug', `Prepare ${enchargeName} Backup Level Sensor Services`);
|
|
2106
2137
|
|
|
2107
|
-
this.
|
|
2138
|
+
this.enchargeBackupLevelSummarySensorServices = [];
|
|
2108
2139
|
for (let i = 0; i < this.enchargeBackupLevelSummarySensors.length; i++) {
|
|
2109
2140
|
const sensor = this.enchargeBackupLevelSummarySensors[i];
|
|
2110
2141
|
const { namePrefix, name, serviceType, characteristicType } = sensor;
|
|
@@ -2120,13 +2151,13 @@ class EnvoyDevice extends EventEmitter {
|
|
|
2120
2151
|
return currentState;
|
|
2121
2152
|
});
|
|
2122
2153
|
|
|
2123
|
-
this.
|
|
2154
|
+
this.enchargeBackupLevelSummarySensorServices.push(sensorService);
|
|
2124
2155
|
}
|
|
2125
2156
|
}
|
|
2126
2157
|
|
|
2127
2158
|
//devices
|
|
2128
2159
|
this.enchargeServices = [];
|
|
2129
|
-
this.
|
|
2160
|
+
this.enchargeBackupLevelAndStatServices = [];
|
|
2130
2161
|
|
|
2131
2162
|
for (const encharge of this.pv.inventoryData.esubs.encharges.devices) {
|
|
2132
2163
|
const serialNumber = encharge.serialNumber;
|
|
@@ -2177,7 +2208,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
2177
2208
|
return currentChargeState;
|
|
2178
2209
|
});
|
|
2179
2210
|
|
|
2180
|
-
this.
|
|
2211
|
+
this.enchargeBackupLevelAndStatServices.push(controlService);
|
|
2181
2212
|
}
|
|
2182
2213
|
|
|
2183
2214
|
if (this.logDebug) this.emit('debug', `Prepare ${enchargeName} ${serialNumber} Service`);
|
|
@@ -3062,9 +3093,8 @@ class EnvoyDevice extends EventEmitter {
|
|
|
3062
3093
|
try {
|
|
3063
3094
|
const comm = home.comm ?? {};
|
|
3064
3095
|
const network = home.network ?? {};
|
|
3065
|
-
const wirelessConnections = home.wireless_connection ?? [];
|
|
3066
|
-
const networkInterfaces = network.interfaces ?? [];
|
|
3067
|
-
|
|
3096
|
+
const wirelessConnections = (home.wireless_connection ?? []).filter(kit => kit.signal_strength_max > 0);
|
|
3097
|
+
const networkInterfaces = (network.interfaces ?? []).filter(iface => iface.carrier === true || iface.ip !== '169.254.120.1');
|
|
3068
3098
|
// Communication device support flags
|
|
3069
3099
|
const commEnsemble = comm.esub ?? {};
|
|
3070
3100
|
const commEncharges = Array.isArray(comm.encharge) ? comm.encharge : [];
|
|
@@ -3077,14 +3107,13 @@ class EnvoyDevice extends EventEmitter {
|
|
|
3077
3107
|
dhcp: iface.dhcp,
|
|
3078
3108
|
ip: iface.ip,
|
|
3079
3109
|
carrier: !!iface.carrier,
|
|
3080
|
-
signalStrength: this.functions.scaleValue(iface.signal_strength, 0,
|
|
3081
|
-
signalStrengthMax:
|
|
3110
|
+
signalStrength: this.functions.scaleValue(iface.signal_strength, 0, iface.signal_strength_max, 0, 100),
|
|
3111
|
+
signalStrengthMax: iface.signal_strength_max,
|
|
3082
3112
|
supported: iface.type === 'wifi' ? iface.supported : null,
|
|
3083
3113
|
present: iface.type === 'wifi' ? iface.present : null,
|
|
3084
3114
|
configured: iface.type === 'wifi' ? iface.configured : null,
|
|
3085
3115
|
status: iface.type === 'wifi' ? ApiCodes[iface.status] : null
|
|
3086
3116
|
}));
|
|
3087
|
-
|
|
3088
3117
|
// Process encharges (synchronous)
|
|
3089
3118
|
const encharges = commEncharges.map(encharge => ({
|
|
3090
3119
|
num: encharge.num,
|
|
@@ -3095,8 +3124,8 @@ class EnvoyDevice extends EventEmitter {
|
|
|
3095
3124
|
|
|
3096
3125
|
// Process wireless connection kits (synchronous)
|
|
3097
3126
|
const wirelessKits = wirelessConnections.map(kit => ({
|
|
3098
|
-
signalStrength: this.functions.scaleValue(kit.signal_strength, 0,
|
|
3099
|
-
signalStrengthMax:
|
|
3127
|
+
signalStrength: this.functions.scaleValue(kit.signal_strength, 0, kit.signal_strength_max, 0, 100),
|
|
3128
|
+
signalStrengthMax: kit.signal_strength_max,
|
|
3100
3129
|
type: ApiCodes[kit.type] ?? kit.type,
|
|
3101
3130
|
connected: !!kit.connected
|
|
3102
3131
|
}));
|
|
@@ -3170,21 +3199,38 @@ class EnvoyDevice extends EventEmitter {
|
|
|
3170
3199
|
this.envoyService?.updateCharacteristic(type, value);
|
|
3171
3200
|
}
|
|
3172
3201
|
|
|
3202
|
+
// Network interfaces
|
|
3203
|
+
if (this.feature.home.networkInterfaces.installed) {
|
|
3204
|
+
interfaces?.forEach((networkInterface, index) => {
|
|
3205
|
+
|
|
3206
|
+
// Create characteristics
|
|
3207
|
+
const characteristics1 = [
|
|
3208
|
+
{ type: Characteristic.Type, value: networkInterface.type },
|
|
3209
|
+
{ type: Characteristic.AddressIp, value: networkInterface.ip },
|
|
3210
|
+
{ type: Characteristic.SignalStrength, value: networkInterface.signalStrength },
|
|
3211
|
+
];
|
|
3212
|
+
|
|
3213
|
+
// Update envoy services
|
|
3214
|
+
for (const { type, value } of characteristics1) {
|
|
3215
|
+
if (!this.functions.isValidValue(value)) continue;
|
|
3216
|
+
this.networkInterfacesServices?.[index]?.updateCharacteristic(type, value);
|
|
3217
|
+
}
|
|
3218
|
+
});
|
|
3219
|
+
}
|
|
3220
|
+
|
|
3173
3221
|
// Wireless connection characteristics
|
|
3174
3222
|
if (this.feature.home.wirelessConnections.installed) {
|
|
3175
|
-
|
|
3176
|
-
if (!kit) return;
|
|
3223
|
+
wirelessKits?.forEach((kit, index) => {
|
|
3177
3224
|
|
|
3178
3225
|
// Create characteristics
|
|
3179
|
-
const
|
|
3226
|
+
const characteristics2 = [
|
|
3180
3227
|
{ type: Characteristic.SignalStrength, value: kit.signalStrength },
|
|
3181
|
-
{ type: Characteristic.SignalStrengthMax, value: kit.signalStrengthMax },
|
|
3182
3228
|
{ type: Characteristic.Type, value: kit.type },
|
|
3183
3229
|
{ type: Characteristic.Connected, value: kit.connected },
|
|
3184
3230
|
];
|
|
3185
3231
|
|
|
3186
3232
|
// Update envoy services
|
|
3187
|
-
for (const { type, value } of
|
|
3233
|
+
for (const { type, value } of characteristics2) {
|
|
3188
3234
|
if (!this.functions.isValidValue(value)) continue;
|
|
3189
3235
|
this.wirelessConnectionsKitServices?.[index]?.updateCharacteristic(type, value);
|
|
3190
3236
|
}
|
|
@@ -3226,6 +3272,15 @@ class EnvoyDevice extends EventEmitter {
|
|
|
3226
3272
|
powerFactorDivide: meter.powerFactorDivide,
|
|
3227
3273
|
};
|
|
3228
3274
|
|
|
3275
|
+
// Emit info logs if enabled
|
|
3276
|
+
if (this.logInfo) {
|
|
3277
|
+
this.emit('info', `Meter: ${measurementType}, state: ${meterData.state ? 'Enabled' : 'Disabled'}`);
|
|
3278
|
+
this.emit('info', `Meter: ${measurementType}, phase mode: ${meterData.phaseMode}`);
|
|
3279
|
+
this.emit('info', `Meter: ${measurementType}, phase count: ${meterData.phaseCount}`);
|
|
3280
|
+
this.emit('info', `Meter: ${measurementType}, metering status: ${meterData.meteringStatus}`);
|
|
3281
|
+
this.emit('info', `Meter: ${measurementType}, status: ${meterData.deviceStatus}`);
|
|
3282
|
+
}
|
|
3283
|
+
|
|
3229
3284
|
// Create characteristics
|
|
3230
3285
|
const characteristics = [
|
|
3231
3286
|
{ type: Characteristic.State, value: meterData.state },
|
|
@@ -3257,6 +3312,16 @@ class EnvoyDevice extends EventEmitter {
|
|
|
3257
3312
|
channels: meter.channels,
|
|
3258
3313
|
});
|
|
3259
3314
|
|
|
3315
|
+
// Emit info logs if enabled
|
|
3316
|
+
if (this.logInfo) {
|
|
3317
|
+
this.emit('info', `Meter: ${measurementType}, power: ${meterData.powerKw} kW`);
|
|
3318
|
+
this.emit('info', `Meter: ${measurementType}, energy lifetime: ${meterData.energyLifetimeKw} kWh`);
|
|
3319
|
+
this.emit('info', `Meter: ${measurementType}, current: ${meterData.current} A`);
|
|
3320
|
+
this.emit('info', `Meter: ${measurementType}, voltage: ${meterData.voltage} V`);
|
|
3321
|
+
this.emit('info', `Meter: ${measurementType}, power factor: ${meterData.pwrFactor} cos φ`);
|
|
3322
|
+
this.emit('info', `Meter: ${measurementType}, frequency: ${meterData.frequency} Hz`);
|
|
3323
|
+
}
|
|
3324
|
+
|
|
3260
3325
|
// Add characteristics
|
|
3261
3326
|
characteristics.push(
|
|
3262
3327
|
{ type: Characteristic.Power, value: meterData.powerKw },
|
|
@@ -3272,24 +3337,6 @@ class EnvoyDevice extends EventEmitter {
|
|
|
3272
3337
|
if (measurementType !== 'Consumption Total') characteristics.push({ type: Characteristic.EnergyLifetimeUpload, value: meterData.energyLifetimeUploadKw });
|
|
3273
3338
|
}
|
|
3274
3339
|
|
|
3275
|
-
// Emit info logs if enabled
|
|
3276
|
-
if (this.logInfo) {
|
|
3277
|
-
this.emit('info', `Meter: ${measurementType}, state: ${meterData.state ? 'Enabled' : 'Disabled'}`);
|
|
3278
|
-
this.emit('info', `Meter: ${measurementType}, phase mode: ${meterData.phaseMode}`);
|
|
3279
|
-
this.emit('info', `Meter: ${measurementType}, phase count: ${meterData.phaseCount}`);
|
|
3280
|
-
this.emit('info', `Meter: ${measurementType}, metering status: ${meterData.meteringStatus}`);
|
|
3281
|
-
this.emit('info', `Meter: ${measurementType}, status: ${meterData.deviceStatus}`);
|
|
3282
|
-
|
|
3283
|
-
if (meter.state) {
|
|
3284
|
-
this.emit('info', `Meter: ${measurementType}, power: ${meterData.powerKw} kW`);
|
|
3285
|
-
this.emit('info', `Meter: ${measurementType}, energy lifetime: ${meterData.energyLifetimeKw} kWh`);
|
|
3286
|
-
this.emit('info', `Meter: ${measurementType}, current: ${meterData.current} A`);
|
|
3287
|
-
this.emit('info', `Meter: ${measurementType}, voltage: ${meterData.voltage} V`);
|
|
3288
|
-
this.emit('info', `Meter: ${measurementType}, power factor: ${meterData.pwrFactor} cos φ`);
|
|
3289
|
-
this.emit('info', `Meter: ${measurementType}, frequency: ${meterData.frequency} Hz`);
|
|
3290
|
-
}
|
|
3291
|
-
}
|
|
3292
|
-
|
|
3293
3340
|
// Update meters services
|
|
3294
3341
|
for (const { type, value } of characteristics) {
|
|
3295
3342
|
if (!this.functions.isValidValue(value)) continue;
|
|
@@ -4226,7 +4273,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
4226
4273
|
|
|
4227
4274
|
// Create characteristics
|
|
4228
4275
|
const characteristics = [
|
|
4229
|
-
{ type: characteristicType, value: state, valueKey: '
|
|
4276
|
+
{ type: characteristicType, value: state, valueKey: 'state' },
|
|
4230
4277
|
{ type: characteristicType1, value: backupLevel, valueKey: 'backupLevel' },
|
|
4231
4278
|
];
|
|
4232
4279
|
|
|
@@ -4234,7 +4281,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
4234
4281
|
for (const { type, value, valueKey } of characteristics) {
|
|
4235
4282
|
if (!this.functions.isValidValue(value)) continue;
|
|
4236
4283
|
accessory[valueKey] = value;
|
|
4237
|
-
this.
|
|
4284
|
+
this.enchargeBackupLevelSummaryAccessoryService?.updateCharacteristic(type, value);
|
|
4238
4285
|
}
|
|
4239
4286
|
}
|
|
4240
4287
|
|
|
@@ -4253,7 +4300,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
4253
4300
|
for (const { type, value, valueKey } of characteristics) {
|
|
4254
4301
|
if (!this.functions.isValidValue(value)) continue;
|
|
4255
4302
|
sensor[valueKey] = value;
|
|
4256
|
-
this.
|
|
4303
|
+
this.enchargeBackupLevelSummarySensorServices?.[i]?.updateCharacteristic(type, value);
|
|
4257
4304
|
};
|
|
4258
4305
|
}
|
|
4259
4306
|
}
|
|
@@ -4400,7 +4447,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
4400
4447
|
for (const { type, value, valueKey } of characteristics) {
|
|
4401
4448
|
if (!this.functions.isValidValue(value)) continue;
|
|
4402
4449
|
sensor[valueKey] = value;
|
|
4403
|
-
this.
|
|
4450
|
+
this.enchargeGridStateSensorService?.updateCharacteristic(type, value);
|
|
4404
4451
|
}
|
|
4405
4452
|
}
|
|
4406
4453
|
|
|
@@ -4577,7 +4624,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
4577
4624
|
for (const { type, value, valueKey } of characteristics) {
|
|
4578
4625
|
if (!this.functions.isValidValue(value)) continue;
|
|
4579
4626
|
accessory[valueKey] = value;
|
|
4580
|
-
this.
|
|
4627
|
+
this.enchargeBackupLevelAndStatServices?.[index]?.updateCharacteristic(type, value);
|
|
4581
4628
|
}
|
|
4582
4629
|
}
|
|
4583
4630
|
|
|
@@ -4910,7 +4957,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
4910
4957
|
};
|
|
4911
4958
|
}
|
|
4912
4959
|
|
|
4913
|
-
|
|
4960
|
+
enpowerData.dryContacts.push(dryContactData);
|
|
4914
4961
|
});
|
|
4915
4962
|
}
|
|
4916
4963
|
|
|
@@ -5046,7 +5093,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
5046
5093
|
{ type: Characteristic.MidState, value: updatedCollarsData.midState },
|
|
5047
5094
|
{ type: Characteristic.GridState, value: updatedCollarsData.gridState },
|
|
5048
5095
|
{ type: Characteristic.Communicating, value: updatedCollarsData.communicating },
|
|
5049
|
-
{ type: Characteristic.
|
|
5096
|
+
{ type: Characteristic.Temperature, value: updatedCollarsData.temperature },
|
|
5050
5097
|
{ type: Characteristic.ReadingTime, value: updatedCollarsData.readingTime }
|
|
5051
5098
|
];
|
|
5052
5099
|
|
|
@@ -5505,7 +5552,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
5505
5552
|
|
|
5506
5553
|
// Create characteristics
|
|
5507
5554
|
const characteristics = [
|
|
5508
|
-
{ type: characteristicType, value: state, valueKey: '
|
|
5555
|
+
{ type: characteristicType, value: state, valueKey: 'state' },
|
|
5509
5556
|
{ type: characteristicType1, value: backupLevel, valueKey: 'backupLevel' },
|
|
5510
5557
|
];
|
|
5511
5558
|
|
|
@@ -5513,7 +5560,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
5513
5560
|
for (const { type, value, valueKey } of characteristics) {
|
|
5514
5561
|
if (!this.functions.isValidValue(value)) continue;
|
|
5515
5562
|
accessory[valueKey] = value;
|
|
5516
|
-
this.
|
|
5563
|
+
this.enchargeBackupLevelSummaryAccessoryService?.updateCharacteristic(type, value);
|
|
5517
5564
|
}
|
|
5518
5565
|
}
|
|
5519
5566
|
|
|
@@ -5532,7 +5579,7 @@ class EnvoyDevice extends EventEmitter {
|
|
|
5532
5579
|
for (const { type, value, valueKey } of characteristics) {
|
|
5533
5580
|
if (!this.functions.isValidValue(value)) continue;
|
|
5534
5581
|
sensor[valueKey] = value;
|
|
5535
|
-
this.
|
|
5582
|
+
this.enchargeBackupLevelSummarySensorServices?.[i]?.updateCharacteristic(type, value);
|
|
5536
5583
|
};
|
|
5537
5584
|
}
|
|
5538
5585
|
}
|