homebridge-solaxcloud-api 1.2.1 → 1.3.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/README.md +4 -3
- package/dist/motionAccessory.d.ts +9 -5
- package/dist/motionAccessory.d.ts.map +1 -1
- package/dist/motionAccessory.js +12 -6
- package/dist/motionAccessory.js.map +1 -1
- package/dist/outletAccessory.d.ts +16 -3
- package/dist/outletAccessory.d.ts.map +1 -1
- package/dist/outletAccessory.js +25 -5
- package/dist/outletAccessory.js.map +1 -1
- package/dist/platform.d.ts +20 -2
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +8 -1
- package/dist/platform.js.map +1 -1
- package/dist/platformAccessory.d.ts +1 -2
- package/dist/platformAccessory.d.ts.map +1 -1
- package/dist/platformAccessory.js +1 -4
- package/dist/platformAccessory.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -57,7 +57,9 @@ Minimum platform configuration is depicted by the example configuration file bel
|
|
|
57
57
|
]
|
|
58
58
|
}
|
|
59
59
|
```
|
|
60
|
-
|
|
60
|
+
**NOTE:** The `pollingFrequency` parameter is optional and defaults to 300 seconds, since Solax inverters update cloud data every 5 minutes.
|
|
61
|
+
|
|
62
|
+
Configuration through the the use of [Homebridge UI](https://github.com/oznu/homebridge-config-ui-x) plugin is also available and recommended:
|
|
61
63
|
|
|
62
64
|

|
|
63
65
|
|
|
@@ -71,7 +73,7 @@ This will allow some important non-standard characteristics to be visible (like
|
|
|
71
73
|
|
|
72
74
|
# Automation
|
|
73
75
|
|
|
74
|
-
Automation can be
|
|
76
|
+
Automation can be achieved with the help of the virtual "Update" motion sensor that was specifically tailored for this effect. This motion sensor will be triggered whenever data gets updated from the Solax Cloud API (in line with what is defined on the `pollingFrequency` configuration setting).
|
|
75
77
|
|
|
76
78
|

|
|
77
79
|
|
|
@@ -85,5 +87,4 @@ As an automation example...
|
|
|
85
87
|
|
|
86
88
|
Next planned plugin releases should include:
|
|
87
89
|
|
|
88
|
-
- Inverter AC (to include Yield energy)
|
|
89
90
|
- History through [fakegato-history](https://github.com/simont77/fakegato-history) module
|
|
@@ -3,15 +3,19 @@ import { Service, AccessoryPlugin, Logging, CharacteristicGetCallback } from 'ho
|
|
|
3
3
|
import { SolaxCloudAPIPlatform } from './platform';
|
|
4
4
|
import { SolaxPlatformAccessory } from './platformAccessory';
|
|
5
5
|
/**
|
|
6
|
-
* Solax Motion Accessory
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* Solax Motion Accessory.
|
|
7
|
+
* Virtual motion sensor triggered whenever new data is fetched from Solax Cloud.
|
|
8
|
+
* Sensor will automatically clear itself after MOTION_TIMEOUT seconds (5 seconds).
|
|
9
9
|
*/
|
|
10
10
|
export declare class SolaxMotionAccessory extends SolaxPlatformAccessory implements AccessoryPlugin {
|
|
11
11
|
private readonly motionService;
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Whether motion is detected (Solax Cloud data updated).
|
|
14
|
+
*/
|
|
13
15
|
private motion;
|
|
14
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Update interval to turn motion back off (in seconds).
|
|
18
|
+
*/
|
|
15
19
|
private motionTimeout;
|
|
16
20
|
constructor(platform: SolaxCloudAPIPlatform, log: Logging, name: string);
|
|
17
21
|
sleep: typeof import("timers/promises").setTimeout;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"motionAccessory.d.ts","sourceRoot":"","sources":["../src/motionAccessory.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAI1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"motionAccessory.d.ts","sourceRoot":"","sources":["../src/motionAccessory.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAI1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAO7D;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,sBAAuB,YAAW,eAAe;IAEzF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAU;IAExC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAS;IAEvB;;OAEG;IACH,OAAO,CAAC,aAAa,CAA0B;gBAEnC,QAAQ,EAAE,qBAAqB,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM;IAevE,KAAK,8CAA8B;IAEnC;;;OAGG;IACI,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,GAAG,IAAI;IAM1D;;;OAGG;IACI,QAAQ,CAAC,MAAM,EAAE,OAAO;IAmB/B,WAAW,IAAI,OAAO,EAAE;CAOzB"}
|
package/dist/motionAccessory.js
CHANGED
|
@@ -6,19 +6,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.SolaxMotionAccessory = void 0;
|
|
7
7
|
const util_1 = __importDefault(require("util"));
|
|
8
8
|
const platformAccessory_1 = require("./platformAccessory");
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Motion timeout in seconds.
|
|
11
|
+
*/
|
|
10
12
|
const MOTION_TIMEOUT = 5;
|
|
11
13
|
/**
|
|
12
|
-
* Solax Motion Accessory
|
|
13
|
-
*
|
|
14
|
-
*
|
|
14
|
+
* Solax Motion Accessory.
|
|
15
|
+
* Virtual motion sensor triggered whenever new data is fetched from Solax Cloud.
|
|
16
|
+
* Sensor will automatically clear itself after MOTION_TIMEOUT seconds (5 seconds).
|
|
15
17
|
*/
|
|
16
18
|
class SolaxMotionAccessory extends platformAccessory_1.SolaxPlatformAccessory {
|
|
17
19
|
constructor(platform, log, name) {
|
|
18
20
|
super(platform, log, name);
|
|
19
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Whether motion is detected (Solax Cloud data updated).
|
|
23
|
+
*/
|
|
20
24
|
this.motion = false;
|
|
21
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Update interval to turn motion back off (in seconds).
|
|
27
|
+
*/
|
|
22
28
|
this.motionTimeout = MOTION_TIMEOUT;
|
|
23
29
|
this.sleep = util_1.default.promisify(setTimeout);
|
|
24
30
|
const hap = this.platform.api.hap;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"motionAccessory.js","sourceRoot":"","sources":["../src/motionAccessory.ts"],"names":[],"mappings":";;;;;;AAEA,gDAAwB;AAGxB,2DAA6D;AAE7D
|
|
1
|
+
{"version":3,"file":"motionAccessory.js","sourceRoot":"","sources":["../src/motionAccessory.ts"],"names":[],"mappings":";;;;;;AAEA,gDAAwB;AAGxB,2DAA6D;AAE7D;;GAEG;AACH,MAAM,cAAc,GAAG,CAAC,CAAC;AAEzB;;;;GAIG;AACH,MAAa,oBAAqB,SAAQ,0CAAsB;IAc9D,YAAY,QAA+B,EAAE,GAAY,EAAE,IAAY;QACrE,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QAX7B;;WAEG;QACK,WAAM,GAAG,KAAK,CAAC;QAEvB;;WAEG;QACK,kBAAa,GAAW,cAAc,CAAC;QAiB/C,UAAK,GAAG,cAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAZjC,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;QAElC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,2BAA2B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QAExD,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7D,IA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
|
|
4
4
|
/**
|
|
5
5
|
* Solax Outlet Accessory.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Virtual outlet used to monitor and measure both power and total energy consumption from Solax devices.
|
|
7
|
+
* Outlet use is inferred from a positive power comsumption.
|
|
8
8
|
*/
|
|
9
9
|
export declare class SolaxOutletAccessory extends SolaxPlatformAccessory implements AccessoryPlugin {
|
|
10
10
|
private readonly outletService;
|
|
11
|
+
/**
|
|
12
|
+
* Current power reading in Watt.
|
|
13
|
+
*/
|
|
11
14
|
private powerConsumption;
|
|
12
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Total energy readings in KWh.
|
|
17
|
+
*/
|
|
13
18
|
private totalEnergyConsumption;
|
|
14
19
|
constructor(platform: SolaxCloudAPIPlatform, log: Logging, name: string);
|
|
15
20
|
/**
|
|
@@ -26,6 +31,14 @@ export declare class SolaxOutletAccessory extends SolaxPlatformAccessory impleme
|
|
|
26
31
|
* Sets the current power consumption.
|
|
27
32
|
* @param {number} powerConsumption The power consumption to set. */
|
|
28
33
|
setPowerConsumption(powerConsumption: number): void;
|
|
34
|
+
/**
|
|
35
|
+
* Gets the total energy consumpion.
|
|
36
|
+
*/
|
|
37
|
+
getTotalEnergyConsumption(callback: CharacteristicGetCallback): void;
|
|
38
|
+
/**
|
|
39
|
+
* Sets the total energy consumption.
|
|
40
|
+
* @param {number} totalEnergyConsumption The total energy consumption to set. */
|
|
41
|
+
setTotalEnergyConsumption(totalEnergyConsumption: number): void;
|
|
29
42
|
/**
|
|
30
43
|
* Gets the outlet state Characteristic based on its consumed power.
|
|
31
44
|
* @param {CharacteristicGetCallback} callback The callback.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outletAccessory.d.ts","sourceRoot":"","sources":["../src/outletAccessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,yBAAyB,EAAkB,MAAM,YAAY,CAAC;AAE1G,OAAO,EAAE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 +4,19 @@ exports.SolaxOutletAccessory = void 0;
|
|
|
4
4
|
const platformAccessory_1 = require("./platformAccessory");
|
|
5
5
|
/**
|
|
6
6
|
* Solax Outlet Accessory.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Virtual outlet used to monitor and measure both power and total energy consumption from Solax devices.
|
|
8
|
+
* Outlet use is inferred from a positive power comsumption.
|
|
9
9
|
*/
|
|
10
10
|
class SolaxOutletAccessory extends platformAccessory_1.SolaxPlatformAccessory {
|
|
11
11
|
constructor(platform, log, name) {
|
|
12
12
|
super(platform, log, name);
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Current power reading in Watt.
|
|
15
|
+
*/
|
|
14
16
|
this.powerConsumption = 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Total energy readings in KWh.
|
|
19
|
+
*/
|
|
17
20
|
this.totalEnergyConsumption = 0.0;
|
|
18
21
|
const hap = this.platform.api.hap;
|
|
19
22
|
this.log.debug(`Creating outlet "${this.name}"`);
|
|
@@ -24,6 +27,8 @@ class SolaxOutletAccessory extends platformAccessory_1.SolaxPlatformAccessory {
|
|
|
24
27
|
on("get" /* GET */, this.getState.bind(this));
|
|
25
28
|
// current consumption
|
|
26
29
|
this.outletService.addOptionalCharacteristic(this.platform.eve.Characteristics.CurrentConsumption);
|
|
30
|
+
// total consumption
|
|
31
|
+
this.outletService.addOptionalCharacteristic(this.platform.eve.Characteristics.TotalConsumption);
|
|
27
32
|
log.info(`Outlet "${name}" created!`);
|
|
28
33
|
}
|
|
29
34
|
/**
|
|
@@ -53,6 +58,21 @@ class SolaxOutletAccessory extends platformAccessory_1.SolaxPlatformAccessory {
|
|
|
53
58
|
this.powerConsumption = powerConsumption;
|
|
54
59
|
this.setCharacteristicValue(this.platform.eve.Characteristics.CurrentConsumption, this.powerConsumption);
|
|
55
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Gets the total energy consumpion.
|
|
63
|
+
*/
|
|
64
|
+
getTotalEnergyConsumption(callback) {
|
|
65
|
+
this.log.debug(`${this.name}: GET Total Energy (energy=${this.totalEnergyConsumption}kWh)`);
|
|
66
|
+
callback(null, this.totalEnergyConsumption);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Sets the total energy consumption.
|
|
70
|
+
* @param {number} totalEnergyConsumption The total energy consumption to set. */
|
|
71
|
+
setTotalEnergyConsumption(totalEnergyConsumption) {
|
|
72
|
+
this.log.debug(`${this.name}: SET Total Energy (energy=${totalEnergyConsumption}kWh)`);
|
|
73
|
+
this.totalEnergyConsumption = totalEnergyConsumption;
|
|
74
|
+
this.setCharacteristicValue(this.platform.eve.Characteristics.TotalConsumption, this.totalEnergyConsumption);
|
|
75
|
+
}
|
|
56
76
|
/**
|
|
57
77
|
* Gets the outlet state Characteristic based on its consumed power.
|
|
58
78
|
* @param {CharacteristicGetCallback} callback The callback.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outletAccessory.js","sourceRoot":"","sources":["../src/outletAccessory.ts"],"names":[],"mappings":";;;AAGA,2DAA6D;AAE7D;;;;GAIG;AACH,MAAa,oBAAqB,SAAQ,0CAAsB;
|
|
1
|
+
{"version":3,"file":"outletAccessory.js","sourceRoot":"","sources":["../src/outletAccessory.ts"],"names":[],"mappings":";;;AAGA,2DAA6D;AAE7D;;;;GAIG;AACH,MAAa,oBAAqB,SAAQ,0CAAsB;IAc9D,YAAY,QAA+B,EAAE,GAAY,EAAE,IAAY;QACrE,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QAX7B;;WAEG;QACK,qBAAgB,GAAG,CAAC,CAAC;QAE7B;;WAEG;QACK,2BAAsB,GAAG,GAAG,CAAC;QAKnC,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;QAElC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,oBAAoB,IAAI,CAAC,IAAI,GAAG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|
|
|
11
11
|
private readonly log;
|
|
12
12
|
private readonly config;
|
|
13
13
|
readonly api: API;
|
|
14
|
-
eve: EveHomeKitTypes;
|
|
14
|
+
readonly eve: EveHomeKitTypes;
|
|
15
15
|
private readonly solaxCloudAPI;
|
|
16
|
-
apiData
|
|
16
|
+
private apiData;
|
|
17
|
+
/**
|
|
18
|
+
* Virtual outlet used to detect and measure photovoltaic production.
|
|
19
|
+
*/
|
|
17
20
|
private outletPV;
|
|
21
|
+
/**
|
|
22
|
+
* Virtual outlet used to detect and measure inverter AC production.
|
|
23
|
+
*/
|
|
18
24
|
private outletInverterAC;
|
|
25
|
+
/**
|
|
26
|
+
* Virtual outlet used to detect and measure inverter excess production injected in the grid.
|
|
27
|
+
*/
|
|
19
28
|
private outletInverterToGrid;
|
|
29
|
+
/**
|
|
30
|
+
* Virtual outlet used to detect and measure inverter production directly fed into the house (self-consumption).
|
|
31
|
+
*/
|
|
20
32
|
private outletInverterToHouse;
|
|
33
|
+
/**
|
|
34
|
+
* Virtual outlet used to detect and measure grid power fed into the house.
|
|
35
|
+
*/
|
|
21
36
|
private outletGridToHouse;
|
|
37
|
+
/**
|
|
38
|
+
* Virtual motion sensor triggered by data updates from Solax Cloud.
|
|
39
|
+
*/
|
|
22
40
|
private motionUpdate;
|
|
23
41
|
/**
|
|
24
42
|
* Platform constructor.
|
package/dist/platform.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,oBAAoB,EAAE,OAAO,EAAE,cAAc,EAAY,MAAM,YAAY,CAAC;AAE3G,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAMjD,OAAO,EAAE,qBAAqB,EAAiB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,oBAAoB,EAAE,OAAO,EAAE,cAAc,EAAY,MAAM,YAAY,CAAC;AAE3G,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAMjD,OAAO,EAAE,qBAAqB,EAAiB,MAAM,iBAAiB,CAAC;AAQvE;;;;GAIG;AACH,qBAAa,qBAAsB,YAAW,oBAAoB;IAChE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAU;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,SAAgB,GAAG,EAAE,GAAG,CAAC;IAEzB,SAAgB,GAAG,EAAE,eAAe,CAAC;IAErC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;IAC/C,OAAO,CAAC,OAAO,CAAyB;IAExC;;MAEE;IACF,OAAO,CAAC,QAAQ,CAAwB;IAExC;;OAEG;IACH,OAAO,CAAC,gBAAgB,CAAwB;IAEhD;;OAEG;IACH,OAAO,CAAC,oBAAoB,CAAwB;IAEpD;;OAEG;IACH,OAAO,CAAC,qBAAqB,CAAwB;IAErD;;OAEG;IACH,OAAO,CAAC,iBAAiB,CAAwB;IAEjD;;OAEG;IACH,OAAO,CAAC,YAAY,CAAwB;IAE5C;;;;;;OAMG;gBACU,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,GAAG;IAyC3D,KAAK,8CAA8B;IAEnC;;OAEG;YACW,mBAAmB;IA+CjC;;;OAGG;IACI,UAAU,IAAI,qBAAqB;IAiB1C,WAAW,CAAC,QAAQ,EAAE,CAAC,gBAAgB,EAAE,eAAe,EAAE,KAAK,IAAI,GAAG,IAAI;CAK3E"}
|
package/dist/platform.js
CHANGED
|
@@ -9,6 +9,10 @@ const outletAccessory_1 = require("./outletAccessory");
|
|
|
9
9
|
const util_1 = __importDefault(require("util"));
|
|
10
10
|
const solaxcloudapi_1 = require("./solaxcloudapi");
|
|
11
11
|
const motionAccessory_1 = require("./motionAccessory");
|
|
12
|
+
/**
|
|
13
|
+
* Default polling frequency from Solax Cloud (in seconds).
|
|
14
|
+
*/
|
|
15
|
+
const DEFAULT_POLLING_FREQUENCY = 300;
|
|
12
16
|
/**
|
|
13
17
|
* HomebridgePlatform
|
|
14
18
|
* This class is the main constructor for your plugin, this is where you should
|
|
@@ -32,6 +36,8 @@ class SolaxCloudAPIPlatform {
|
|
|
32
36
|
if (!api || !config) {
|
|
33
37
|
return;
|
|
34
38
|
}
|
|
39
|
+
// setup default polling frequency
|
|
40
|
+
this.config.pollingFrequency = this.config.pollingFrequency || DEFAULT_POLLING_FREQUENCY;
|
|
35
41
|
this.eve = new homebridge_lib_1.EveHomeKitTypes(api);
|
|
36
42
|
this.log.debug(`Config: \n${JSON.stringify(config, null, ' ')}`);
|
|
37
43
|
// setup outlet accessories
|
|
@@ -65,6 +71,7 @@ class SolaxCloudAPIPlatform {
|
|
|
65
71
|
this.outletPV.setSerial(`pv-${this.apiData.result.inverterSN}`);
|
|
66
72
|
this.outletPV.setModel(solaxcloudapi_1.SolaxCloudAPI.getInverterType(this.apiData.result.inverterType));
|
|
67
73
|
this.outletInverterAC.setPowerConsumption(solaxcloudapi_1.SolaxCloudAPI.getInverterACPower(this.apiData.result));
|
|
74
|
+
this.outletInverterAC.setTotalEnergyConsumption(solaxcloudapi_1.SolaxCloudAPI.getYieldTotal(this.apiData.result));
|
|
68
75
|
this.outletInverterAC.setSerial(`inv-ac-${this.apiData.result.inverterSN}`);
|
|
69
76
|
this.outletInverterAC.setModel(solaxcloudapi_1.SolaxCloudAPI.getInverterType(this.apiData.result.inverterType));
|
|
70
77
|
this.outletInverterToGrid.setPowerConsumption(solaxcloudapi_1.SolaxCloudAPI.getInverterPowerToGrid(this.apiData.result));
|
|
@@ -89,7 +96,7 @@ class SolaxCloudAPIPlatform {
|
|
|
89
96
|
this.log.error(`Failed to read from Solax Cloud API. Error: ${error}`);
|
|
90
97
|
}
|
|
91
98
|
finally {
|
|
92
|
-
this.log.
|
|
99
|
+
this.log.info(`Updated data from Solax Cloud API, sleeping for ${this.config.pollingFrequency} seconds.`);
|
|
93
100
|
this.sleep(this.config.pollingFrequency * 1000).then(async () => await this.getDataPeriodically());
|
|
94
101
|
}
|
|
95
102
|
}
|
package/dist/platform.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";;;;;;AAEA,mDAAiD;AAEjD,uDAAyD;AAEzD,gDAAwB;AAExB,mDAAuE;AACvE,uDAAyD;AAEzD;;;;GAIG;AACH,MAAa,qBAAqB;
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";;;;;;AAEA,mDAAiD;AAEjD,uDAAyD;AAEzD,gDAAwB;AAExB,mDAAuE;AACvE,uDAAyD;AAEzD;;GAEG;AACH,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAEtC;;;;GAIG;AACH,MAAa,qBAAqB;IAwChC;;;;;;OAMG;IACH,YAAa,GAAY,EAAE,MAAsB,EAAE,GAAQ;QAyC3D,UAAK,GAAG,cAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAxCjC,6BAA6B;QAC7B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QAEf,eAAe;QACf,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE;YACnB,OAAO;SACR;QAED,kCAAkC;QAClC,IAAI,CAAC,MAAM,CAAC,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,IAAI,yBAAyB,CAAC;QAEzF,IAAI,CAAC,GAAG,GAAG,IAAI,gCAAe,CAAC,GAAG,CAAC,CAAC;QAEpC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,SAAS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YAC7C,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,qBAAqB,EAAE,IAAI,CAAC,iBAAiB;YAC7E,IAAI,CAAC,YAAY,CAAE,CAAC,CAAC;IACzB,CAAC;CACF;AAtKD,sDAsKC"}
|
|
@@ -2,8 +2,7 @@ import { Service, AccessoryPlugin, Logging } from 'homebridge';
|
|
|
2
2
|
import { SolaxCloudAPIPlatform } from './platform';
|
|
3
3
|
/**
|
|
4
4
|
* Platform Accessory.
|
|
5
|
-
*
|
|
6
|
-
* Each accessory may expose multiple services of different service types.
|
|
5
|
+
* Generic platform accessory to store accessory name, manufacturer (Solax), inverter model and serial number.
|
|
7
6
|
*/
|
|
8
7
|
export declare class SolaxPlatformAccessory implements AccessoryPlugin {
|
|
9
8
|
protected readonly platform: SolaxCloudAPIPlatform;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platformAccessory.d.ts","sourceRoot":"","sources":["../src/platformAccessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnD
|
|
1
|
+
{"version":3,"file":"platformAccessory.d.ts","sourceRoot":"","sources":["../src/platformAccessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;GAGG;AACH,qBAAa,sBAAuB,YAAW,eAAe;IAC5D,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IACnD,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IAChC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEhC,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;IAE/C,SAAS,CAAC,KAAK,SAAoB;IACnC,SAAS,CAAC,MAAM,SAAoB;gBAExB,QAAQ,EAAE,qBAAqB,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM;IAiBvE;;;OAGG;IACI,QAAQ,IAAI,MAAM;IAMzB;;;OAGG;IACI,QAAQ,CAAC,KAAK,EAAE,MAAM;IAM7B;;;OAGG;IACI,SAAS,IAAI,MAAM;IAM1B;;;OAGG;IACI,SAAS,CAAC,MAAM,EAAE,MAAM;IAU/B,WAAW,IAAI,OAAO,EAAE;CAMzB"}
|
|
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SolaxPlatformAccessory = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Platform Accessory.
|
|
6
|
-
*
|
|
7
|
-
* Each accessory may expose multiple services of different service types.
|
|
6
|
+
* Generic platform accessory to store accessory name, manufacturer (Solax), inverter model and serial number.
|
|
8
7
|
*/
|
|
9
8
|
class SolaxPlatformAccessory {
|
|
10
9
|
constructor(platform, log, name) {
|
|
@@ -14,7 +13,6 @@ class SolaxPlatformAccessory {
|
|
|
14
13
|
this.log = log;
|
|
15
14
|
this.name = name;
|
|
16
15
|
const hap = this.platform.api.hap;
|
|
17
|
-
this.log.debug(`Creating outlet "${this.name}"`);
|
|
18
16
|
// information service
|
|
19
17
|
this.informationService =
|
|
20
18
|
new hap.Service.AccessoryInformation()
|
|
@@ -22,7 +20,6 @@ class SolaxPlatformAccessory {
|
|
|
22
20
|
.setCharacteristic(hap.Characteristic.Manufacturer, 'Solax');
|
|
23
21
|
this.informationService.getCharacteristic(hap.Characteristic.SerialNumber).onGet(this.getSerial.bind(this));
|
|
24
22
|
this.informationService.getCharacteristic(hap.Characteristic.Model).onGet(this.getModel.bind(this));
|
|
25
|
-
log.info(`Outlet "${name}" created!`);
|
|
26
23
|
}
|
|
27
24
|
/**
|
|
28
25
|
* Handle requests to get the current value of the "Model" characteristic.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platformAccessory.js","sourceRoot":"","sources":["../src/platformAccessory.ts"],"names":[],"mappings":";;;AAIA
|
|
1
|
+
{"version":3,"file":"platformAccessory.js","sourceRoot":"","sources":["../src/platformAccessory.ts"],"names":[],"mappings":";;;AAIA;;;GAGG;AACH,MAAa,sBAAsB;IAUjC,YAAY,QAA+B,EAAE,GAAY,EAAE,IAAY;QAH7D,UAAK,GAAG,gBAAgB,CAAC;QACzB,WAAM,GAAG,gBAAgB,CAAC;QAGlC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAEjB,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;QAElC,sBAAsB;QACtB,IAAI,CAAC,kBAAkB;YACrB,IAAI,GAAG,CAAC,OAAO,CAAC,oBAAoB,EAAE;iBACnC,iBAAiB,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;iBACrD,iBAAiB,CAAC,GAAG,CAAC,cAAc,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QAEjE,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,GAAG,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5G,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACtG,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,sBAAsB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QAEhE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;;OAGG;IACI,QAAQ,CAAC,KAAa;QAC3B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,sBAAsB,KAAK,GAAG,CAAC,CAAC;QAE3D,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED;;;OAGG;IACI,SAAS;QACd,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,wBAAwB,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAEnE,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;;OAGG;IACI,SAAS,CAAC,MAAc;QAC7B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,wBAAwB,MAAM,GAAG,CAAC,CAAC;QAE9D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,WAAW;QACT,OAAO;YACL,IAAI,CAAC,kBAAkB;SACxB,CAAC;IACJ,CAAC;CAEF;AA7ED,wDA6EC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"private": false,
|
|
3
3
|
"displayName": "Solax Cloud API",
|
|
4
4
|
"name": "homebridge-solaxcloud-api",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.3.0",
|
|
6
6
|
"description": "Integrates solar production info using public Solax Cloud API into Homebrigde acessories.",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"repository": {
|