homebridge-solaxcloud-api 1.4.2 → 1.4.6

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.
Files changed (37) hide show
  1. package/README.md +85 -6
  2. package/config.schema.json +1 -1
  3. package/dist/motionAccessory.d.ts +9 -1
  4. package/dist/motionAccessory.d.ts.map +1 -1
  5. package/dist/motionAccessory.js +9 -1
  6. package/dist/motionAccessory.js.map +1 -1
  7. package/dist/outletAccessory.d.ts +10 -1
  8. package/dist/outletAccessory.d.ts.map +1 -1
  9. package/dist/outletAccessory.js +11 -7
  10. package/dist/outletAccessory.js.map +1 -1
  11. package/dist/platform.d.ts +2 -0
  12. package/dist/platform.d.ts.map +1 -1
  13. package/dist/platform.js +95 -35
  14. package/dist/platform.js.map +1 -1
  15. package/dist/platformAccessory.d.ts +31 -2
  16. package/dist/platformAccessory.d.ts.map +1 -1
  17. package/dist/platformAccessory.js +18 -5
  18. package/dist/platformAccessory.js.map +1 -1
  19. package/dist/util.d.ts.map +1 -1
  20. package/images/automation/automation_1.png +0 -0
  21. package/images/automation/automation_10.png +0 -0
  22. package/images/automation/automation_11.png +0 -0
  23. package/images/automation/automation_12.png +0 -0
  24. package/images/automation/automation_13.png +0 -0
  25. package/images/automation/automation_14.png +0 -0
  26. package/images/automation/automation_15.png +0 -0
  27. package/images/automation/automation_16.png +0 -0
  28. package/images/automation/automation_2.png +0 -0
  29. package/images/automation/automation_3.png +0 -0
  30. package/images/automation/automation_4.png +0 -0
  31. package/images/automation/automation_5.png +0 -0
  32. package/images/automation/automation_6.png +0 -0
  33. package/images/automation/automation_7.png +0 -0
  34. package/images/automation/automation_8.png +0 -0
  35. package/images/automation/automation_9.png +0 -0
  36. package/images/homebridge-ui.png +0 -0
  37. package/package.json +1 -1
package/README.md CHANGED
@@ -22,7 +22,7 @@ As HomeKit is still clueless about what a solar panel is, this plugin exposes a
22
22
  - **Grid To House** (outlet with power consumption)
23
23
  - **Update** (Motion sensor)
24
24
 
25
- ![accessories](images/plugin-accessories-home.png)
25
+ <img src="images/plugin-accessories-home.png" width="50%" height="50%">
26
26
 
27
27
  ## Required information
28
28
 
@@ -42,7 +42,7 @@ Edit `config.json` manually to add your Solax inverters. See below for instructi
42
42
 
43
43
  ## Platform configuration
44
44
 
45
- Minimum platform configuration is depicted by the example configuration file below:
45
+ Platform configuration is depicted by the example configuration file below:
46
46
 
47
47
  ```json
48
48
  {
@@ -57,11 +57,21 @@ Minimum platform configuration is depicted by the example configuration file bel
57
57
  ]
58
58
  }
59
59
  ```
60
+ Configuration parameters are described on the table below:
61
+
62
+ | **Parameter** | **Type** | **Description** | **Default** | **Mandatory?** |
63
+ | ------------------ | -------- | --------------- | ----------: | :------------: |
64
+ | `platform` | string | Platform name (must be SolaxCloudAPI) | - | Y |
65
+ | `name` | string | Inverter name, used as prefix for accessory naming | - | Y |
66
+ | `tokenId` | string | Users get information from Solax Cloud through the granted tokenID. Please obtain your tokenID on the API page of Solax Cloud. | - | Y |
67
+ | `sn` | string | Registration No. (inverter module SN) | - | Y |
68
+ | `pollingFrequency` | number | Plugin data polling frequency from Solax Cloud (in seconds) | 300 | N |
69
+
60
70
  **NOTE:** The `pollingFrequency` parameter is optional and defaults to 300 seconds, since Solax inverters update cloud data every 5 minutes.
61
71
 
62
72
  Configuration through the the use of [Homebridge UI](https://github.com/oznu/homebridge-config-ui-x) plugin is also available and recommended:
63
73
 
64
- ![sample](images/homebridge-ui.png)
74
+ <img src="images/homebridge-ui.png" width="100%" height="100%">
65
75
 
66
76
  ## Non-standard characteristics
67
77
 
@@ -69,19 +79,88 @@ Non-standard accessory characteristics are available through the use of [Eve for
69
79
 
70
80
  This will allow some important non-standard characteristics to be visible (like power or total energy consumption), as depicted in the image below:
71
81
 
72
- ![consumption](images/plugin-outlet-consumption.png)
82
+ <img src="images/plugin-outlet-consumption.png" width="50%" height="50%">
73
83
 
74
84
  # Automation
75
85
 
76
86
  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 (according to what is defined on the `pollingFrequency` configuration setting).
77
87
 
78
- ![motion](images/plugin-accessories-eve.png)
88
+ <img src="images/plugin-accessories-eve.png" width="50%" height="50%">
79
89
 
80
90
  Motion is detected by the **Update** motion sensor whenever there is newly fetched data from Solax Cloud. Using this sensor as a trigger combined with power and energy data from the virtual outlets enumerated above forms the basic building blocks for defining an automation.
81
91
 
82
92
  ## Automation example
83
93
 
84
- Since automations are probably going to be dependent on the non-standard characteristic from the virtual outlets, these can be created by using the Eve App. As an automation example...
94
+ Since automations are probably going to be dependent on the non-standard **Consumption** characteristics from the virtual outlets, these must created by using the Eve App.
95
+
96
+ As an automation example, let's imagine we want to turn a pool heater pump on whenever the inverter AC power is greater than a specific figure (in Watt):
97
+
98
+ <table cellspacing="0" cellpadding="0">
99
+ <tr>
100
+ <td width="50%">1. Under Automation, select <b>Rules</b></td>
101
+ <td width="50%">2. Click <b>Next</b></td>
102
+ </tr>
103
+ <tr>
104
+ <td><img src="images/automation/automation_1.png"></td>
105
+ <td><img src="images/automation/automation_2.png"></td>
106
+ </tr>
107
+ <tr>
108
+ <td>3. Click <b>Add Trigger</b></td>
109
+ <td>4. Select <b>Motion</b> as trigger type</td>
110
+ </tr>
111
+ <tr>
112
+ <td><img src="images/automation/automation_3.png"></td>
113
+ <td><img src="images/automation/automation_4.png"></td>
114
+ </tr>
115
+ <tr>
116
+ <td>5. Select the Solax <b>Update</b> motion detector and set <b>Motion</b> as trigger</td>
117
+ <td>6. Click <b>Next</b></td>
118
+ </tr>
119
+ <tr>
120
+ <td><img src="images/automation/automation_5.png"></td>
121
+ <td><img src="images/automation/automation_6.png"></td>
122
+ </tr>
123
+ <tr>
124
+ <td>7. Select <b>Add Value Condition</b></td>
125
+ <td>8. Choose <b>Inverter AC Consumption</b> as characteristic and elect <b>&gt=</b> a desired value</b></td>
126
+ </tr>
127
+ <tr>
128
+ <td><img src="images/automation/automation_7.png"></td>
129
+ <td><img src="images/automation/automation_8.png"></td>
130
+ </tr>
131
+ <tr>
132
+ <td>9. Click <b>Next</b></td>
133
+ <td>10. If no scene exists, click <b>Add Scene</b></td>
134
+ </tr>
135
+ <tr>
136
+ <td><img src="images/automation/automation_9.png"></td>
137
+ <td><img src="images/automation/automation_10.png"></td>
138
+ </tr>
139
+ <tr>
140
+ <td>11. Click <b>Add Actions</b></td>
141
+ <td>12. Select the accessory to be controlled (in this case <b>Garden Pool Outlet</b> will be turned <b>ON</b>)</td>
142
+ </tr>
143
+ <tr>
144
+ <td><img src="images/automation/automation_11.png"></td>
145
+ <td><img src="images/automation/automation_12.png"></td>
146
+ </tr>
147
+ <tr>
148
+ <td>13. Click <b>Next</b></td>
149
+ <td>14. Name your scene and click <b>Done</b></td>
150
+ </tr>
151
+ <tr>
152
+ <td><img src="images/automation/automation_13.png"></td>
153
+ <td><img src="images/automation/automation_14.png"></td>
154
+ </tr>
155
+ <tr>
156
+ <td>15. Click <b>Next</b></td>
157
+ <td>16. Name your rule and click <b>Done</b></td>
158
+ </tr>
159
+ <tr>
160
+ <td><img src="images/automation/automation_15.png"></td>
161
+ <td><img src="images/automation/automation_16.png"></td>
162
+ </tr>
163
+ </table>
85
164
 
86
165
  # TO DO
87
166
 
@@ -43,7 +43,7 @@
43
43
  { "title": "600 (10 minutes)", "enum": [ 600 ] },
44
44
  { "title": "900 (15 minutes)", "enum": [ 900 ] }
45
45
  ],
46
- "description": "Plugin data polling frequency from Solax Cloud in seconds."
46
+ "description": "Plugin data polling frequency from Solax Cloud (in seconds)."
47
47
  }
48
48
  }
49
49
  }
@@ -5,7 +5,7 @@ import { SolaxPlatformAccessory } from './platformAccessory';
5
5
  /**
6
6
  * Solax Motion Accessory.
7
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).
8
+ * Sensor will automatically clear itself after MOTION_TIMEOUT seconds (defaults to 5 seconds).
9
9
  */
10
10
  export declare class SolaxMotionAccessory extends SolaxPlatformAccessory implements AccessoryPlugin {
11
11
  /**
@@ -20,6 +20,14 @@ export declare class SolaxMotionAccessory extends SolaxPlatformAccessory impleme
20
20
  * Interval before clearing motion (in seconds).
21
21
  */
22
22
  private motionTimeout;
23
+ /**
24
+ * Solax virtual motion sensor class constructor.
25
+ * @param {SolaxCloudApiPlatform} platform The API Platform for Solax Cloud.
26
+ * @param {Logging} log The platform logging for homebridge.
27
+ * @param {string} name The accessory name.
28
+ * @param {string} serial "Real-world" serial number for this accessory.
29
+ * @param {string} model Accessory model.
30
+ */
23
31
  constructor(platform: SolaxCloudAPIPlatform, log: Logging, name: string, serial: string, model: string);
24
32
  sleep: typeof import("timers/promises").setTimeout;
25
33
  /**
@@ -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;AAO7D;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,sBAAuB,YAAW,eAAe;IAEzF;;OAEG;IACH,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,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAetG,KAAK,8CAA8B;IAEnC;;;OAGG;IACI,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,GAAG,IAAI;IAM1D;;;OAGG;IACI,QAAQ,CAAC,MAAM,EAAE,OAAO;IAe/B;;;OAGG;IACH,gBAAgB,CAAC,OAAO,EAAE,MAAM;IAIhC;;;OAGG;IACH,gBAAgB,IAAI,MAAM;IAQ1B,WAAW,IAAI,OAAO,EAAE;CAOzB"}
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;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAU;IAExC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAS;IAEvB;;OAEG;IACH,OAAO,CAAC,aAAa,CAA0B;IAE/C;;;;;;;OAOG;gBACS,QAAQ,EAAE,qBAAqB,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAetG,KAAK,8CAA8B;IAEnC;;;OAGG;IACI,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,GAAG,IAAI;IAM1D;;;OAGG;IACI,QAAQ,CAAC,MAAM,EAAE,OAAO;IAe/B;;;OAGG;IACH,gBAAgB,CAAC,OAAO,EAAE,MAAM;IAIhC;;;OAGG;IACH,gBAAgB,IAAI,MAAM;IAQ1B,WAAW,IAAI,OAAO,EAAE;CAOzB"}
@@ -13,9 +13,17 @@ const MOTION_TIMEOUT = 5;
13
13
  /**
14
14
  * Solax Motion Accessory.
15
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).
16
+ * Sensor will automatically clear itself after MOTION_TIMEOUT seconds (defaults to 5 seconds).
17
17
  */
18
18
  class SolaxMotionAccessory extends platformAccessory_1.SolaxPlatformAccessory {
19
+ /**
20
+ * Solax virtual motion sensor class constructor.
21
+ * @param {SolaxCloudApiPlatform} platform The API Platform for Solax Cloud.
22
+ * @param {Logging} log The platform logging for homebridge.
23
+ * @param {string} name The accessory name.
24
+ * @param {string} serial "Real-world" serial number for this accessory.
25
+ * @param {string} model Accessory model.
26
+ */
19
27
  constructor(platform, log, name, serial, model) {
20
28
  super(platform, log, name, serial, model);
21
29
  /**
@@ -1 +1 @@
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;IAiB9D,YAAY,QAA+B,EAAE,GAAY,EAAE,IAAY,EAAE,MAAc,EAAE,KAAa;QACpG,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;QAX5C;;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,IAAI,CAAC,aAAa;aACf,iBAAiB,CAAC,GAAG,CAAC,cAAc,CAAC,cAAc,CAAC;aACpD,EAAE,kBAAmC,IAAI,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,CAAC;IAED;;;OAGG;IACI,QAAQ,CAAC,MAAe;QAC7B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,uBAAuB,MAAM,GAAG,CAAC,CAAC;QAE7D,IAAI,CAAC,aAAa;aACf,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,cAAc,CAAC;aACtE,WAAW,CAAC,MAAM,CAAC,CAAC;QAEvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,4BAA4B;YAC5B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;SACxE;IACH,CAAC;IAED;;;OAGG;IACH,gBAAgB,CAAC,OAAe;QAC9B,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,gBAAgB;QACd,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACH,WAAW;QACT,OAAO;YACL,IAAI,CAAC,kBAAkB;YACvB,IAAI,CAAC,aAAa;SACnB,CAAC;IACJ,CAAC;CAEF;AAlGD,oDAkGC"}
@@ -23,6 +23,14 @@ export declare class SolaxOutletAccessory extends SolaxPlatformAccessory impleme
23
23
  * Elgato Eve fake history service for energy and status.
24
24
  */
25
25
  private readonly loggingService;
26
+ /**
27
+ * Solax virtual outlet class constructor.
28
+ * @param {SolaxCloudApiPlatform} platform The API Platform for Solax Cloud.
29
+ * @param {Logging} log The platform logging for homebridge.
30
+ * @param {string} name The accessory name.
31
+ * @param {string} serial "Real world" serial number for this accessory.
32
+ * @param {string} model Accessory model.
33
+ */
26
34
  constructor(platform: SolaxCloudAPIPlatform, log: Logging, name: string, serial: string, model: string);
27
35
  /**
28
36
  * Sets a characteristic value for a sepecific characteristic.
@@ -44,7 +52,8 @@ export declare class SolaxOutletAccessory extends SolaxPlatformAccessory impleme
44
52
  getTotalEnergyConsumption(callback: CharacteristicGetCallback): void;
45
53
  /**
46
54
  * Sets the total energy consumption.
47
- * @param {number} totalEnergyConsumption The total energy consumption to set. */
55
+ * @param {number} totalEnergyConsumption The total energy consumption to set.
56
+ */
48
57
  setTotalEnergyConsumption(totalEnergyConsumption: number): void;
49
58
  /**
50
59
  * Gets the outlet state Characteristic based on its consumed power.
@@ -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,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAI7D;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,sBAAuB,YAAW,eAAe;IAEzF;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAU;IAExC;;OAEG;IACH,OAAO,CAAC,gBAAgB,CAAK;IAE7B;;OAEG;IACH,OAAO,CAAC,sBAAsB,CAAO;IAErC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAyB;gBAI5C,QAAQ,EAAE,qBAAqB,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAmCtG;;;;OAIG;IACI,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAS7D;;OAEG;IACI,mBAAmB,CAAC,QAAQ,EAAE,yBAAyB,GAAG,IAAI;IAMrE;;wEAEoE;IAC7D,mBAAmB,CAAC,gBAAgB,EAAE,MAAM;IAcnD;;OAE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M;IAQ/D;;;OAGG;IACI,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,GAAG,IAAI;IAU1D,WAAW,IAAI,OAAO,EAAE;CAQzB"}
@@ -8,7 +8,14 @@ const platformAccessory_1 = require("./platformAccessory");
8
8
  * Outlet use is inferred from a positive power comsumption.
9
9
  */
10
10
  class SolaxOutletAccessory extends platformAccessory_1.SolaxPlatformAccessory {
11
- //private services: Service[];
11
+ /**
12
+ * Solax virtual outlet class constructor.
13
+ * @param {SolaxCloudApiPlatform} platform The API Platform for Solax Cloud.
14
+ * @param {Logging} log The platform logging for homebridge.
15
+ * @param {string} name The accessory name.
16
+ * @param {string} serial "Real world" serial number for this accessory.
17
+ * @param {string} model Accessory model.
18
+ */
12
19
  constructor(platform, log, name, serial, model) {
13
20
  super(platform, log, name, serial, model);
14
21
  /**
@@ -33,11 +40,8 @@ class SolaxOutletAccessory extends platformAccessory_1.SolaxPlatformAccessory {
33
40
  // total consumption
34
41
  this.outletService.getCharacteristic(this.platform.eve.Characteristics.TotalConsumption)
35
42
  .on("get" /* GET */, this.getTotalEnergyConsumption.bind(this));
36
- // reset
37
- //this.powerMeterService.addOptionalCharacteristic(this.platform.eve.Characteristics.ResetTotal);
38
43
  // history logging services
39
44
  this.loggingService = new this.platform.eveService('energy', this, { storage: 'fs', log: this.log });
40
- //this.services.push(this.loggingService);
41
45
  log.info(`Outlet "${name}" created!`);
42
46
  }
43
47
  /**
@@ -68,8 +72,7 @@ class SolaxOutletAccessory extends platformAccessory_1.SolaxPlatformAccessory {
68
72
  this.setCharacteristicValue(this.platform.eve.Characteristics.CurrentConsumption, this.powerConsumption);
69
73
  // add entries to history
70
74
  this.loggingService.
71
- addEntry({ time: Math.round(new Date().valueOf() / 1000), power: this.powerConsumption /*, status: this.powerConsumption > 0 */ });
72
- //this.log.debug(JSON.stringify(this.loggingService));
75
+ addEntry({ time: Math.round(new Date().valueOf() / 1000), power: this.powerConsumption });
73
76
  }
74
77
  /**
75
78
  * Gets the total energy consumpion.
@@ -80,7 +83,8 @@ class SolaxOutletAccessory extends platformAccessory_1.SolaxPlatformAccessory {
80
83
  }
81
84
  /**
82
85
  * Sets the total energy consumption.
83
- * @param {number} totalEnergyConsumption The total energy consumption to set. */
86
+ * @param {number} totalEnergyConsumption The total energy consumption to set.
87
+ */
84
88
  setTotalEnergyConsumption(totalEnergyConsumption) {
85
89
  this.log.debug(`${this.name}: SET Total Energy (energy=${totalEnergyConsumption}kWh)`);
86
90
  this.totalEnergyConsumption = totalEnergyConsumption;
@@ -1 +1 @@
1
- {"version":3,"file":"outletAccessory.js","sourceRoot":"","sources":["../src/outletAccessory.ts"],"names":[],"mappings":";;;AAGA,2DAA6D;AAI7D;;;;GAIG;AACH,MAAa,oBAAqB,SAAQ,0CAAsB;IAsB9D,8BAA8B;IAE9B,YAAY,QAA+B,EAAE,GAAY,EAAE,IAAY,EAAE,MAAc,EAAE,KAAa;QACpG,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;QAlB5C;;WAEG;QACK,qBAAgB,GAAG,CAAC,CAAC;QAE7B;;WAEG;QACK,2BAAsB,GAAG,GAAG,CAAC;QAYnC,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;QAElC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,oBAAoB,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QAEjD,6BAA6B;QAC7B,IAAI,CAAC,aAAa,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEtE,sBAAsB;QACtB,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,kBAAmC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAE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AAC,IAAI,sBAAsB,IAAI,CAAC,gBAAgB,IAAI,CAAC,CAAC;QAE5E,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAAC;IAC5C,CAAC;IAED;;;OAGG;IACH,WAAW;QACT,OAAO;YACL,IAAI,CAAC,kBAAkB;YACvB,IAAI,CAAC,aAAa;YAClB,IAAI,CAAC,cAAc;SACpB,CAAC;IACJ,CAAC;CAEF;AA7ID,oDA6IC"}
@@ -39,6 +39,8 @@ export declare class SolaxCloudAPIPlatform implements StaticPlatformPlugin {
39
39
  * Virtual motion sensor triggered by data updates from Solax Cloud.
40
40
  */
41
41
  private motionUpdate;
42
+ /** Array with all accessories */
43
+ private solaxAccessories;
42
44
  /**
43
45
  * Platform constructor.
44
46
  * @param log
@@ -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;AACjD,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AAcxC;;;;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;IAC9B,UAAU,EAAE,QAAQ,CAAC;IAE5B,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,CAA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AY,CAAwB;IAE5C,iCAAiC;IACjC,OAAO,CAAC,gBAAgB,CAAyB;IAEjD;;;;;;OAMG;gBACU,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,GAAG;IA0G3D,KAAK,8CAA8B;IAEnC;;OAEG;YACW,qBAAqB;IAyCnC,WAAW,CAAC,QAAQ,EAAE,CAAC,gBAAgB,EAAE,eAAe,EAAE,KAAK,IAAI,GAAG,IAAI;CAG3E"}
package/dist/platform.js CHANGED
@@ -14,6 +14,18 @@ const motionAccessory_1 = require("./motionAccessory");
14
14
  * Default polling frequency from Solax Cloud (in seconds).
15
15
  */
16
16
  const DEFAULT_POLLING_FREQUENCY = 300;
17
+ /**
18
+ * Max polls / min (obtain frequency need to be lower than 10 times/min).
19
+ */
20
+ const MAX_POLLS_MIN = 10;
21
+ /**
22
+ * Max polls / day (obtain frequency need to be lower than 10,000 times/day).
23
+ */
24
+ const MAX_POLLS_DAY = 10000;
25
+ /**
26
+ * Maximum polling frequency (in seconds).
27
+ */
28
+ const MAX_POLLING_FREQUENCY = Math.max(60 / MAX_POLLS_MIN, (24 * 60 * 60) / MAX_POLLS_DAY);
17
29
  /**
18
30
  * SolaxCloudAPIPlatform.
19
31
  * This class is the main constructor for your plugin, this is where you should
@@ -28,6 +40,8 @@ class SolaxCloudAPIPlatform {
28
40
  * @returns
29
41
  */
30
42
  constructor(log, config, api) {
43
+ /** Array with all accessories */
44
+ this.solaxAccessories = [];
31
45
  this.sleep = util_1.default.promisify(setTimeout);
32
46
  // store values in properties
33
47
  this.log = log;
@@ -37,39 +51,87 @@ class SolaxCloudAPIPlatform {
37
51
  if (!api || !config) {
38
52
  return;
39
53
  }
40
- // setup default polling frequency
41
- this.config.pollingFrequency = this.config.pollingFrequency || DEFAULT_POLLING_FREQUENCY;
42
- this.eve = new homebridge_lib_1.EveHomeKitTypes(this.api);
43
- this.eveService = (0, fakegato_history_1.default)(this.api);
44
54
  this.log.debug(`Config: ${JSON.stringify(config)}`);
45
- // init new Solax Cloud API object with give tokenID and sn
46
- this.solaxCloudAPI = new solaxcloudapi_1.SolaxCloudAPI(this.config.tokenId, this.config.sn);
47
- // initial data set
48
- this.apiData = this.solaxCloudAPI.getAPIData();
49
- this.log.debug(`apiData = ${JSON.stringify(this.apiData)}`);
50
- const inverterSN = this.apiData.result.inverterSN.toLowerCase();
51
- const inverterModel = solaxcloudapi_1.SolaxCloudAPI.getInverterType(this.apiData.result.inverterType);
52
- // setup outlet accessories
53
- this.outletPV =
54
- new outletAccessory_1.SolaxOutletAccessory(this, this.log, `${this.config.name} PV`, `pv-${inverterSN}`, inverterModel);
55
- this.outletInverterAC =
56
- new outletAccessory_1.SolaxOutletAccessory(this, this.log, `${this.config.name} Inverter AC`, `inv-ac-${inverterSN}`, inverterModel);
57
- this.outletInverterToGrid =
58
- new outletAccessory_1.SolaxOutletAccessory(this, this.log, `${this.config.name} Inverter to Grid`, `inv-grid-${inverterSN}`, inverterModel);
59
- this.outletInverterToHouse =
60
- new outletAccessory_1.SolaxOutletAccessory(this, this.log, `${this.config.name} Inverter to House`, `inv-house-${inverterSN}`, inverterModel);
61
- this.outletGridToHouse =
62
- new outletAccessory_1.SolaxOutletAccessory(this, this.log, `${this.config.name} Grid to House`, `grid-house-${inverterSN}`, inverterModel);
63
- // setup update motion sensor
64
- this.motionUpdate =
65
- new motionAccessory_1.SolaxMotionAccessory(this, this.log, `${this.config.name} Update`, `update-${inverterSN}`, inverterModel);
66
- // start data fetching
67
- this.fetchDataPeriodically();
68
- this.log.debug('Finished initializing platform.'),
69
- // When this event is fired it means Homebridge has created all accessories.
70
- this.api.on("didFinishLaunching" /* DID_FINISH_LAUNCHING */, () => {
71
- this.log.debug('Executed didFinishLaunching callback');
72
- });
55
+ // check for mandatory parameters
56
+ if (!this.config.name) {
57
+ this.log.error('Can\'t find mandatory parameter "name" parameter in config file, aborting!');
58
+ return;
59
+ }
60
+ if (!this.config.tokenId) {
61
+ this.log.error('Can\'t find mandatory parameter "tokenId" parameter in config file, aborting!');
62
+ return;
63
+ }
64
+ if (!this.config.sn) {
65
+ this.log.error('Can\'t find mandatory parameter "sn" parameter in config file, aborting!');
66
+ return;
67
+ }
68
+ // setup default polling frequency
69
+ if (this.config.pollingFrequency) {
70
+ if (Number.isInteger(this.config.pollingFrequency) && this.config.pollingFrequency > 0) {
71
+ // all good?
72
+ if (this.config.pollingFrequency < MAX_POLLING_FREQUENCY) {
73
+ this.log.info(`Polling frequency cannot be higher than ${MAX_POLLS_MIN} times/min and ${MAX_POLLS_DAY} ` +
74
+ `times/day, defaulting to ${DEFAULT_POLLING_FREQUENCY} seconds.`);
75
+ this.config.pollingFrequency = DEFAULT_POLLING_FREQUENCY;
76
+ }
77
+ }
78
+ else {
79
+ log.info(`Invalid polling frequency (must be a positive integer number), defaulting to ${DEFAULT_POLLING_FREQUENCY} seconds.`);
80
+ this.config.pollingFrequency = DEFAULT_POLLING_FREQUENCY;
81
+ }
82
+ }
83
+ else {
84
+ log.info(`No polling frequency provided, defaulting to ${DEFAULT_POLLING_FREQUENCY} seconds.`);
85
+ this.config.pollingFrequency = DEFAULT_POLLING_FREQUENCY;
86
+ }
87
+ try {
88
+ this.eve = new homebridge_lib_1.EveHomeKitTypes(this.api);
89
+ this.eveService = (0, fakegato_history_1.default)(this.api);
90
+ // init new Solax Cloud API object with give tokenID and sn
91
+ this.solaxCloudAPI = new solaxcloudapi_1.SolaxCloudAPI(this.config.tokenId, this.config.sn);
92
+ // initial data set
93
+ this.apiData = this.solaxCloudAPI.getAPIData();
94
+ this.log.debug(`apiData = ${JSON.stringify(this.apiData)}`);
95
+ let inverterSN;
96
+ let inverterModel;
97
+ if (this.apiData.success) {
98
+ inverterSN = this.apiData.result.inverterSN.toLowerCase();
99
+ inverterModel = solaxcloudapi_1.SolaxCloudAPI.getInverterType(this.apiData.result.inverterType);
100
+ }
101
+ else {
102
+ this.log.info('Could not retrieve initial values from Solax Cloud, accessory Serial Number and Model properties deferred...');
103
+ inverterSN = this.config.name;
104
+ inverterModel = 'Unknown';
105
+ }
106
+ // setup outlet accessories
107
+ this.outletPV =
108
+ new outletAccessory_1.SolaxOutletAccessory(this, this.log, `${this.config.name} PV`, `pv-${inverterSN}`, inverterModel);
109
+ this.outletInverterAC =
110
+ new outletAccessory_1.SolaxOutletAccessory(this, this.log, `${this.config.name} Inverter AC`, `inv-ac-${inverterSN}`, inverterModel);
111
+ this.outletInverterToGrid =
112
+ new outletAccessory_1.SolaxOutletAccessory(this, this.log, `${this.config.name} Inverter to Grid`, `inv-grid-${inverterSN}`, inverterModel);
113
+ this.outletInverterToHouse =
114
+ new outletAccessory_1.SolaxOutletAccessory(this, this.log, `${this.config.name} Inverter to House`, `inv-house-${inverterSN}`, inverterModel);
115
+ this.outletGridToHouse =
116
+ new outletAccessory_1.SolaxOutletAccessory(this, this.log, `${this.config.name} Grid to House`, `grid-house-${inverterSN}`, inverterModel);
117
+ // setup update motion sensor
118
+ this.motionUpdate =
119
+ new motionAccessory_1.SolaxMotionAccessory(this, this.log, `${this.config.name} Update`, `update-${inverterSN}`, inverterModel);
120
+ // create array with all accessories
121
+ this.solaxAccessories =
122
+ [this.outletPV, this.outletInverterAC, this.outletInverterToGrid,
123
+ this.outletInverterToHouse, this.outletGridToHouse, this.motionUpdate];
124
+ // start data fetching
125
+ this.fetchDataPeriodically();
126
+ this.log.debug('Finished initializing platform.');
127
+ }
128
+ catch (error) {
129
+ this.log.error(`Unexpected error: ${error}`);
130
+ }
131
+ // When this event is fired it means Homebridge has created all accessories.
132
+ this.api.on("didFinishLaunching" /* DID_FINISH_LAUNCHING */, () => {
133
+ this.log.debug('Executed didFinishLaunching callback');
134
+ });
73
135
  }
74
136
  /**
75
137
  * Periodically retrieves inverter data from Solax Cloud API using configured tokenID and SN.
@@ -109,9 +171,7 @@ class SolaxCloudAPIPlatform {
109
171
  * The Platform must respond in a timely manner as otherwise the startup of the bridge would be unnecessarily delayed.
110
172
  */
111
173
  accessories(callback) {
112
- callback([this.outletPV, this.outletInverterAC,
113
- this.outletInverterToGrid, this.outletInverterToHouse, this.outletGridToHouse,
114
- this.motionUpdate]);
174
+ callback(this.solaxAccessories);
115
175
  }
116
176
  }
117
177
  exports.SolaxCloudAPIPlatform = SolaxCloudAPIPlatform;
@@ -1 +1 @@
1
- {"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";;;;;;AAEA,mDAAiD;AACjD,wEAAwC;AAExC,uDAAyD;AAEzD,gDAAwB;AAExB,mDAAuE;AACvE,uDAAyD;AAEzD;;GAEG;AACH,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAEtC;;;;GAIG;AACH,MAAa,qBAAqB;IAyChC;;;;;;OAMG;IACH,YAAa,GAAY,EAAE,MAAsB,EAAE,GAAQ;QAyD3D,UAAK,GAAG,cAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAxDjC,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,IAAI,CAAC,GAAG,CAAC,CAAC;QACzC,IAAI,CAAC,UAAU,GAAG,IAAA,0BAAQ,EAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAErC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAEpD,2DAA2D;QAC3D,IAAI,CAAC,aAAa,GAAG,IAAI,6BAAa,CAAC,IAAI,CAAC,MAAM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QAAQ,CAAC,IAAI,CAAC,CAAC;aAClC;iBAAM;gBACL,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;aACzC;SACF;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,+CAA+C,KAAK,EAAE,CAAC,CAAC;SACxE;gBAAS;YACR,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,mDAAmD,IAAI,CAAC,MAAM,CAAC,gBAAgB,WAAW,CAAC,CAAC;YAE1G,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,GAAG,IAAI,CAAC;iBAC5C,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,MAAM,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC;SACzD;IACH,CAAC;IAED;;;;OAIG;IACH,WAAW,CAAC,QAAuD;QACjE,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAClC,CAAC;CACF;AA9MD,sDA8MC"}
@@ -1,17 +1,46 @@
1
1
  import { Service, AccessoryPlugin, Logging } from 'homebridge';
2
2
  import { SolaxCloudAPIPlatform } from './platform';
3
3
  /**
4
- * Platform Accessory.
5
- * Generic platform accessory to store accessory name, manufacturer (Solax), inverter model and serial number.
4
+ * Solax Cloud generic platform accessory.
5
+ * Handles basic info: accessory name, manufacturer (Solax), inverter model and serial number.
6
6
  */
7
7
  export declare class SolaxPlatformAccessory implements AccessoryPlugin {
8
+ /**
9
+ * Accessory platform.
10
+ */
8
11
  protected readonly platform: SolaxCloudAPIPlatform;
12
+ /**
13
+ * Accessory logging.
14
+ */
9
15
  protected readonly log: Logging;
16
+ /**
17
+ * Accessory name.
18
+ */
10
19
  protected readonly name: string;
20
+ /**
21
+ * Acessory display name.
22
+ */
11
23
  protected readonly displayName: string;
24
+ /**
25
+ * Accessory serial number (string from 64 bit hash)
26
+ */
12
27
  protected serialNumber: string;
28
+ /**
29
+ * Accessory model.
30
+ */
13
31
  protected model: string;
32
+ /**
33
+ * Accessory HomeKit information service.
34
+ */
14
35
  protected readonly informationService: Service;
36
+ /**
37
+ * Virtual accessory main class constructor.
38
+ * @param {SolaxCloudApiPlatform} platform The API Platform for Solax Cloud.
39
+ * @param {Logging} log The platform logging for homebridge.
40
+ * @param {string} name The accessory name.
41
+ * @param {string} serial "Real-world" serial number for this accessory.
42
+ * @param {string} model Accessory model.
43
+ */
15
44
  constructor(platform: SolaxCloudAPIPlatform, log: Logging, name: string, serialNumber: string, model: string);
16
45
  /**
17
46
  * Handle requests to get the current value of the "Model" characteristic.
@@ -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;AAI/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AASnD;;;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;IAChC,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAEvC,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC;IAC/B,SAAS,CAAC,KAAK,SAAoB;IAEnC,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;gBAEnC,QAAQ,EAAE,qBAAqB,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IA2B5G;;;OAGG;IACI,QAAQ,IAAI,MAAM;IAMzB;;;OAGG;IACI,QAAQ,CAAC,KAAK,EAAE,MAAM;IAQ7B;;;OAGG;IACI,SAAS,IAAI,MAAM;IAM1B;;;OAGG;IACI,SAAS,CAAC,MAAM,EAAE,MAAM;IAW/B,WAAW,IAAI,OAAO,EAAE;CAMzB"}
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;AASnD;;;GAGG;AACH,qBAAa,sBAAuB,YAAW,eAAe;IAC5D;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IAEnD;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IAEhC;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAEvC;;OAEG;IACH,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,SAAS,CAAC,KAAK,SAAoB;IAEnC;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;IAE/C;;;;;;;OAOG;gBACS,QAAQ,EAAE,qBAAqB,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IA+B5G;;;OAGG;IACI,QAAQ,IAAI,MAAM;IAMzB;;;OAGG;IACI,QAAQ,CAAC,KAAK,EAAE,MAAM;IAQ7B;;;OAGG;IACI,SAAS,IAAI,MAAM;IAM1B;;;OAGG;IACI,SAAS,CAAC,MAAM,EAAE,MAAM;IAW/B,WAAW,IAAI,OAAO,EAAE;CAMzB"}
@@ -4,27 +4,40 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.SolaxPlatformAccessory = void 0;
7
- const os_1 = __importDefault(require("os"));
8
7
  const util_1 = require("./util");
8
+ const os_1 = __importDefault(require("os"));
9
9
  const string_hash_64_1 = __importDefault(require("string-hash-64"));
10
10
  // eslint-disable-next-line @typescript-eslint/no-var-requires
11
11
  const plugin = require('../package.json');
12
12
  /**
13
- * Platform Accessory.
14
- * Generic platform accessory to store accessory name, manufacturer (Solax), inverter model and serial number.
13
+ * Solax Cloud generic platform accessory.
14
+ * Handles basic info: accessory name, manufacturer (Solax), inverter model and serial number.
15
15
  */
16
16
  class SolaxPlatformAccessory {
17
+ /**
18
+ * Virtual accessory main class constructor.
19
+ * @param {SolaxCloudApiPlatform} platform The API Platform for Solax Cloud.
20
+ * @param {Logging} log The platform logging for homebridge.
21
+ * @param {string} name The accessory name.
22
+ * @param {string} serial "Real-world" serial number for this accessory.
23
+ * @param {string} model Accessory model.
24
+ */
17
25
  constructor(platform, log, name, serialNumber, model) {
26
+ /**
27
+ * Accessory model.
28
+ */
18
29
  this.model = 'Solax inverter';
19
30
  this.platform = platform;
20
31
  this.log = log;
32
+ // name
21
33
  this.name = name;
34
+ // display name
22
35
  this.displayName = name;
23
- // hash "true" serial and hostname to 32 bit hex
36
+ // hash "real-world" serial and hostname to 64 bit hex string
24
37
  this.serialNumber = (0, string_hash_64_1.default)(`${serialNumber}-${os_1.default.hostname()}`).toString(16);
38
+ // remove non-standard chars from model name
25
39
  this.model = util_1.Util.normalizeName(model);
26
40
  const hap = this.platform.api.hap;
27
- //this.uuid = hap.uuid.generate(this.serialNumber);
28
41
  // information service
29
42
  this.informationService =
30
43
  new hap.Service.AccessoryInformation()
@@ -1 +1 @@
1
- {"version":3,"file":"platformAccessory.js","sourceRoot":"","sources":["../src/platformAccessory.ts"],"names":[],"mappings":";;;;;;AAEA,4CAAoB;AAIpB,iCAA8B;AAE9B,oEAAkC;AAElC,8DAA8D;A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AAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,wBAAwB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QAEzE,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,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,YAAY,GAAG,MAAM,CAAC;QAC3B,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IACvG,CAAC;IAED;;;OAGG;IACH,WAAW;QACT,OAAO;YACL,IAAI,CAAC,kBAAkB;SACxB,CAAC;IACJ,CAAC;CAEF;AAhID,wDAgIC"}
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,qBAAa,IAAI;IAEf;;;;OAIG;WACW,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAiBvC;;;;OAIG;WACW,aAAa,CAAC,CAAC,EAAE,MAAM;CAItC"}
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,qBAAa,IAAI;IAEf;;;;OAIG;WACW,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAiBvC;;;;OAIG;WACW,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;CAI/C"}
Binary file
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "private": false,
3
3
  "displayName": "Homebridge Solax Cloud API",
4
4
  "name": "homebridge-solaxcloud-api",
5
- "version": "1.4.2",
5
+ "version": "1.4.6",
6
6
  "description": "Integrates solar production info using public Solax Cloud API into Homebrigde acessories.",
7
7
  "license": "Apache-2.0",
8
8
  "repository": {