homebridge-solaxcloud-api 2.1.6 → 2.1.7

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 CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [v2.1.7] - 2022-05-03
6
+ ### Changes
7
+ * Bumped dependencies.
8
+ * Unit testing for multiple inverters.
9
+ ### Fixed
10
+ * Documentation updates.
11
+
5
12
  ## [v2.1.6] - 2022-04-07
6
13
  ### Changes
7
14
  * Battery totals SoC updated to "All inverters".
@@ -13,11 +20,10 @@ All notable changes to this project will be documented in this file.
13
20
  * New inverter accessory **Battery** for State of Charge (SoC) information.
14
21
  * Support for battery charge level, charge state and low battery handler (<10%).
15
22
 
16
-
17
23
  ## [v2.1.4] - 2022-04-06
18
24
  ### Changed
19
25
  * Added "All inverters" virtual inverter for totalizing inverter figures for all sensors.
20
- * Preliminary battery support with **From Battery** and **To Battery** charge power ([#02]).
26
+ * Preliminary battery support with **From Battery** and **To Battery** charge power ([#02](https://github.com/AllMightySauron/homebride-solaxcloud-api/issues/2)).
21
27
 
22
28
  ## [v2.1.2] - 2022-03-31
23
29
  ### Fixed
@@ -31,8 +37,8 @@ All notable changes to this project will be documented in this file.
31
37
 
32
38
  ## [v2.0.2] - 2022-01-24
33
39
  ### Changed
34
- * Added support for "pure" Home app accessories (power consumption displayed as Ambient Light Sensors) ([#01]).
35
- * Created option accessories to display smooth value from raw API data (minimizing sporadic events like a cloud passing).
40
+ * Added support for "pure" Home app accessories (power consumption displayed as Ambient Light Sensors) ([#01](https://github.com/AllMightySauron/homebride-solaxcloud-api/issues/1)).
41
+ * Created optional accessories to display smooth value from raw API data (minimizing sporadic events like a cloud passing).
36
42
 
37
43
  ## [v1.5.1] - 2022-01-08
38
44
  ### Fixed
package/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
 
14
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
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.
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
17
 
18
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
19
 
@@ -190,4 +190,4 @@ Next planned plugin releases should include:
190
190
  - [x] Enable support for "pure" Home App accessories (power meters will be exposed as Ambient Light sensors)
191
191
  - [x] Add "smooth" accessories for power meters (compensating for sporadic scenarios like cloud a passing)
192
192
  - [x] Support for multiple inverters
193
- - [ ] Accessories for battery state and consumptions (work in progress)
193
+ - [x] Accessories for battery state and consumptions
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": "2.1.6",
5
+ "version": "2.1.7",
6
6
  "description": "Integrates solar production info using public Solax Cloud API into Homebridge accessories.",
7
7
  "license": "Apache-2.0",
8
8
  "repository": {
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "engines": {
16
16
  "node": ">=14.18.1",
17
- "homebridge": ">=1.3.5"
17
+ "homebridge": ">=1.3.8"
18
18
  },
19
19
  "main": "dist/index.js",
20
20
  "scripts": {
@@ -34,8 +34,8 @@
34
34
  "jshint": "^2.13.1",
35
35
  "sync-fetch": "^0.3.1",
36
36
  "string-hash-64": "^1.0.3",
37
- "homebridge-lib": "^5.1.21",
38
- "fakegato-history": "^0.6.2"
37
+ "homebridge-lib": "^5.4.0",
38
+ "fakegato-history": "^0.6.3"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/mocha": "^9.0.0",
@@ -1,6 +1,6 @@
1
1
  import { SolaxCloudAPI, SolaxCloudAPIResponse } from '../src/solaxcloudapi';
2
2
 
3
- import assert = require('assert');
3
+ import assert from 'assert';
4
4
 
5
5
  describe('SolaxCloudAPI: Static methods', () => {
6
6
 
@@ -40,11 +40,11 @@ describe('SolaxCloudAPI: Static methods', () => {
40
40
  assert.strictEqual(25, SolaxCloudAPI.getBatterySoC(sampleReply.result));
41
41
  });
42
42
 
43
- it('DC From Battery', () => {
43
+ it('From Battery', () => {
44
44
  assert.strictEqual(21, SolaxCloudAPI.getInverterPowerFromBattery(sampleReply.result));
45
45
  });
46
46
 
47
- it('DC To Battery', () => {
47
+ it('To Battery', () => {
48
48
  assert.strictEqual(0, SolaxCloudAPI.getInverterPowerToBattery(sampleReply.result));
49
49
  });
50
50
 
@@ -69,4 +69,96 @@ describe('SolaxCloudAPI: Static methods', () => {
69
69
  assert.strictEqual(0, SolaxCloudAPI.getGridPowerToHouse(sampleReply.result));
70
70
  });
71
71
 
72
+ });
73
+
74
+ describe('SolaxCloudAPI: Multiple inverters', () => {
75
+
76
+ const inverter1Data: SolaxCloudAPIResponse = {
77
+ success: true,
78
+ exception: 'Query success!',
79
+ result: {
80
+ inverterSN: 'XPTO1',
81
+ sn: 'ABC123',
82
+ acpower: -522.0,
83
+ yieldtoday: 0.3,
84
+ yieldtotal: 6726.6,
85
+ feedinpower: -48.0,
86
+ feedinenergy: 4820.32,
87
+ consumeenergy: 4743.47,
88
+ feedinpowerM2: 0.0,
89
+ soc: 22.0,
90
+ peps1: 0.0,
91
+ peps2: 0.0,
92
+ peps3 : 0.0,
93
+ inverterType: '5',
94
+ inverterStatus: '102',
95
+ uploadTime: '2022-04-05 10:10:27',
96
+ batPower: 2326.0,
97
+ powerdc1: 1182.0,
98
+ powerdc2: 698.0,
99
+ powerdc3: null,
100
+ powerdc4: null,
101
+ },
102
+ };
103
+ const inverter2Data: SolaxCloudAPIResponse = {
104
+ success: true,
105
+ exception: 'Query success !',
106
+ result: {
107
+ inverterSN: 'XPTO2',
108
+ sn: 'ABC123',
109
+ acpower: 1056.0,
110
+ yieldtoday: 1.3,
111
+ yieldtotal: 3989.1,
112
+ feedinpower: 0.0,
113
+ feedinenergy: 0.0,
114
+ consumeenergy: 0.0,
115
+ feedinpowerM2: 0.0,
116
+ soc: 0.0,
117
+ peps1: 0.0,
118
+ peps2: 0.0,
119
+ peps3 : 0.0,
120
+ inverterType: '7',
121
+ inverterStatus: '102',
122
+ uploadTime: '2022-04-05 10:10:13',
123
+ batPower: 0.0,
124
+ powerdc1: 479.0,
125
+ powerdc2: 683.0,
126
+ powerdc3: null,
127
+ powerdc4: null,
128
+ },
129
+ };
130
+
131
+ it('PV Power', () => {
132
+ assert.strictEqual(3042, SolaxCloudAPI.getPVPower(inverter1Data.result) + SolaxCloudAPI.getPVPower(inverter2Data.result));
133
+ });
134
+
135
+ it('Battery SoC', () => {
136
+ assert.strictEqual(22, SolaxCloudAPI.getBatterySoC(inverter1Data.result) + SolaxCloudAPI.getBatterySoC(inverter2Data.result));
137
+ });
138
+
139
+ it('From Battery', () => {
140
+ assert.strictEqual(0, SolaxCloudAPI.getInverterPowerFromBattery(inverter1Data.result) +
141
+ SolaxCloudAPI.getInverterPowerFromBattery(inverter2Data.result));
142
+ });
143
+
144
+ it('To Battery', () => {
145
+ assert.strictEqual(2326, SolaxCloudAPI.getInverterPowerToBattery(inverter1Data.result) +
146
+ SolaxCloudAPI.getInverterPowerToBattery(inverter2Data.result));
147
+ });
148
+
149
+ it('Inverter AC Power', () => {
150
+ assert.strictEqual(534, SolaxCloudAPI.getInverterACPower(inverter1Data.result) +
151
+ SolaxCloudAPI.getInverterACPower(inverter2Data.result));
152
+ });
153
+
154
+ it('Inverter power to grid', () => {
155
+ assert.strictEqual(0, SolaxCloudAPI.getInverterPowerToGrid(inverter1Data.result) +
156
+ SolaxCloudAPI.getInverterPowerToGrid(inverter2Data.result));
157
+ });
158
+
159
+ it('Grid power to house', () => {
160
+ assert.strictEqual(48, SolaxCloudAPI.getGridPowerToHouse(inverter1Data.result) +
161
+ SolaxCloudAPI.getGridPowerToHouse(inverter2Data.result));
162
+ });
163
+
72
164
  });