iobroker.alpha-ess 1.0.0 → 1.0.1
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 +5 -4
- package/io-package.json +14 -14
- package/main.js +19 -22
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -14,10 +14,7 @@
|
|
|
14
14
|
This adapter logs into the web API of [Alpha ESS](https://www.alphaess.com/) and retrieves information for your Alpha ESS equipment.\
|
|
15
15
|
Depending on your Alpha ESS product, it is possible to get realtime data and configuration data for your equipment. Which data points are returned by the API depends on your Alpha ESS equipment.
|
|
16
16
|
|
|
17
|
-
This adapter supports two APIs, the internal Alpha ESS Web API, which may be changed at any time by Alpha ESS, and the Alpha ESS Open API, which provides less functionality but is
|
|
18
|
-
|
|
19
|
-
Currently this adapter creates a state with a hopefully self explaining name for each suppoerted data point.\
|
|
20
|
-
All other data points are ignored. During adapter start these data points are logged as debug message.
|
|
17
|
+
This adapter supports two APIs, the internal Alpha ESS Web API, which may be changed at any time by Alpha ESS, and the Alpha ESS Open API, which provides less functionality but is an official and documented API for Alpha ESS devices.
|
|
21
18
|
|
|
22
19
|
Staring with version 1.0.0-alpha.5, the quality attribute of each state is set accordingly to its status:
|
|
23
20
|
| Quality | meaning |
|
|
@@ -65,6 +62,10 @@ To be able to use the new Open API you have to register your Alpha-ESS device un
|
|
|
65
62
|
**All product and company names or logos are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them or any associated subsidiaries! This personal project is maintained in spare time and has no business goal.**
|
|
66
63
|
|
|
67
64
|
## Changelog
|
|
65
|
+
### 1.0.1 (2023-10-03)
|
|
66
|
+
|
|
67
|
+
- (Gaspode) Adapted fetching energy values using 'Closed API' to latest API changes by Alpha-ESS
|
|
68
|
+
|
|
68
69
|
### 1.0.0 (2023-06-20)
|
|
69
70
|
|
|
70
71
|
- (Gaspode) Support also the new official OpenAPI provided by Alpha-ESS
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "alpha-ess",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"news": {
|
|
6
|
+
"1.0.1": {
|
|
7
|
+
"en": "Adapted fetching energy values using 'Closed API' to latest API changes by Alpha-ESS",
|
|
8
|
+
"de": "Closed API: Energiewerte an neueste API-Änderungen von Alpha-ESS angepasst",
|
|
9
|
+
"ru": "Адаптированные выкачивание энергетических ценностей с помощью 'Closed API' для последних изменений API от Alpha-ESS",
|
|
10
|
+
"pt": "Valores de energia de busca adaptados usando ' API fechada' para as últimas alterações de API por Alpha-ESS",
|
|
11
|
+
"nl": "API verandert door Alpha-ESSS",
|
|
12
|
+
"fr": "Récupération des valeurs d'énergie à l'aide de 'API fermée' aux dernières modifications de l'API par Alpha-ESS",
|
|
13
|
+
"it": "Adattato l'ottenimento di valori energetici utilizzando 'API archiviate' alle ultime modifiche API di Alpha-ESS",
|
|
14
|
+
"es": "Valores de energía adaptados de búsqueda usando 'Closed API' para los últimos cambios de API por Alpha-ESS",
|
|
15
|
+
"pl": "Adapted fetching energy values używając 'Closed API' do najnowszych zmian API przez Alpha-ESS",
|
|
16
|
+
"uk": "Адаптивовані коефіцієнти відтікання енергії за допомогою 'Closed API' для останніх змін API від Alpha-ESS",
|
|
17
|
+
"zh-cn": "利用“无能”的能源价值降低到Alpha-ESS新生动的改变"
|
|
18
|
+
},
|
|
6
19
|
"1.0.0": {
|
|
7
20
|
"en": "Support also the new official OpenAPI provided by Alpha-ESS\nSet state quality accordingly to status of data\nWriting charging and discharging settings implemented for 'Closed API' and OpenAPI\nRemove no more supported states at startup automatically",
|
|
8
21
|
"de": "Unterstützung der neuen offiziellen OpenAPI von Alpha-ESS\nQuality von States wird jetzt entsprechend des Zustands der Daten gesetzt\nSchreiben von Lade- und Entladeeinstellungen für 'Closed API' und OpenAPI implementiert\nNicht mehr unterstützte States werden bei Adapter-Neustart automatisch gelöscht",
|
|
@@ -80,19 +93,6 @@
|
|
|
80
93
|
"pl": "Pisanie ładowania i rozładowania wdrożone (OpenAPI)",
|
|
81
94
|
"uk": "Написання параметрів зарядки та розвантаження (OpenAPI тільки)",
|
|
82
95
|
"zh-cn": "标定和执行的慈善环境(仅为泛美卫生组织)"
|
|
83
|
-
},
|
|
84
|
-
"1.0.0-alpha.0": {
|
|
85
|
-
"en": "Support also the new official OpenAPI provided by Alpha-ESS",
|
|
86
|
-
"de": "Unterstützung jetzt auch die neue offizielle OpenAPI von Alpha-ESS",
|
|
87
|
-
"ru": "Поддержка также новый официальный OpenAPI, предоставленный Alpha-ESS",
|
|
88
|
-
"pt": "Suporte também o novo OpenAPI oficial fornecido pela Alpha-ESS",
|
|
89
|
-
"nl": "Vertaling:",
|
|
90
|
-
"fr": "Soutien également le nouveau OpenAPI officiel fourni par Alpha-ESS",
|
|
91
|
-
"it": "Supporto anche il nuovo OpenAPI ufficiale fornito da Alpha-ESS",
|
|
92
|
-
"es": "Apoyar también el nuevo OpenAPI oficial proporcionado por Alpha-ESS",
|
|
93
|
-
"pl": "Wspiera również nowy oficjalny interfejs OpenAPI zapewniany przez Alpha-ESS",
|
|
94
|
-
"uk": "Підтримка також нових офіційних OpenAPI, що надається Альфа-ESS",
|
|
95
|
-
"zh-cn": "还支持阿尔法-萨斯新官方开放协会"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
package/main.js
CHANGED
|
@@ -1086,58 +1086,58 @@ class ClosedAPI {
|
|
|
1086
1086
|
, intervalFactor: 60
|
|
1087
1087
|
, states: [
|
|
1088
1088
|
{
|
|
1089
|
-
alphaAttrName: '
|
|
1089
|
+
alphaAttrName: 'Eload'
|
|
1090
1090
|
, role: 'value.power.consumption'
|
|
1091
1091
|
, id: 'Consumption_today'
|
|
1092
1092
|
, name: 'Today\'s consumption'
|
|
1093
1093
|
, type: 'number'
|
|
1094
1094
|
, unit: 'kWh'
|
|
1095
|
-
, dayIndex:
|
|
1095
|
+
, dayIndex: false
|
|
1096
1096
|
}
|
|
1097
1097
|
, {
|
|
1098
|
-
alphaAttrName: '
|
|
1098
|
+
alphaAttrName: 'Epvtoday'
|
|
1099
1099
|
, role: 'value.power.consumption'
|
|
1100
1100
|
, id: 'Generation_today'
|
|
1101
1101
|
, name: 'Today\'s generation'
|
|
1102
1102
|
, type: 'number'
|
|
1103
1103
|
, unit: 'kWh'
|
|
1104
|
-
, dayIndex:
|
|
1104
|
+
, dayIndex: false
|
|
1105
1105
|
}
|
|
1106
1106
|
, {
|
|
1107
|
-
alphaAttrName: '
|
|
1107
|
+
alphaAttrName: 'Eoutput'
|
|
1108
1108
|
, role: 'value.power.consumption'
|
|
1109
1109
|
, id: 'Grid_feed_in_today'
|
|
1110
1110
|
, name: 'Today\'s grid feed in'
|
|
1111
1111
|
, type: 'number'
|
|
1112
1112
|
, unit: 'kWh'
|
|
1113
|
-
, dayIndex:
|
|
1113
|
+
, dayIndex: false
|
|
1114
1114
|
}
|
|
1115
1115
|
, {
|
|
1116
|
-
alphaAttrName: '
|
|
1116
|
+
alphaAttrName: 'Einput'
|
|
1117
1117
|
, role: 'value.power.consumption'
|
|
1118
1118
|
, id: 'Grid_consumption_today'
|
|
1119
1119
|
, name: 'Today\'s grid consumption'
|
|
1120
1120
|
, type: 'number'
|
|
1121
1121
|
, unit: 'kWh'
|
|
1122
|
-
, dayIndex:
|
|
1122
|
+
, dayIndex: false
|
|
1123
1123
|
}
|
|
1124
1124
|
, {
|
|
1125
|
-
alphaAttrName: '
|
|
1125
|
+
alphaAttrName: 'Echarge'
|
|
1126
1126
|
, role: 'value.power.consumption'
|
|
1127
1127
|
, id: 'Battery_charge_today'
|
|
1128
1128
|
, name: 'Today\'s battery charge'
|
|
1129
1129
|
, type: 'number'
|
|
1130
1130
|
, unit: 'kWh'
|
|
1131
|
-
, dayIndex:
|
|
1131
|
+
, dayIndex: false
|
|
1132
1132
|
}
|
|
1133
1133
|
, {
|
|
1134
|
-
alphaAttrName: '
|
|
1134
|
+
alphaAttrName: 'EDisCharge'
|
|
1135
1135
|
, role: 'value.power.consumption'
|
|
1136
1136
|
, id: 'Battery_discharge_today'
|
|
1137
1137
|
, name: 'Today\'s battery discharge'
|
|
1138
1138
|
, type: 'number'
|
|
1139
1139
|
, unit: 'kWh'
|
|
1140
|
-
, dayIndex:
|
|
1140
|
+
, dayIndex: false
|
|
1141
1141
|
}]
|
|
1142
1142
|
},
|
|
1143
1143
|
{
|
|
@@ -1690,20 +1690,17 @@ class ClosedAPI {
|
|
|
1690
1690
|
try {
|
|
1691
1691
|
this.adapter.stopGroupTimeout(group);
|
|
1692
1692
|
|
|
1693
|
-
this.adapter.log.debug('Fetching
|
|
1693
|
+
this.adapter.log.debug('Fetching summary data...');
|
|
1694
1694
|
|
|
1695
1695
|
const dt = new Date();
|
|
1696
|
-
const dts = (dt.getFullYear() + '-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
'
|
|
1700
|
-
|
|
1701
|
-
'sn': this.adapter.config.systemId,
|
|
1702
|
-
'userId': '',
|
|
1703
|
-
};
|
|
1704
|
-
const body = await this.postData(CA_BaseURI + 'api/Statistic/SystemStatistic', JSON.stringify(json), group);
|
|
1696
|
+
const dts = (dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate());
|
|
1697
|
+
|
|
1698
|
+
const body = await this.getData(CA_BaseURI + 'api/ESS/SticsSummeryDataForCustomer?sn=' + this.adapter.config.systemId +
|
|
1699
|
+
'&tday=' + dts + '&noLoading=true', group);
|
|
1700
|
+
|
|
1705
1701
|
await this.adapter.createAndUpdateStates(group, body.data);
|
|
1706
1702
|
|
|
1703
|
+
// Configuration is in minutes, so multiply with 60
|
|
1707
1704
|
this.startGroupTimeout(group);
|
|
1708
1705
|
}
|
|
1709
1706
|
catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.alpha-ess",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Read and write data from and to Alpha ESS systems.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Gaspode",
|
|
@@ -19,36 +19,36 @@
|
|
|
19
19
|
"node": ">= 14"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@iobroker/adapter-core": "^
|
|
23
|
-
"axios": "^1.
|
|
22
|
+
"@iobroker/adapter-core": "^3.0.3",
|
|
23
|
+
"axios": "^1.5.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@alcalzone/release-script": "^3.
|
|
27
|
-
"@alcalzone/release-script-plugin-iobroker": "^3.
|
|
26
|
+
"@alcalzone/release-script": "^3.6.0",
|
|
27
|
+
"@alcalzone/release-script-plugin-iobroker": "^3.6.0",
|
|
28
28
|
"@alcalzone/release-script-plugin-license": "^3.5.9",
|
|
29
29
|
"@alcalzone/release-script-plugin-manual-review": "^3.5.9",
|
|
30
30
|
"@iobroker/adapter-dev": "^1.2.0",
|
|
31
31
|
"@iobroker/testing": "^4.1.0",
|
|
32
|
-
"@tsconfig/node14": "^1.0
|
|
33
|
-
"@tsconfig/node18": "^2.
|
|
32
|
+
"@tsconfig/node14": "^14.1.0",
|
|
33
|
+
"@tsconfig/node18": "^18.2.2",
|
|
34
34
|
"@types/chai": "^4.3.5",
|
|
35
35
|
"@types/chai-as-promised": "^7.1.5",
|
|
36
|
-
"@types/mocha": "^10.0.
|
|
37
|
-
"@types/node": "^
|
|
36
|
+
"@types/mocha": "^10.0.2",
|
|
37
|
+
"@types/node": "^20.8.0",
|
|
38
38
|
"@types/proxyquire": "^1.3.28",
|
|
39
39
|
"@types/sinon": "^10.0.13",
|
|
40
40
|
"@types/sinon-chai": "^3.2.9",
|
|
41
41
|
"chai": "^4.3.7",
|
|
42
42
|
"chai-as-promised": "^7.1.1",
|
|
43
|
-
"eslint": "^8.
|
|
44
|
-
"eslint-config-prettier": "^
|
|
43
|
+
"eslint": "^8.50.0",
|
|
44
|
+
"eslint-config-prettier": "^9.0.0",
|
|
45
45
|
"eslint-plugin-prettier": "^4.2.1",
|
|
46
46
|
"mocha": "^10.2.0",
|
|
47
47
|
"prettier": "^2.8.7",
|
|
48
48
|
"proxyquire": "^2.1.3",
|
|
49
|
-
"sinon": "^15.
|
|
49
|
+
"sinon": "^15.2.0",
|
|
50
50
|
"sinon-chai": "^3.7.0",
|
|
51
|
-
"typescript": "~5.
|
|
51
|
+
"typescript": "~5.2.2"
|
|
52
52
|
},
|
|
53
53
|
"main": "main.js",
|
|
54
54
|
"files": [
|