homebridge-solaxcloud-api 2.3.3 → 2.4.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 +140 -131
- package/LICENSE +175 -175
- package/config.sample +15 -15
- package/config.schema.json +105 -105
- package/dist/batteryAccessory.d.ts +70 -70
- package/dist/batteryAccessory.d.ts.map +1 -1
- package/dist/batteryAccessory.js +124 -123
- package/dist/batteryAccessory.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +6 -6
- package/dist/lightSensorAccessory.d.ts +34 -34
- package/dist/lightSensorAccessory.js +58 -58
- package/dist/motionAccessory.d.ts +53 -53
- package/dist/motionAccessory.js +93 -93
- package/dist/outletAccessory.d.ts +100 -100
- package/dist/outletAccessory.js +187 -187
- package/dist/platform.d.ts +62 -56
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +294 -265
- package/dist/platform.js.map +1 -1
- package/dist/platformAccessory.d.ts +70 -70
- package/dist/platformAccessory.js +102 -102
- package/dist/platformInverter.d.ts +180 -176
- package/dist/platformInverter.d.ts.map +1 -1
- package/dist/platformInverter.js +348 -343
- package/dist/platformInverter.js.map +1 -1
- package/dist/platformMeters.d.ts +68 -68
- package/dist/platformMeters.js +2 -2
- package/dist/settings.d.ts +8 -8
- package/dist/settings.js +11 -11
- package/dist/solaxcloudfetch.d.ts +1 -1
- package/dist/solaxcloudfetch.js +21 -21
- package/dist/solaxcloudfetch.js.map +1 -1
- package/dist/statistics.d.ts +36 -36
- package/dist/statistics.js +88 -88
- package/dist/util.d.ts +23 -23
- package/dist/util.js +42 -42
- package/package.json +55 -54
- package/config.json +0 -16
- package/dist/solaxcloudapi.d.ts +0 -163
- package/dist/solaxcloudapi.d.ts.map +0 -1
- package/dist/solaxcloudapi.js +0 -226
- package/dist/solaxcloudapi.js.map +0 -1
- package/test/solaxcloudapi.test.ts +0 -164
package/dist/platform.js
CHANGED
|
@@ -1,266 +1,295 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SolaxCloudAPIPlatform = void 0;
|
|
4
|
-
const util_1 = require("./util");
|
|
5
|
-
const platformInverter_1 = require("./platformInverter");
|
|
6
|
-
/**
|
|
7
|
-
* Valid inverter brands (Solax, QCells)
|
|
8
|
-
*/
|
|
9
|
-
const VALID_INVERTER_BRANDS = ['solax', 'qcells'];
|
|
10
|
-
/**
|
|
11
|
-
* Valid smoothing methods (Simple Moving Average, Exponential Moving Average).
|
|
12
|
-
*/
|
|
13
|
-
const VALID_SMOOTHING_METHODS = ['sma', 'ema'];
|
|
14
|
-
/**
|
|
15
|
-
* Default smoothing method (simple moving average).
|
|
16
|
-
*/
|
|
17
|
-
const DEFAULT_SMOOTHING_METHOD = 'sma';
|
|
18
|
-
/**
|
|
19
|
-
* Default polling frequency from Solax or QCells Cloud (in seconds).
|
|
20
|
-
*/
|
|
21
|
-
const DEFAULT_POLLING_FREQUENCY = 300;
|
|
22
|
-
/**
|
|
23
|
-
* Max polls / min (obtain frequency need to be lower than 10 times/min).
|
|
24
|
-
*/
|
|
25
|
-
const MAX_POLLS_MIN = 10;
|
|
26
|
-
/**
|
|
27
|
-
* Max polls / day (obtain frequency need to be lower than 10,000 times/day).
|
|
28
|
-
*/
|
|
29
|
-
const MAX_POLLS_DAY = 10000;
|
|
30
|
-
/**
|
|
31
|
-
* Maximum polling frequency (in seconds).
|
|
32
|
-
*/
|
|
33
|
-
const MAX_POLLING_FREQUENCY = Math.max(60 / MAX_POLLS_MIN, (24 * 60 * 60) / MAX_POLLS_DAY);
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
*
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
*
|
|
54
|
-
*/
|
|
55
|
-
this.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
this.
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
// check
|
|
65
|
-
if (!
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
//
|
|
69
|
-
this.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
this.
|
|
82
|
-
}
|
|
83
|
-
//
|
|
84
|
-
this.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
this.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
*
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
this.
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SolaxCloudAPIPlatform = void 0;
|
|
4
|
+
const util_1 = require("./util");
|
|
5
|
+
const platformInverter_1 = require("./platformInverter");
|
|
6
|
+
/**
|
|
7
|
+
* Valid inverter brands (Solax, QCells)
|
|
8
|
+
*/
|
|
9
|
+
const VALID_INVERTER_BRANDS = ['solax', 'qcells'];
|
|
10
|
+
/**
|
|
11
|
+
* Valid smoothing methods (Simple Moving Average, Exponential Moving Average).
|
|
12
|
+
*/
|
|
13
|
+
const VALID_SMOOTHING_METHODS = ['sma', 'ema'];
|
|
14
|
+
/**
|
|
15
|
+
* Default smoothing method (simple moving average).
|
|
16
|
+
*/
|
|
17
|
+
const DEFAULT_SMOOTHING_METHOD = 'sma';
|
|
18
|
+
/**
|
|
19
|
+
* Default polling frequency from Solax or QCells Cloud (in seconds).
|
|
20
|
+
*/
|
|
21
|
+
const DEFAULT_POLLING_FREQUENCY = 300;
|
|
22
|
+
/**
|
|
23
|
+
* Max polls / min (obtain frequency need to be lower than 10 times/min).
|
|
24
|
+
*/
|
|
25
|
+
const MAX_POLLS_MIN = 10;
|
|
26
|
+
/**
|
|
27
|
+
* Max polls / day (obtain frequency need to be lower than 10,000 times/day).
|
|
28
|
+
*/
|
|
29
|
+
const MAX_POLLS_DAY = 10000;
|
|
30
|
+
/**
|
|
31
|
+
* Maximum polling frequency (in seconds).
|
|
32
|
+
*/
|
|
33
|
+
const MAX_POLLING_FREQUENCY = Math.max(60 / MAX_POLLS_MIN, (24 * 60 * 60) / MAX_POLLS_DAY);
|
|
34
|
+
/**
|
|
35
|
+
* Maximum polling interval that still gives at least one smoothing period.
|
|
36
|
+
*/
|
|
37
|
+
const MAX_SMOOTHING_POLLING_FREQUENCY = 15 * 60;
|
|
38
|
+
/**
|
|
39
|
+
* SolaxCloudAPIPlatform.
|
|
40
|
+
* This class is the main constructor for your plugin, this is where you should
|
|
41
|
+
* parse the user config and discover/register accessories with Homebridge.
|
|
42
|
+
*/
|
|
43
|
+
class SolaxCloudAPIPlatform {
|
|
44
|
+
/**
|
|
45
|
+
* Platform constructor.
|
|
46
|
+
* @param log
|
|
47
|
+
* @param config
|
|
48
|
+
* @param api
|
|
49
|
+
* @returns
|
|
50
|
+
*/
|
|
51
|
+
constructor(log, config, api) {
|
|
52
|
+
/**
|
|
53
|
+
* Number of periods to use for data smoothing.
|
|
54
|
+
*/
|
|
55
|
+
this.smoothingWindow = 1;
|
|
56
|
+
/**
|
|
57
|
+
* Array of inverters.
|
|
58
|
+
*/
|
|
59
|
+
this.inverters = [];
|
|
60
|
+
// store values in properties
|
|
61
|
+
this.log = log;
|
|
62
|
+
this.config = config;
|
|
63
|
+
this.api = api;
|
|
64
|
+
// sanity check
|
|
65
|
+
if (!api || !config) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
// check for valid config
|
|
69
|
+
if (!this.checkConfig(this.config)) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
// window for smoothing (aim for a 15 minute window)
|
|
73
|
+
this.smoothingWindow = Math.floor(15 * 60 / this.config.pollingFrequency);
|
|
74
|
+
this.log.info(`Window for smoothing series is ${this.smoothingWindow} periods.`);
|
|
75
|
+
try {
|
|
76
|
+
// loop over configured inverters
|
|
77
|
+
this.config.inverters.forEach(inverter => {
|
|
78
|
+
// setup new inverter
|
|
79
|
+
const platformInverter = new platformInverter_1.SolaxCloudAPIPlatformInverter(log, config, api, VALID_INVERTER_BRANDS.indexOf(inverter.brand), inverter.tokenId, inverter.sn, inverter.name, inverter.hasBattery, this.smoothingWindow);
|
|
80
|
+
// add new inverter to list
|
|
81
|
+
this.inverters.push(platformInverter);
|
|
82
|
+
});
|
|
83
|
+
// create inverter totalizers
|
|
84
|
+
if (this.inverters.length > 1) {
|
|
85
|
+
const uniqueInverterBrands = new Set(this.config.inverters.map(inverter => inverter.brand));
|
|
86
|
+
const brandName = uniqueInverterBrands.size === 1
|
|
87
|
+
? this.config.inverters[0].brand
|
|
88
|
+
: 'Solax/QCells';
|
|
89
|
+
this.allInverters = new platformInverter_1.SolaxCloudAPIPlatformInverter(log, config, api, VALID_INVERTER_BRANDS.indexOf(this.config.inverters[0].brand), '', 'total', 'All inverters', this.inverters.map(inverter => +inverter.hasBattery()).reduce((a, b) => a + b, 0) > 0, this.smoothingWindow, true, SolaxCloudAPIPlatform.getInverterBrandDisplayName(brandName));
|
|
90
|
+
}
|
|
91
|
+
// start data fetching
|
|
92
|
+
this.fetchDataPeriodically();
|
|
93
|
+
this.log.debug('Finished initializing platform.');
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
this.log.error(`Unexpected error: ${error}`);
|
|
97
|
+
}
|
|
98
|
+
// When this event is fired it means Homebridge has created all accessories.
|
|
99
|
+
this.api.on("didFinishLaunching" /* DID_FINISH_LAUNCHING */, () => {
|
|
100
|
+
this.log.debug('Executed didFinishLaunching callback');
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Check whether object implements interface InverterConfig and brand has a valid entry.
|
|
105
|
+
* @param obj Any object.
|
|
106
|
+
* @returns Whether object implements interface InverterConfig.
|
|
107
|
+
*/
|
|
108
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
109
|
+
static isInverterConfig(obj) {
|
|
110
|
+
return 'name' in obj && 'sn' in obj && 'brand' in obj && 'tokenId' in obj && VALID_INVERTER_BRANDS.includes(obj.brand);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Gets an inverter brand display name from config.
|
|
114
|
+
* @param brand Inverter brand from config.
|
|
115
|
+
* @returns Inverter brand display name.
|
|
116
|
+
*/
|
|
117
|
+
static getInverterBrandDisplayName(brand) {
|
|
118
|
+
switch (brand) {
|
|
119
|
+
case 'qcells':
|
|
120
|
+
return 'QCells';
|
|
121
|
+
case 'solax':
|
|
122
|
+
return 'Solax';
|
|
123
|
+
default:
|
|
124
|
+
return brand;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Update data for virtual inverter totalizer based on individual inverter data.
|
|
129
|
+
*/
|
|
130
|
+
updateAllInvertersData() {
|
|
131
|
+
this.allInverters.setRawPower(platformInverter_1.ACCESSORY_KEYS.pv, this.inverters.map(inverter => inverter.getRawPower(platformInverter_1.ACCESSORY_KEYS.pv)).reduce((a, b) => a + b, 0));
|
|
132
|
+
this.allInverters.setRawPower(platformInverter_1.ACCESSORY_KEYS.inverterAC, this.inverters.map(inverter => inverter.getRawPower(platformInverter_1.ACCESSORY_KEYS.inverterAC)).reduce((a, b) => a + b, 0));
|
|
133
|
+
this.allInverters.setRawEnergy(platformInverter_1.ACCESSORY_KEYS.inverterAC, this.inverters.map(inverter => inverter.getRawEnergy(platformInverter_1.ACCESSORY_KEYS.inverterAC)).reduce((a, b) => a + b, 0));
|
|
134
|
+
this.allInverters.setRawPower(platformInverter_1.ACCESSORY_KEYS.inverterToGrid, this.inverters.map(inverter => inverter.getRawPower(platformInverter_1.ACCESSORY_KEYS.inverterToGrid)).reduce((a, b) => a + b, 0));
|
|
135
|
+
this.allInverters.setRawPower(platformInverter_1.ACCESSORY_KEYS.inverterToHouse, this.inverters.map(inverter => inverter.getRawPower(platformInverter_1.ACCESSORY_KEYS.inverterToHouse)).reduce((a, b) => a + b, 0));
|
|
136
|
+
this.allInverters.setRawPower(platformInverter_1.ACCESSORY_KEYS.gridToHouse, this.inverters.map(inverter => inverter.getRawPower(platformInverter_1.ACCESSORY_KEYS.gridToHouse)).reduce((a, b) => a + b, 0));
|
|
137
|
+
if (this.allInverters.hasBattery()) {
|
|
138
|
+
// get array of inverters with battery
|
|
139
|
+
const invertersWithBattery = this.inverters.filter(inverter => inverter.hasBattery());
|
|
140
|
+
// battery charge / discharge power
|
|
141
|
+
this.allInverters.setRawPower(platformInverter_1.ACCESSORY_KEYS.inverterFromBattery, invertersWithBattery.map(inverter => inverter.getRawPower(platformInverter_1.ACCESSORY_KEYS.inverterFromBattery)).reduce((a, b) => a + b, 0));
|
|
142
|
+
this.allInverters.setRawPower(platformInverter_1.ACCESSORY_KEYS.inverterToBattery, invertersWithBattery.map(inverter => inverter.getRawPower(platformInverter_1.ACCESSORY_KEYS.inverterToBattery)).reduce((a, b) => a + b, 0));
|
|
143
|
+
// battery SoC
|
|
144
|
+
this.allInverters.setBatteryChargeState(Math.max(...invertersWithBattery.map(inverter => inverter.getBatteryChargeState())));
|
|
145
|
+
const levelSums = invertersWithBattery.map(inverter => inverter.getBatteryLevel()).reduce((a, b) => a + b, 0);
|
|
146
|
+
this.allInverters.setBatteryLevel(levelSums / invertersWithBattery.length); // average levels
|
|
147
|
+
}
|
|
148
|
+
// notify update with motion
|
|
149
|
+
this.allInverters.setMotionUpdate();
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Sleeps for a number of milliseconds.
|
|
153
|
+
* @param millis {number} The number of milliseconds to sleep.
|
|
154
|
+
*/
|
|
155
|
+
async sleep(millis) {
|
|
156
|
+
return new Promise(resolve => setTimeout(resolve, millis));
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Periodically retrieves inverter data from Solax Cloud API using configured tokenID and SN.
|
|
160
|
+
*/
|
|
161
|
+
async fetchDataPeriodically() {
|
|
162
|
+
// loop forever
|
|
163
|
+
for (;;) {
|
|
164
|
+
// update data for all configured inverters
|
|
165
|
+
this.inverters.forEach(inverter => inverter.updateInverterDataFromCloud());
|
|
166
|
+
this.log.info(`Updated data from configured Cloud APIs, sleeping for ${this.config.pollingFrequency} seconds.`);
|
|
167
|
+
// update inverter totalizers if needed
|
|
168
|
+
if (this.inverters.length > 1) {
|
|
169
|
+
this.log.info('Computing inverter totals...');
|
|
170
|
+
this.updateAllInvertersData();
|
|
171
|
+
}
|
|
172
|
+
// sleep until next data poll
|
|
173
|
+
await this.sleep(this.config.pollingFrequency * 1000);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Checks platform config validity and sets defaults whenever needed.
|
|
178
|
+
* @returns {boolean} Whether the config is valid.
|
|
179
|
+
*/
|
|
180
|
+
checkConfig(config) {
|
|
181
|
+
let result = true;
|
|
182
|
+
this.log.debug(`Config read: ${JSON.stringify(config)}`);
|
|
183
|
+
// check for mandatory parameters
|
|
184
|
+
if (!config.inverters) {
|
|
185
|
+
this.log.error('Config check: Can\'t find mandatory parameter "inverters" parameter in config file, aborting!');
|
|
186
|
+
result = false;
|
|
187
|
+
return result;
|
|
188
|
+
}
|
|
189
|
+
// check for inverters type
|
|
190
|
+
if (Array.isArray(config.inverters)) {
|
|
191
|
+
// loop over inverters and check config type
|
|
192
|
+
config.inverters.forEach(inverter => {
|
|
193
|
+
if (!SolaxCloudAPIPlatform.isInverterConfig(inverter)) {
|
|
194
|
+
this.log.error('Config check: Invalid type for inverter under "inverters" in config file, aborting!');
|
|
195
|
+
result = false;
|
|
196
|
+
return result;
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
this.log.error('Config check: Incorrect type for mandatory parameter "inverters" in config file, aborting!');
|
|
202
|
+
result = false;
|
|
203
|
+
return result;
|
|
204
|
+
}
|
|
205
|
+
// check for duplicates
|
|
206
|
+
if (util_1.Util.arrayHasDuplicates(config.inverters.map(inverter => inverter.name))) {
|
|
207
|
+
this.log.error('Config check: Duplicate inverter names in config file, aborting!');
|
|
208
|
+
result = false;
|
|
209
|
+
return result;
|
|
210
|
+
}
|
|
211
|
+
else if (util_1.Util.arrayHasDuplicates(config.inverters.map(inverter => inverter.sn))) {
|
|
212
|
+
this.log.error('Config check: Duplicate inverter SNs in config file, aborting!');
|
|
213
|
+
result = false;
|
|
214
|
+
return result;
|
|
215
|
+
}
|
|
216
|
+
// check for polling frequency
|
|
217
|
+
if (config.pollingFrequency === undefined) {
|
|
218
|
+
this.log.info(`Config check: No polling frequency provided, defaulting to ${DEFAULT_POLLING_FREQUENCY} seconds.`);
|
|
219
|
+
config.pollingFrequency = DEFAULT_POLLING_FREQUENCY;
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
if (Number.isInteger(config.pollingFrequency) && config.pollingFrequency > 0) {
|
|
223
|
+
// all good?
|
|
224
|
+
if (config.pollingFrequency < MAX_POLLING_FREQUENCY) {
|
|
225
|
+
this.log.info(`Config check: Polling frequency cannot be higher than ${MAX_POLLS_MIN} times/min and ${MAX_POLLS_DAY} ` +
|
|
226
|
+
`times/day, defaulting to ${DEFAULT_POLLING_FREQUENCY} seconds.`);
|
|
227
|
+
config.pollingFrequency = DEFAULT_POLLING_FREQUENCY;
|
|
228
|
+
}
|
|
229
|
+
else if (config.pollingFrequency > MAX_SMOOTHING_POLLING_FREQUENCY) {
|
|
230
|
+
const message = 'Config check: Polling frequency cannot be higher than ' +
|
|
231
|
+
`${MAX_SMOOTHING_POLLING_FREQUENCY} seconds, aborting!`;
|
|
232
|
+
this.log.error(message);
|
|
233
|
+
throw new Error(message);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
this.log.info('Config check: Invalid polling frequency (must be a positive integer number), defaulting to ' +
|
|
238
|
+
`${DEFAULT_POLLING_FREQUENCY} seconds.`);
|
|
239
|
+
config.pollingFrequency = DEFAULT_POLLING_FREQUENCY;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
// check for smooth meters
|
|
243
|
+
if (config.smoothMeters === undefined) {
|
|
244
|
+
config.smoothMeters = true;
|
|
245
|
+
this.log.info(`Config check: No config for smooth meters, defaulting to ${config.smoothMeters}.`);
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
if (typeof config.smoothMeters !== 'boolean') {
|
|
249
|
+
config.smoothMeters = true;
|
|
250
|
+
this.log.info(`Config check: Invalid setting for smooth meters, defaulting to ${config.smoothMeters}.`);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
// check for smoothing method
|
|
254
|
+
if (config.smoothingMethod === undefined) {
|
|
255
|
+
this.log.info(`Config check: No smoothing method provided, defaulting to "${DEFAULT_SMOOTHING_METHOD}".`);
|
|
256
|
+
config.smoothingMethod = DEFAULT_SMOOTHING_METHOD;
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
if (!VALID_SMOOTHING_METHODS.includes(config.smoothingMethod)) {
|
|
260
|
+
this.log.info(`Config check: Invalid smoothing method, defaulting to "${DEFAULT_SMOOTHING_METHOD}".`);
|
|
261
|
+
config.smoothingMethod = DEFAULT_SMOOTHING_METHOD;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
// check for Home app accessories
|
|
265
|
+
if (config.pureHomeApp === undefined) {
|
|
266
|
+
config.pureHomeApp = false;
|
|
267
|
+
this.log.info(`Config check: No config for using pure Home app accessories, defaulting to ${config.pureHomeApp}.`);
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
if (typeof config.pureHomeApp !== 'boolean') {
|
|
271
|
+
config.pureHomeApp = false;
|
|
272
|
+
this.log.info(`Config check: Invalid setting for using pure Home app accessories, defaulting to ${config.pureHomeApp}.`);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
this.log.info(`Config check: final config is ${JSON.stringify(config)}`);
|
|
276
|
+
return result;
|
|
277
|
+
}
|
|
278
|
+
/*
|
|
279
|
+
* This method is called once at startup.
|
|
280
|
+
* The Platform should pass all accessories which need to be created to the callback in form of a AccessoryPlugin.
|
|
281
|
+
* The Platform must respond in a timely manner as otherwise the startup of the bridge would be unnecessarily delayed.
|
|
282
|
+
*/
|
|
283
|
+
accessories(callback) {
|
|
284
|
+
const accessories = [];
|
|
285
|
+
// loop over inverters and add accessories
|
|
286
|
+
this.inverters.forEach(inverter => accessories.push(...inverter.getAccessories()));
|
|
287
|
+
// add inverter totalizer accessories if needed
|
|
288
|
+
if (this.inverters.length > 1) {
|
|
289
|
+
accessories.push(...this.allInverters.getAccessories());
|
|
290
|
+
}
|
|
291
|
+
callback(accessories);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
exports.SolaxCloudAPIPlatform = SolaxCloudAPIPlatform;
|
|
266
295
|
//# sourceMappingURL=platform.js.map
|
package/dist/platform.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";;;AAEA,iCAA8B;AAC9B,yDAAmF;AAEnF;;GAEG;AACH,MAAM,qBAAqB,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AAElD;;GAEG;AACH,MAAM,uBAAuB,GAAG,CAAE,KAAK,EAAE,KAAK,CAAE,CAAC;AAEjD;;GAEG;AACH,MAAM,wBAAwB,GAAG,KAAK,CAAC;AAEvC;;GAEG;AACH,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAEtC;;GAEG;AACH,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB;;GAEG;AACH,MAAM,aAAa,GAAG,KAAK,CAAC;AAE5B;;GAEG;AACH,MAAM,qBAAqB,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,aAAa,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";;;AAEA,iCAA8B;AAC9B,yDAAmF;AAEnF;;GAEG;AACH,MAAM,qBAAqB,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AAElD;;GAEG;AACH,MAAM,uBAAuB,GAAG,CAAE,KAAK,EAAE,KAAK,CAAE,CAAC;AAEjD;;GAEG;AACH,MAAM,wBAAwB,GA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