homebridge-solaxcloud-api 2.1.2 → 2.1.4-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,187 +1,192 @@
1
-
2
- <table cellspacing="0" cellpadding="0">
3
- <tr>
4
- <td align="center"><img src="https://github.com/homebridge/branding/raw/master/logos/homebridge-wordmark-logo-vertical.png" width="150"></td>
5
- <td align="center"><img src="https://www.solaxpower.com/wp-content/uploads/2020/03/weblogo5.png" width="300"></td>
6
- <tr>
7
- </table>
8
-
9
- # Solax Cloud Plugin for Homebridge
10
-
11
- ![npm](https://badgen.net/npm/v/homebridge-solaxcloud-api) ![npm](https://badgen.net/npm/dt/homebridge-solaxcloud-api) [![verified-by-homebridge](https://badgen.net/badge/homebridge/verified/purple)](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
12
-
13
-
14
- The Solax Cloud Plugin for [Homebridge](https://homebridge.io/) was created as a platform plugin to gather data exposed by Solax inverters to the cloud through the [Solax Cloud API](https://www.eu.solaxcloud.com/phoebus/resource/files/userGuide/Solax_API_for_End-user_V1.0.pdf).
15
-
16
- Now with **support for multiple inverters**!
17
-
18
- As HomeKit is still clueless about what a solar panel is, this plugin exposes a set of standard HomeKit accessories though Homebridge for each configured inverter that will allow interacting and automating your smart home based on the data made available from the Solax platform:
19
-
20
- - **PV** (PV outlet with power consumption)
21
- - **AC** (Inverter AC outlet with power and total energy consumptions)
22
- - **To Grid** (Inverter to Grid outlet with power consumption)
23
- - **To House** (Inverter to House outlet with power consumption)
24
- - **From Grid** (Grid to House outlet with power consumption)
25
- - **Update** (Motion sensor)
26
-
27
- <img src="images/plugin-accessories-home.png" width="50%" height="50%">
28
-
29
- Please note that additional accessories are created by default with smooth power consumption curves (by applying either a simple or exponential moving average to the power series). This prevents sporadic events like a cloud passing by to have an immediate affect on provided meters.
30
-
31
- ## Required information
32
-
33
- For this plugin to work, two critical pieces of information are required from Solax Cloud:
34
-
35
- - **Token ID**: Solax users can get inverter information through the granted tokenID. You need to obtain your tokenID on the API page of Solaxcloud.
36
- - **SN**: Registration No (communication module SN) for each desired inverter.
37
-
38
- ## Installation
39
-
40
- This plugin is supported under Homebridge. It is highly recommended that you use Homebridge Config UI X to install and configure this plugin.
41
-
42
- ### Manual Installation
43
-
44
- Install this plugin using: `sudo npm install -g homebridge-solaxcloud-api`.
45
- Edit `config.json` manually to add your Solax inverters. See below for instructions on that.
46
-
47
- ## Platform configuration
48
-
49
- Minimal platform configuration is depicted by the example configuration file below:
50
-
51
- ```json
52
- {
53
- "platforms": [
54
- {
55
- "platform": "SolaxCloudAPI",
56
- "tokenId": "20200722185111234567890",
57
- "inverters": [
58
- {
59
- "name": "Solax",
60
- "sn": "ABCDEFGHIJ"
61
- }
62
- ],
63
- }
64
- ]
65
- }
66
- ```
67
- Configuration parameters are described on the table below:
68
-
69
- | **Parameter** | **Type** | **Description** | **Default** | **Mandatory?** |
70
- | ------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------- | -------------:| :------------: |
71
- | `platform` | string | Platform name (must be SolaxCloudAPI) | - | Y |
72
- | `tokenId` | string | Users get information from Solax Cloud through the granted tokenID. Please obtain your tokenID on the API page of Solax Cloud | - | Y |
73
- | `inverters` | array | Array of configured inverters as objects with `{ name: string, sn: string }`, where `name` is the inverter name, used as prefix for accessory naming and `sn` is the inverter registration no. (inverter module SN). | - | Y |
74
- | `pollingFrequency` | number | Plugin data polling frequency from Solax Cloud (in seconds) | 300 | N |
75
- | `smoothingMeters` | boolean | Whether to create additional meters by smoothing raw values from Solax Cloud | true | N |
76
- | `smoothingMethod` | string | Statistical method to use for smoothing raw values from Solax Cloud (simple or exponential moving average - "sma" or "ema") | "sma" | N |
77
- | `pureHomeApp` | boolean | Whether to create meters as standard accessories that can be used on the Home App (power will show as ambient light sensors) | false | N |
78
-
79
- **NOTE:** The `pollingFrequency` parameter defaults to 300 seconds, since Solax inverters update cloud data every 5 minutes.
80
-
81
- Configuration through the the use of [Homebridge UI](https://github.com/oznu/homebridge-config-ui-x) plugin is also available and recommended:
82
-
83
- <img src="images/homebridge-ui.png" width="100%" height="100%">
84
-
85
- ## Non-standard characteristics
86
-
87
- Non-standard accessory characteristics are available through the use of [Eve for HomeKit app](https://apps.apple.com/us/app/eve-for-homekit/id917695792) you may download from the App Store.
88
-
89
- This will allow some non-standard characteristics to be visible along with its historical data (like power or total energy consumption), as depicted in the image below:
90
-
91
- <img src="images/plugin-outlet-consumption.png" width="50%" height="50%">
92
-
93
- If you want to rely solely on the native Home App, please enable the `pureHomeApp` config setting. In this case, power consumption on each meter will be exposed as an Ambient Light Sensor, as shown below (minimum value for an Ambient Light Sensor is 0.1 lux):
94
-
95
- <img src="images/plugin-accessories-home-pure.png" width="50%" height="50%">
96
-
97
- # Automation
98
-
99
- Automation can be achieved with the help of the virtual **Update** motion sensor that was specifically tailored for this effect and which is available for each inverter. This motion sensor will be triggered whenever inverter data gets updated from the Solax Cloud API (according to what is defined on the `pollingFrequency` configuration setting).
100
-
101
- <img src="images/plugin-accessories-eve.png" width="50%" height="50%">
102
-
103
- Motion is detected by the **Update** motion sensor whenever there is newly fetched inverter 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.
104
-
105
- ## Automation example
106
-
107
- 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.
108
-
109
- 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):
110
-
111
- <table cellspacing="0" cellpadding="0">
112
- <tr>
113
- <td width="50%">1. Under Automation, select <b>Rules</b></td>
114
- <td width="50%">2. Click <b>Next</b></td>
115
- </tr>
116
- <tr>
117
- <td><img src="images/automation/automation_1.png"></td>
118
- <td><img src="images/automation/automation_2.png"></td>
119
- </tr>
120
- <tr>
121
- <td>3. Click <b>Add Trigger</b></td>
122
- <td>4. Select <b>Motion</b> as trigger type</td>
123
- </tr>
124
- <tr>
125
- <td><img src="images/automation/automation_3.png"></td>
126
- <td><img src="images/automation/automation_4.png"></td>
127
- </tr>
128
- <tr>
129
- <td>5. Select the Solax <b>Update</b> motion detector and set <b>Motion</b> as trigger</td>
130
- <td>6. Click <b>Next</b></td>
131
- </tr>
132
- <tr>
133
- <td><img src="images/automation/automation_5.png"></td>
134
- <td><img src="images/automation/automation_6.png"></td>
135
- </tr>
136
- <tr>
137
- <td>7. Select <b>Add Value Condition</b></td>
138
- <td>8. Choose <b>Inverter AC Consumption</b> as characteristic and elect <b>&gt=</b> a desired value</b></td>
139
- </tr>
140
- <tr>
141
- <td><img src="images/automation/automation_7.png"></td>
142
- <td><img src="images/automation/automation_8.png"></td>
143
- </tr>
144
- <tr>
145
- <td>9. Click <b>Next</b></td>
146
- <td>10. If no scene exists, click <b>Add Scene</b></td>
147
- </tr>
148
- <tr>
149
- <td><img src="images/automation/automation_9.png"></td>
150
- <td><img src="images/automation/automation_10.png"></td>
151
- </tr>
152
- <tr>
153
- <td>11. Click <b>Add Actions</b></td>
154
- <td>12. Select the accessory to be controlled (in this case <b>Garden Pool Outlet</b> will be turned <b>ON</b>)</td>
155
- </tr>
156
- <tr>
157
- <td><img src="images/automation/automation_11.png"></td>
158
- <td><img src="images/automation/automation_12.png"></td>
159
- </tr>
160
- <tr>
161
- <td>13. Click <b>Next</b></td>
162
- <td>14. Name your scene and click <b>Done</b></td>
163
- </tr>
164
- <tr>
165
- <td><img src="images/automation/automation_13.png"></td>
166
- <td><img src="images/automation/automation_14.png"></td>
167
- </tr>
168
- <tr>
169
- <td>15. Click <b>Next</b></td>
170
- <td>16. Name your rule and click <b>Done</b></td>
171
- </tr>
172
- <tr>
173
- <td><img src="images/automation/automation_15.png"></td>
174
- <td><img src="images/automation/automation_16.png"></td>
175
- </tr>
176
- </table>
177
-
178
- # TO DO
179
-
180
- Next planned plugin releases should include:
181
-
182
- - [X] **Inverter AC** to include Yield Energy
183
- - [X] Consumption history through the [fakegato-history](https://github.com/simont77/fakegato-history) module
184
- - [x] Enable support for "pure" Home App accessories (power meters will be exposed as Ambient Light sensors)
185
- - [x] Add "smooth" accessories for power meters (compensating for sporadic scenarios like cloud a passing)
186
- - [x] Support for multiple inverters
187
- - [ ] Accessories for battery state and consumptions (work in progress)
1
+
2
+ <table cellspacing="0" cellpadding="0">
3
+ <tr>
4
+ <td align="center"><img src="https://github.com/homebridge/branding/raw/master/logos/homebridge-wordmark-logo-vertical.png" width="150"></td>
5
+ <td align="center"><img src="https://www.solaxpower.com/wp-content/uploads/2020/03/weblogo5.png" width="300"></td>
6
+ <tr>
7
+ </table>
8
+
9
+ # Solax Cloud Plugin for Homebridge
10
+
11
+ ![npm](https://badgen.net/npm/v/homebridge-solaxcloud-api) ![npm](https://badgen.net/npm/dt/homebridge-solaxcloud-api) [![verified-by-homebridge](https://badgen.net/badge/homebridge/verified/purple)](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
12
+
13
+
14
+ The Solax Cloud Plugin for [Homebridge](https://homebridge.io/) was created as a platform plugin to gather data exposed by Solax inverters to the cloud through the [Solax Cloud API](https://www.solaxcloud.com/phoebus/resource/files/userGuide/Solax_API.pdf).
15
+
16
+ Now with **support for multiple inverters**! Sensors will be created for each of the inverters present in the configuration. Additionally, a virtual inverter named "All inverters" will be created whenever a multiple inverters configuration is present. This inverter will present summarized power and consumption figures derived from data for all the physical inverters.
17
+
18
+ As HomeKit is still clueless about what a solar panel is, this plugin exposes a set of standard HomeKit accessories though Homebridge for each configured inverter that will allow interacting and automating your smart home based on the data made available from the Solax platform:
19
+
20
+ - **PV** (PV outlet with power consumption)
21
+ - **AC** (Inverter AC outlet with power and total energy consumptions)
22
+ - **To Grid** (Inverter to Grid outlet with power consumption)
23
+ - **To House** (Inverter to House outlet with power consumption)
24
+ - **From Grid** (Grid to House outlet with power consumption)
25
+ - **Update** (Motion sensor)
26
+
27
+ Battery information is also provided as Homekit accessories in case there are any batteries installed for any of the configured inverters:
28
+
29
+ - **To Battery** (Inverter power charging the battery)
30
+ - **From Battery** (Power drawn from the battery to the inverter)
31
+
32
+ <img src="images/plugin-accessories-home.png" width="50%" height="50%">
33
+
34
+ Please note that additional accessories are created by default with smooth power consumption curves (by applying either a simple or exponential moving average to the power series). This prevents sporadic events like a cloud passing by to have an immediate affect on provided meters.
35
+
36
+ ## Required information
37
+
38
+ For this plugin to work, two critical pieces of information are required from Solax Cloud:
39
+
40
+ - **Token ID**: Solax users can get inverter information through the granted tokenID. You need to obtain your tokenID on the API page of Solaxcloud.
41
+ - **SN**: Registration No (communication module SN) for each desired inverter.
42
+
43
+ ## Installation
44
+
45
+ This plugin is supported under Homebridge. It is highly recommended that you use Homebridge Config UI X to install and configure this plugin.
46
+
47
+ ### Manual Installation
48
+
49
+ Install this plugin using: `sudo npm install -g homebridge-solaxcloud-api`.
50
+ Edit `config.json` manually to add your Solax inverters. See below for instructions on that.
51
+
52
+ ## Platform configuration
53
+
54
+ Minimal platform configuration is depicted by the example configuration file below:
55
+
56
+ ```json
57
+ {
58
+ "platforms": [
59
+ {
60
+ "platform": "SolaxCloudAPI",
61
+ "tokenId": "20200722185111234567890",
62
+ "inverters": [
63
+ {
64
+ "name": "Solax",
65
+ "sn": "ABCDEFGHIJ"
66
+ }
67
+ ],
68
+ }
69
+ ]
70
+ }
71
+ ```
72
+ Configuration parameters are described on the table below:
73
+
74
+ | **Parameter** | **Type** | **Description** | **Default** | **Mandatory?** |
75
+ | ------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------- | -------------:| :------------: |
76
+ | `platform` | string | Platform name (must be SolaxCloudAPI) | - | Y |
77
+ | `tokenId` | string | Users get information from Solax Cloud through the granted tokenID. Please obtain your tokenID on the API page of Solax Cloud | - | Y |
78
+ | `inverters` | array | Array of configured inverters as objects with `{ name: string, sn: string }`, where `name` is the inverter name, used as prefix for accessory naming and `sn` is the inverter registration no. (inverter module SN). | - | Y |
79
+ | `pollingFrequency` | number | Plugin data polling frequency from Solax Cloud (in seconds) | 300 | N |
80
+ | `smoothingMeters` | boolean | Whether to create additional meters by smoothing raw values from Solax Cloud | true | N |
81
+ | `smoothingMethod` | string | Statistical method to use for smoothing raw values from Solax Cloud (simple or exponential moving average - "sma" or "ema") | "sma" | N |
82
+ | `pureHomeApp` | boolean | Whether to create meters as standard accessories that can be used on the Home App (power will show as ambient light sensors) | false | N |
83
+
84
+ **NOTE:** The `pollingFrequency` parameter defaults to 300 seconds, since Solax inverters update cloud data every 5 minutes.
85
+
86
+ Configuration through the the use of [Homebridge UI](https://github.com/oznu/homebridge-config-ui-x) plugin is also available and recommended:
87
+
88
+ <img src="images/homebridge-ui.png" width="100%" height="100%">
89
+
90
+ ## Non-standard characteristics
91
+
92
+ Non-standard accessory characteristics are available through the use of [Eve for HomeKit app](https://apps.apple.com/us/app/eve-for-homekit/id917695792) you may download from the App Store.
93
+
94
+ This will allow some non-standard characteristics to be visible along with its historical data (like power or total energy consumption), as depicted in the image below:
95
+
96
+ <img src="images/plugin-outlet-consumption.png" width="50%" height="50%">
97
+
98
+ If you want to rely solely on the native Home App, please enable the `pureHomeApp` config setting. In this case, power consumption on each meter will be exposed as an Ambient Light Sensor, as shown below (minimum value for an Ambient Light Sensor is 0.1 lux):
99
+
100
+ <img src="images/plugin-accessories-home-pure.png" width="50%" height="50%">
101
+
102
+ # Automation
103
+
104
+ Automation can be achieved with the help of the virtual **Update** motion sensor that was specifically tailored for this effect and which is available for each inverter. This motion sensor will be triggered whenever inverter data gets updated from the Solax Cloud API (according to what is defined on the `pollingFrequency` configuration setting).
105
+
106
+ <img src="images/plugin-accessories-eve.png" width="50%" height="50%">
107
+
108
+ Motion is detected by the **Update** motion sensor whenever there is newly fetched inverter 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.
109
+
110
+ ## Automation example
111
+
112
+ 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.
113
+
114
+ 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):
115
+
116
+ <table cellspacing="0" cellpadding="0">
117
+ <tr>
118
+ <td width="50%">1. Under Automation, select <b>Rules</b></td>
119
+ <td width="50%">2. Click <b>Next</b></td>
120
+ </tr>
121
+ <tr>
122
+ <td><img src="images/automation/automation_1.png"></td>
123
+ <td><img src="images/automation/automation_2.png"></td>
124
+ </tr>
125
+ <tr>
126
+ <td>3. Click <b>Add Trigger</b></td>
127
+ <td>4. Select <b>Motion</b> as trigger type</td>
128
+ </tr>
129
+ <tr>
130
+ <td><img src="images/automation/automation_3.png"></td>
131
+ <td><img src="images/automation/automation_4.png"></td>
132
+ </tr>
133
+ <tr>
134
+ <td>5. Select the Solax <b>Update</b> motion detector and set <b>Motion</b> as trigger</td>
135
+ <td>6. Click <b>Next</b></td>
136
+ </tr>
137
+ <tr>
138
+ <td><img src="images/automation/automation_5.png"></td>
139
+ <td><img src="images/automation/automation_6.png"></td>
140
+ </tr>
141
+ <tr>
142
+ <td>7. Select <b>Add Value Condition</b></td>
143
+ <td>8. Choose <b>Inverter AC Consumption</b> as characteristic and elect <b>&gt=</b> a desired value</b></td>
144
+ </tr>
145
+ <tr>
146
+ <td><img src="images/automation/automation_7.png"></td>
147
+ <td><img src="images/automation/automation_8.png"></td>
148
+ </tr>
149
+ <tr>
150
+ <td>9. Click <b>Next</b></td>
151
+ <td>10. If no scene exists, click <b>Add Scene</b></td>
152
+ </tr>
153
+ <tr>
154
+ <td><img src="images/automation/automation_9.png"></td>
155
+ <td><img src="images/automation/automation_10.png"></td>
156
+ </tr>
157
+ <tr>
158
+ <td>11. Click <b>Add Actions</b></td>
159
+ <td>12. Select the accessory to be controlled (in this case <b>Garden Pool Outlet</b> will be turned <b>ON</b>)</td>
160
+ </tr>
161
+ <tr>
162
+ <td><img src="images/automation/automation_11.png"></td>
163
+ <td><img src="images/automation/automation_12.png"></td>
164
+ </tr>
165
+ <tr>
166
+ <td>13. Click <b>Next</b></td>
167
+ <td>14. Name your scene and click <b>Done</b></td>
168
+ </tr>
169
+ <tr>
170
+ <td><img src="images/automation/automation_13.png"></td>
171
+ <td><img src="images/automation/automation_14.png"></td>
172
+ </tr>
173
+ <tr>
174
+ <td>15. Click <b>Next</b></td>
175
+ <td>16. Name your rule and click <b>Done</b></td>
176
+ </tr>
177
+ <tr>
178
+ <td><img src="images/automation/automation_15.png"></td>
179
+ <td><img src="images/automation/automation_16.png"></td>
180
+ </tr>
181
+ </table>
182
+
183
+ # TO DO
184
+
185
+ Next planned plugin releases should include:
186
+
187
+ - [X] **Inverter AC** to include Total Yield Energy
188
+ - [X] Consumption history through the [fakegato-history](https://github.com/simont77/fakegato-history) module
189
+ - [x] Enable support for "pure" Home App accessories (power meters will be exposed as Ambient Light sensors)
190
+ - [x] Add "smooth" accessories for power meters (compensating for sporadic scenarios like cloud a passing)
191
+ - [x] Support for multiple inverters
192
+ - [ ] Accessories for battery state and consumptions (work in progress)
@@ -39,6 +39,13 @@
39
39
  "default": "ABCDEFGHIJ",
40
40
  "minLength": 10,
41
41
  "maxLength": 10
42
+ },
43
+ "hasBattery": {
44
+ "title": "Battery installed?",
45
+ "type": "boolean",
46
+ "required": false,
47
+ "description": "Whether this inverter has a battery installed.",
48
+ "default": false
42
49
  }
43
50
  }
44
51
  }
@@ -17,6 +17,10 @@ export declare class SolaxCloudAPIPlatform implements StaticPlatformPlugin {
17
17
  * Array of inverters.
18
18
  */
19
19
  private inverters;
20
+ /**
21
+ * Inverter totalizer.
22
+ **/
23
+ private allInverters;
20
24
  /**
21
25
  * Platform constructor.
22
26
  * @param log
@@ -32,6 +36,10 @@ export declare class SolaxCloudAPIPlatform implements StaticPlatformPlugin {
32
36
  * @returns Whether object implements interface InverterConfig.
33
37
  */
34
38
  private static isInverterConfig;
39
+ /**
40
+ * Update data for virtual inverter totalizer based on individual inverter data.
41
+ */
42
+ private updateAllInvertersData;
35
43
  /**
36
44
  * Periodically retrieves inverter data from Solax Cloud API using configured tokenID and SN.
37
45
  */
@@ -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;AA6C3G;;;;GAIG;AACH,qBAAa,qBAAsB,YAAW,oBAAoB;IAChE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAU;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;IAE1B;;OAEG;IACH,OAAO,CAAC,eAAe,CAAK;IAE5B;;OAEG;IACH,OAAO,CAAC,SAAS,CAAuC;IAExD;;;;;;OAMG;gBACU,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,GAAG;IA6C3D,KAAK,8CAA8B;IAEnC;;;;OAIG;IAEH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAI/B;;OAEG;YACW,qBAAqB;IASnC;;;OAGG;IACH,OAAO,CAAC,WAAW;IAqInB,WAAW,CAAC,QAAQ,EAAE,CAAC,gBAAgB,EAAE,eAAe,EAAE,KAAK,IAAI,GAAG,IAAI;CAQ3E"}
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;AA6C3G;;;;GAIG;AACH,qBAAa,qBAAsB,YAAW,oBAAoB;IAChE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAU;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;IAE1B;;OAEG;IACH,OAAO,CAAC,eAAe,CAAK;IAE5B;;OAEG;IACH,OAAO,CAAC,SAAS,CAAuC;IAExD;;QAEI;IACJ,OAAO,CAAC,YAAY,CAAiC;IAErD;;;;;;OAMG;gBACU,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,GAAG;IAuD3D,KAAK,8CAA8B;IAEnC;;;;OAIG;IAEH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAI/B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAsB9B;;OAEG;YACW,qBAAqB;IAgBnC;;;OAGG;IACH,OAAO,CAAC,WAAW;IAqInB,WAAW,CAAC,QAAQ,EAAE,CAAC,gBAAgB,EAAE,eAAe,EAAE,KAAK,IAAI,GAAG,IAAI;CAa3E"}
package/dist/platform.js CHANGED
@@ -73,10 +73,14 @@ class SolaxCloudAPIPlatform {
73
73
  // loop over configured inverters
74
74
  this.config.inverters.forEach(inverter => {
75
75
  // setup new inverter
76
- const platformInverter = new platformInverter_1.SolaxCloudAPIPlatformInverter(log, config, api, this.config.tokenId, inverter.sn, inverter.name, this.smoothingWindow);
76
+ const platformInverter = new platformInverter_1.SolaxCloudAPIPlatformInverter(log, config, api, this.config.tokenId, inverter.sn, inverter.name, inverter.hasBattery, this.smoothingWindow);
77
77
  // add new inverter to list
78
78
  this.inverters.push(platformInverter);
79
79
  });
80
+ // create inverter totalizers
81
+ if (this.inverters.length > 1) {
82
+ this.allInverters = new platformInverter_1.SolaxCloudAPIPlatformInverter(log, config, api, this.config.tokenId, 'total', 'All inverters', this.inverters.map(inverter => +inverter.hasBattery()).reduce((a, b) => a + b, 0) > 0, this.smoothingWindow);
83
+ }
80
84
  // start data fetching
81
85
  this.fetchDataPeriodically();
82
86
  this.log.debug('Finished initializing platform.');
@@ -98,13 +102,33 @@ class SolaxCloudAPIPlatform {
98
102
  static isInverterConfig(obj) {
99
103
  return 'name' in obj && 'sn' in obj;
100
104
  }
105
+ /**
106
+ * Update data for virtual inverter totalizer based on individual inverter data.
107
+ */
108
+ updateAllInvertersData() {
109
+ 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));
110
+ this.allInverters.setRawPower(platformInverter_1.ACCESSORY_KEYS.inverterFromBattery, this.inverters.map(inverter => inverter.getRawPower(platformInverter_1.ACCESSORY_KEYS.inverterFromBattery)).reduce((a, b) => a + b, 0));
111
+ this.allInverters.setRawPower(platformInverter_1.ACCESSORY_KEYS.inverterToBattery, this.inverters.map(inverter => inverter.getRawPower(platformInverter_1.ACCESSORY_KEYS.inverterToBattery)).reduce((a, b) => a + b, 0));
112
+ 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));
113
+ 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));
114
+ 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));
115
+ 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));
116
+ 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));
117
+ // notify update with motion
118
+ this.allInverters.setMotionUpdate();
119
+ }
101
120
  /**
102
121
  * Periodically retrieves inverter data from Solax Cloud API using configured tokenID and SN.
103
122
  */
104
123
  async fetchDataPeriodically() {
105
124
  // loop over inverters and update its data
106
- this.inverters.forEach(inverter => inverter.updateInverterData());
125
+ this.inverters.forEach(inverter => inverter.updateInverterDataFromCloud());
107
126
  this.log.info(`Updated data from Solax Cloud API, sleeping for ${this.config.pollingFrequency} seconds.`);
127
+ // update inverter totalizers if needed
128
+ if (this.inverters.length > 1) {
129
+ this.log.info('Computing inverter totals...');
130
+ this.updateAllInvertersData();
131
+ }
108
132
  this.sleep(this.config.pollingFrequency * 1000).then(async () => await this.fetchDataPeriodically());
109
133
  }
110
134
  /**
@@ -234,6 +258,10 @@ class SolaxCloudAPIPlatform {
234
258
  const accessories = [];
235
259
  // loop over inverters and add accessories
236
260
  this.inverters.forEach(inverter => accessories.push(...inverter.getAccessories()));
261
+ // add inverter totalizer accessories if needed
262
+ if (this.inverters.length > 1) {
263
+ accessories.push(...this.allInverters.getAccessories());
264
+ }
237
265
  callback(accessories);
238
266
  }
239
267
  }
@@ -1 +1 @@
1
- {"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";;;;;;AAEA,iCAA8B;AAC9B,yDAAmE;AAEnE,gDAAwB;AAExB;;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;AAU3F;;;;GAIG;AACH,MAAa,qBAAqB;IAehC;;;;;;OAMG;IACH,YAAa,GAAY,EAAE,MAAsB,EAAE,GAAQ;QAjB3D;;WAEG;QACK,oBAAe,GAAG,CAAC,C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