iobroker.alpha-ess 1.0.2 → 1.1.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 +13 -1
- package/admin/i18n/de/translations.json +2 -1
- package/admin/i18n/en/translations.json +2 -1
- package/admin/i18n/es/translations.json +2 -1
- package/admin/i18n/fr/translations.json +2 -1
- package/admin/i18n/it/translations.json +2 -1
- package/admin/i18n/nl/translations.json +2 -1
- package/admin/i18n/pl/translations.json +2 -1
- package/admin/i18n/pt/translations.json +2 -1
- package/admin/i18n/ru/translations.json +2 -1
- package/admin/i18n/uk/translations.json +2 -1
- package/admin/i18n/zh-cn/translations.json +2 -1
- package/admin/jsonConfig.json +26 -14
- package/io-package.json +27 -27
- package/main.js +87 -68
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -27,7 +27,9 @@ Staring with version 1.0.0-alpha.5, the quality attribute of each state is set a
|
|
|
27
27
|
|
|
28
28
|
## Settings:
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
<span style="color:red">CAUTION: Currently only Open API is supported because the Closed API was changed by Apha-ESS and cannot be used by third party applications at the moment.</span>
|
|
31
|
+
|
|
32
|
+
**Used API:** Choose between the inofficial "Closed" API and the official "Open" API
|
|
31
33
|
Depending on the selected API there are different settings available.
|
|
32
34
|
|
|
33
35
|
**Closed API Settings:**
|
|
@@ -47,6 +49,7 @@ The password is stored encrypted and must therefore be entered manually: demo
|
|
|
47
49
|
**Open API Settings:**
|
|
48
50
|
|
|
49
51
|
To be able to use the new Open API you have to register your Alpha-ESS device unter https://open.alphaess.com. Once registered, you get a developer ID and a developer key (called "Secret"). You will need these to have access to the Open API. Currently I have no information if this will be changed in the future.
|
|
52
|
+
How to find SN and Check code for registration is described here: https://github.com/alphaess-developer/alphacloud_open_api
|
|
50
53
|
|
|
51
54
|
- **Personal application ID:** The application ID (see above)
|
|
52
55
|
- **Personal application Secret:** The application Secret (see above)
|
|
@@ -62,6 +65,15 @@ To be able to use the new Open API you have to register your Alpha-ESS device un
|
|
|
62
65
|
**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.**
|
|
63
66
|
|
|
64
67
|
## Changelog
|
|
68
|
+
### 1.1.1 (2023-11-04)
|
|
69
|
+
|
|
70
|
+
- (Gaspode) Closed API adapted to latest Alpha-ESS changes and enabled again
|
|
71
|
+
|
|
72
|
+
### 1.1.0 (2023-11-04)
|
|
73
|
+
|
|
74
|
+
- (Gaspode) Closed API disabled (temporarily?) because API has been changed by Alpha-ESS
|
|
75
|
+
- (Gaspode) Read back changed settings values 2 seconds after they have been changed
|
|
76
|
+
|
|
65
77
|
### 1.0.2 (2023-10-05)
|
|
66
78
|
|
|
67
79
|
- (mcm1957) Updated required node version to 16 or newer
|
|
@@ -12,5 +12,6 @@
|
|
|
12
12
|
"Personal APP ID": "Persönliche Application ID",
|
|
13
13
|
"Personal APP Secret": "Persönliches Application Secret",
|
|
14
14
|
"Interval to read charging settings": "Intervall zum Lesen der Ladeeinstellungen [min]",
|
|
15
|
-
"Interval to read discharging settings": "Intervall zum Lesen der Entladeeinstellungen [min]"
|
|
15
|
+
"Interval to read discharging settings": "Intervall zum Lesen der Entladeeinstellungen [min]",
|
|
16
|
+
"Sorry. Closed API currently not supported!": "Entschuldigung. Closed API wird aufgrund von Änderungen durch Alpha-ESS derzeit nicht unterstützt!"
|
|
16
17
|
}
|
|
@@ -12,5 +12,6 @@
|
|
|
12
12
|
"Personal APP ID": "Personal Application ID",
|
|
13
13
|
"Personal APP Secret": "Personal Application Secret",
|
|
14
14
|
"Interval to read charging settings": "Interval to read charging settings [min]",
|
|
15
|
-
"Interval to read discharging settings": "Interval to read discharging settings [min]"
|
|
15
|
+
"Interval to read discharging settings": "Interval to read discharging settings [min]",
|
|
16
|
+
"Sorry. Closed API currently not supported!": "Sorry. Closed API currently not supported due to changes by Alpha-ESS!"
|
|
16
17
|
}
|
|
@@ -12,5 +12,6 @@
|
|
|
12
12
|
"Personal APP ID": "ID de aplicación personal",
|
|
13
13
|
"Personal APP Secret": "Secreto de aplicación personal",
|
|
14
14
|
"Interval to read charging settings": "Intervalo para leer la configuración de carga",
|
|
15
|
-
"Interval to read discharging settings": "Intervalo para leer la configuración de descarga"
|
|
15
|
+
"Interval to read discharging settings": "Intervalo para leer la configuración de descarga",
|
|
16
|
+
"Sorry. Closed API currently not supported!": "Lo siento. ¡La API cerrada actualmente no es compatible debido a cambios realizados por Alpha-ESS!"
|
|
16
17
|
}
|
|
@@ -12,5 +12,6 @@
|
|
|
12
12
|
"Personal APP ID": "ID de candidature personnel",
|
|
13
13
|
"Personal APP Secret": "Secret d'application personnel",
|
|
14
14
|
"Interval to read charging settings": "Intervalle pour lire les paramètres de charge",
|
|
15
|
-
"Interval to read discharging settings": "Intervalle pour lire les paramètres de décharge"
|
|
15
|
+
"Interval to read discharging settings": "Intervalle pour lire les paramètres de décharge",
|
|
16
|
+
"Sorry. Closed API currently not supported!": "Désolé. API fermée actuellement non prise en charge en raison de modifications apportées par Alpha-ESS !"
|
|
16
17
|
}
|
|
@@ -12,5 +12,6 @@
|
|
|
12
12
|
"Personal APP ID": "ID applicazione personale",
|
|
13
13
|
"Personal APP Secret": "Segreto dell'applicazione personale",
|
|
14
14
|
"Interval to read charging settings": "Intervallo per leggere le impostazioni di ricarica",
|
|
15
|
-
"Interval to read discharging settings": "Intervallo per leggere le impostazioni di scarica"
|
|
15
|
+
"Interval to read discharging settings": "Intervallo per leggere le impostazioni di scarica",
|
|
16
|
+
"Sorry. Closed API currently not supported!": "Scusa. API chiusa attualmente non supportata a causa di modifiche apportate da Alpha-ESS!"
|
|
16
17
|
}
|
|
@@ -12,5 +12,6 @@
|
|
|
12
12
|
"Personal APP ID": "Persoonlijke applicatie-ID",
|
|
13
13
|
"Personal APP Secret": "Persoonlijk toepassingsgeheim",
|
|
14
14
|
"Interval to read charging settings": "Interval om laadinstellingen te lezen",
|
|
15
|
-
"Interval to read discharging settings": "Interval om ontlaadinstellingen te lezen"
|
|
15
|
+
"Interval to read discharging settings": "Interval om ontlaadinstellingen te lezen",
|
|
16
|
+
"Sorry. Closed API currently not supported!": "Sorry. Gesloten API momenteel niet ondersteund vanwege wijzigingen door Alpha-ESS!"
|
|
16
17
|
}
|
|
@@ -12,5 +12,6 @@
|
|
|
12
12
|
"Personal APP ID": "Osobisty identyfikator aplikacji",
|
|
13
13
|
"Personal APP Secret": "Tajny wniosek osobisty",
|
|
14
14
|
"Interval to read charging settings": "Interwał odczytu ustawień ładowania",
|
|
15
|
-
"Interval to read discharging settings": "Interwał odczytu ustawień rozładowania"
|
|
15
|
+
"Interval to read discharging settings": "Interwał odczytu ustawień rozładowania",
|
|
16
|
+
"Sorry. Closed API currently not supported!": "Przepraszam. Zamknięte API obecnie nie jest obsługiwane ze względu na zmiany wprowadzone przez Alpha-ESS!"
|
|
16
17
|
}
|
|
@@ -12,5 +12,6 @@
|
|
|
12
12
|
"Personal APP ID": "ID de aplicativo pessoal",
|
|
13
13
|
"Personal APP Secret": "Segredo de aplicativo pessoal",
|
|
14
14
|
"Interval to read charging settings": "Intervalo para ler as configurações de carregamento",
|
|
15
|
-
"Interval to read discharging settings": "Intervalo para ler as configurações de descarga"
|
|
15
|
+
"Interval to read discharging settings": "Intervalo para ler as configurações de descarga",
|
|
16
|
+
"Sorry. Closed API currently not supported!": "Desculpe. API fechada atualmente não suportada devido a alterações do Alpha-ESS!"
|
|
16
17
|
}
|
|
@@ -12,5 +12,6 @@
|
|
|
12
12
|
"Personal APP ID": "Идентификатор личного приложения",
|
|
13
13
|
"Personal APP Secret": "Секрет личного приложения",
|
|
14
14
|
"Interval to read charging settings": "Интервал чтения настроек зарядки",
|
|
15
|
-
"Interval to read discharging settings": "Интервал чтения настроек разрядки"
|
|
15
|
+
"Interval to read discharging settings": "Интервал чтения настроек разрядки",
|
|
16
|
+
"Sorry. Closed API currently not supported!": "Извини. Закрытый API в настоящее время не поддерживается из-за изменений Alpha-ESS!"
|
|
16
17
|
}
|
|
@@ -12,5 +12,6 @@
|
|
|
12
12
|
"Personal APP ID": "Персональний ID програми",
|
|
13
13
|
"Personal APP Secret": "Особистий секрет програми",
|
|
14
14
|
"Interval to read charging settings": "Інтервал зчитування параметрів заряджання",
|
|
15
|
-
"Interval to read discharging settings": "Інтервал зчитування параметрів розрядки"
|
|
15
|
+
"Interval to read discharging settings": "Інтервал зчитування параметрів розрядки",
|
|
16
|
+
"Sorry. Closed API currently not supported!": "вибач Закритий API наразі не підтримується через зміни Alpha-ESS!"
|
|
16
17
|
}
|
|
@@ -12,5 +12,6 @@
|
|
|
12
12
|
"Personal APP ID": "个人申请编号",
|
|
13
13
|
"Personal APP Secret": "个人申请秘诀",
|
|
14
14
|
"Interval to read charging settings": "读取充电设置的间隔",
|
|
15
|
-
"Interval to read discharging settings": "读取放电设置的间隔"
|
|
15
|
+
"Interval to read discharging settings": "读取放电设置的间隔",
|
|
16
|
+
"Sorry. Closed API currently not supported!": "对不起。由于 Alpha-ESS 的更改,目前不支持封闭 API!"
|
|
16
17
|
}
|
package/admin/jsonConfig.json
CHANGED
|
@@ -12,19 +12,29 @@
|
|
|
12
12
|
{ "label": "Open API", "value": 1 }
|
|
13
13
|
]
|
|
14
14
|
},
|
|
15
|
+
"closedAPINotSupported": {
|
|
16
|
+
"sm": 5,
|
|
17
|
+
"type": "staticText",
|
|
18
|
+
"text": "Sorry. Closed API currently not supported!",
|
|
19
|
+
"style": {
|
|
20
|
+
"color": "red"
|
|
21
|
+
},
|
|
22
|
+
"newLine": true,
|
|
23
|
+
"hidden": "data.apiType == 1 || data.apiType == 0"
|
|
24
|
+
},
|
|
15
25
|
"username": {
|
|
16
26
|
"sm": 5,
|
|
17
27
|
"type": "text",
|
|
18
28
|
"label": "Username",
|
|
19
29
|
"newLine": true,
|
|
20
|
-
"hidden": "data.apiType == 1"
|
|
30
|
+
"hidden": "data.apiType == 1 || data.apiType == 3"
|
|
21
31
|
},
|
|
22
32
|
"password": {
|
|
23
33
|
"sm": 5,
|
|
24
34
|
"type": "password",
|
|
25
35
|
"label": "Password",
|
|
26
36
|
"newLine": true,
|
|
27
|
-
"hidden": "data.apiType == 1"
|
|
37
|
+
"hidden": "data.apiType == 1 || data.apiType == 3"
|
|
28
38
|
},
|
|
29
39
|
"appID": {
|
|
30
40
|
"sm": 5,
|
|
@@ -44,12 +54,13 @@
|
|
|
44
54
|
"sm": 5,
|
|
45
55
|
"type": "text",
|
|
46
56
|
"label": "Alpha ESS System ID",
|
|
47
|
-
"newLine": true
|
|
57
|
+
"newLine": true,
|
|
58
|
+
"disabled": "data.apiType == 3"
|
|
48
59
|
},
|
|
49
60
|
"enableRealtimedata": {
|
|
50
61
|
"type": "checkbox",
|
|
51
62
|
"newLine": true,
|
|
52
|
-
"hidden": "data.apiType == 1"
|
|
63
|
+
"hidden": "data.apiType == 1 || data.apiType == 3"
|
|
53
64
|
},
|
|
54
65
|
"intervalRealtimedata": {
|
|
55
66
|
"sm": 5,
|
|
@@ -58,12 +69,12 @@
|
|
|
58
69
|
"label": "Interval to read realtime data",
|
|
59
70
|
"newLine": false,
|
|
60
71
|
"disabled": "!data.enableRealtimedata",
|
|
61
|
-
"hidden": "data.apiType == 1"
|
|
72
|
+
"hidden": "data.apiType == 1 || data.apiType == 3"
|
|
62
73
|
},
|
|
63
74
|
"enableEnergydata": {
|
|
64
75
|
"type": "checkbox",
|
|
65
76
|
"newLine": true,
|
|
66
|
-
"hidden": "data.apiType == 1"
|
|
77
|
+
"hidden": "data.apiType == 1 || data.apiType == 3"
|
|
67
78
|
},
|
|
68
79
|
"intervalEnergydataMins": {
|
|
69
80
|
"sm": 5,
|
|
@@ -72,12 +83,12 @@
|
|
|
72
83
|
"label": "Interval to read energy data",
|
|
73
84
|
"newLine": false,
|
|
74
85
|
"disabled": "!data.enableEnergydata",
|
|
75
|
-
"hidden": "data.apiType == 1"
|
|
86
|
+
"hidden": "data.apiType == 1 || data.apiType == 3"
|
|
76
87
|
},
|
|
77
88
|
"enableSettingsdata": {
|
|
78
89
|
"type": "checkbox",
|
|
79
90
|
"newLine": true,
|
|
80
|
-
"hidden": "data.apiType == 1"
|
|
91
|
+
"hidden": "data.apiType == 1 || data.apiType == 3"
|
|
81
92
|
},
|
|
82
93
|
"enableSettingsCharge": {
|
|
83
94
|
"type": "checkbox",
|
|
@@ -114,12 +125,12 @@
|
|
|
114
125
|
"label": "Interval to read settings data",
|
|
115
126
|
"newLine": false,
|
|
116
127
|
"disabled": "!data.enableSettingsdata",
|
|
117
|
-
"hidden": "data.apiType == 1"
|
|
128
|
+
"hidden": "data.apiType == 1 || data.apiType == 3"
|
|
118
129
|
},
|
|
119
130
|
"enableStatisticalTodaydata": {
|
|
120
131
|
"type": "checkbox",
|
|
121
132
|
"newLine": true,
|
|
122
|
-
"hidden": "data.apiType == 1"
|
|
133
|
+
"hidden": "data.apiType == 1 || data.apiType == 3"
|
|
123
134
|
},
|
|
124
135
|
"intervalStatisticalTodaydataMins": {
|
|
125
136
|
"sm": 5,
|
|
@@ -128,12 +139,12 @@
|
|
|
128
139
|
"label": "Interval to read statistical data (today)",
|
|
129
140
|
"newLine": false,
|
|
130
141
|
"disabled": "!data.enableStatisticalTodaydata",
|
|
131
|
-
"hidden": "data.apiType == 1"
|
|
142
|
+
"hidden": "data.apiType == 1 || data.apiType == 3"
|
|
132
143
|
},
|
|
133
144
|
"enableSummarydata": {
|
|
134
145
|
"type": "checkbox",
|
|
135
146
|
"newLine": true,
|
|
136
|
-
"hidden": "data.apiType == 1"
|
|
147
|
+
"hidden": "data.apiType == 1 || data.apiType == 3"
|
|
137
148
|
},
|
|
138
149
|
"intervalSummarydataMins": {
|
|
139
150
|
"sm": 5,
|
|
@@ -142,7 +153,7 @@
|
|
|
142
153
|
"label": "Interval to read summary data",
|
|
143
154
|
"newLine": false,
|
|
144
155
|
"disabled": "!data.enableSummarydata",
|
|
145
|
-
"hidden": "data.apiType == 1"
|
|
156
|
+
"hidden": "data.apiType == 1 || data.apiType == 3"
|
|
146
157
|
},
|
|
147
158
|
"oAEnableRealtime": {
|
|
148
159
|
"type": "checkbox",
|
|
@@ -245,7 +256,8 @@
|
|
|
245
256
|
"updateUnchangedStates": {
|
|
246
257
|
"type": "checkbox",
|
|
247
258
|
"label": "Update unchanged states",
|
|
248
|
-
"newLine": true
|
|
259
|
+
"newLine": true,
|
|
260
|
+
"hidden": "data.apiType == 3"
|
|
249
261
|
}
|
|
250
262
|
}
|
|
251
263
|
}
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "alpha-ess",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.1.1",
|
|
5
5
|
"news": {
|
|
6
|
+
"1.1.1": {
|
|
7
|
+
"en": "Closed API adapted to latest Alpha-ESS changes and enabled again",
|
|
8
|
+
"de": "Closed API angepasst an neueste Alpha-ESS-Änderungen und wieder aktiviert",
|
|
9
|
+
"ru": "Закрытый API адаптирован к последним изменениям Alpha-ESS и включен снова",
|
|
10
|
+
"pt": "API fechada adaptada às últimas alterações Alpha-ESS e ativada novamente",
|
|
11
|
+
"nl": "Quality over Quantity (QoQ) Releases Vertaling:",
|
|
12
|
+
"fr": "API fermée adaptée aux derniers changements Alpha-ESS et réactivée",
|
|
13
|
+
"it": "API chiusa adattata alle ultime modifiche Alpha-ESS e abilitata di nuovo",
|
|
14
|
+
"es": "API cerrada adaptada a los últimos cambios de Alpha-ESS y habilitada de nuevo",
|
|
15
|
+
"pl": "Zamknięty interfejs API zaadaptował się do najnowszych zmian Alpha-ESS i umożliwił powtórzenie się",
|
|
16
|
+
"uk": "Закритий API, адаптований до останніх змін Альфа-ESS і знову ввімкнено",
|
|
17
|
+
"zh-cn": "适应最近Alpha-ESS变革的贴近性联谊会再次促成了变革。"
|
|
18
|
+
},
|
|
19
|
+
"1.1.0": {
|
|
20
|
+
"en": "Closed API disabled (temporarily?) because API has been changed by Alpha-ESS\nRead back changed settings values 2 seconds after they have been changed",
|
|
21
|
+
"de": "Closed API deaktiviert (vorläufig?), weil die API von Alpha-ESS geändert wurde\nLesen Sie zurück geänderte Einstellungen Werte 2 Sekunden nachdem sie geändert wurden",
|
|
22
|
+
"ru": "Закрытый API отключен (временно?) потому что API был изменен Alpha-ESS\nЧитать назад измененные настройки значения 2 секунды после их изменения",
|
|
23
|
+
"pt": "API fechada desabilitada (temporariamente?) porque a API foi alterada por Alpha-ESS\nLeia novamente os valores das configurações alteradas 2 segundos depois de terem sido alterados",
|
|
24
|
+
"nl": "Omdat API veranderd is door Alpha-ESSS\nLees terug veranderde instellingen 2 seconden nadat ze veranderd zijn",
|
|
25
|
+
"fr": "API fermée désactivée (temporairement?) parce que l'API a été changée par Alpha-ESS\nLire les valeurs de paramètres changées 2 secondes après avoir été changées",
|
|
26
|
+
"it": "Chiuso API disabilitato (temporaneo?) perché API è stato modificato da Alpha-ESS\nLeggi indietro i valori delle impostazioni cambiati 2 secondi dopo che sono stati modificati",
|
|
27
|
+
"es": "API cerrada deshabilitada (temporalmente?) porque API ha sido cambiado por Alpha-ESS\nLea los valores de configuración cambiados 2 segundos después de haber cambiado",
|
|
28
|
+
"pl": "Zamknięty API niepełnosprawny (czasowo?) ponieważ interfejs API został zmieniony przez Alpha-ESS\nCzytanie z powrotem zmieniało wartości 2 sekundy po zmianie ich wartości",
|
|
29
|
+
"uk": "Замкнено API вимкнено (попередньо?) тому, що API було змінено Альфа-ESS\nЧитання змінених значень налаштувань 2 секунд після зміни",
|
|
30
|
+
"zh-cn": "由于Alpha-ESS已改变API残疾(有时?)\n阅读后的环境价值观2"
|
|
31
|
+
},
|
|
6
32
|
"1.0.2": {
|
|
7
33
|
"en": "Updated required node version to 16 or newer",
|
|
8
34
|
"de": "Erforderliche Node Version auf 16 oder neuer aktualisiert",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "Scenariusze zaimplementowali \"zniszczone\" API",
|
|
68
94
|
"uk": "Написання параметрів, реалізованих для \"Closed API\"",
|
|
69
95
|
"zh-cn": "A. 落实的封闭环境"
|
|
70
|
-
},
|
|
71
|
-
"1.0.0-alpha.3": {
|
|
72
|
-
"en": "Slow down requests in case of permanent errors for OpenAPI",
|
|
73
|
-
"de": "Verlangsamen von Online-Abfragen bei permanent auftretenden Fehlern (OpenAPI)",
|
|
74
|
-
"ru": "Замедлить запросы в случае постоянных ошибок для OpenAPI",
|
|
75
|
-
"pt": "Abranda os pedidos em caso de erros permanentes para o OpenAPI",
|
|
76
|
-
"nl": "Vertragen verzoeken in geval van permanente fouten voor OpenAPI",
|
|
77
|
-
"fr": "Ralentissez les requêtes en cas d'erreurs permanentes pour OpenAPI",
|
|
78
|
-
"it": "Rallentare le richieste in caso di errori permanenti per OpenAPI",
|
|
79
|
-
"es": "Reduzca las solicitudes en caso de errores permanentes para OpenAPI",
|
|
80
|
-
"pl": "Slow down requests as permanent error for OpenAPI",
|
|
81
|
-
"uk": "Повільні запити у разі постійних помилок для OpenAPI",
|
|
82
|
-
"zh-cn": "对开放式企业投机的长期错误请求下降"
|
|
83
|
-
},
|
|
84
|
-
"1.0.0-alpha.2": {
|
|
85
|
-
"en": "Fixed state verification for time values (OpenAPI only)",
|
|
86
|
-
"de": "Verifizierung von Zeitwerten korrigiert (nur OpenAPI)",
|
|
87
|
-
"ru": "Исправлена проверка состояния на временные значения (только OpenAPI)",
|
|
88
|
-
"pt": "Verificação de estado fixo para valores de tempo (apenas OpenAPI)",
|
|
89
|
-
"nl": "Verificatie van de staat voor tijdwaarden (OpenAPI)",
|
|
90
|
-
"fr": "Vérification de l'état fixe pour les valeurs temporelles (OpenAPI seulement)",
|
|
91
|
-
"it": "Verifica fissa dello stato per i valori temporali (solo OpenAPI)",
|
|
92
|
-
"es": "Verificación estatal fija para valores de tiempo (sólo OpenAPI)",
|
|
93
|
-
"pl": "Weryfikacja stanu na wartości czasowe (OpenAPI tylko)",
|
|
94
|
-
"uk": "Виправлена перевірка стану для значень часу (тільки OpenAPI)",
|
|
95
|
-
"zh-cn": "固定国家对时间价值的核查(只有OpenAPI)"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
package/main.js
CHANGED
|
@@ -14,7 +14,7 @@ const axios = require('axios').default;
|
|
|
14
14
|
const CA_AUTHPREFIX = 'al8e4s';
|
|
15
15
|
const CA_AUTHCONSTANT = 'LS885ZYDA95JVFQKUIUUUV7PQNODZRDZIS4ERREDS0EED8BCWSS';
|
|
16
16
|
const CA_AUTHSUFFIX = 'ui893ed';
|
|
17
|
-
const CA_BaseURI = 'https://
|
|
17
|
+
const CA_BaseURI = 'https://www.alphaess-cloud.com/';
|
|
18
18
|
const OA_BaseURI = 'https://openapi.alphaess.com/api';
|
|
19
19
|
|
|
20
20
|
const WriteTimeoutIntervalInS = 5;
|
|
@@ -640,7 +640,7 @@ class OpenAPI {
|
|
|
640
640
|
* @param {string} group
|
|
641
641
|
*/
|
|
642
642
|
async writeConfigInfo(group) {
|
|
643
|
-
|
|
643
|
+
const nextReadTimeout = ReadAfterWriteTimeoutIntervalInS;
|
|
644
644
|
try {
|
|
645
645
|
this.adapter.stopGroupWriteTimeout(group);
|
|
646
646
|
this.adapter.stopGroupTimeout(group);
|
|
@@ -651,8 +651,10 @@ class OpenAPI {
|
|
|
651
651
|
const gidx = this.stateInfoList.findIndex((/** @type {{ Group: string; }} */ i) => i.Group == group);
|
|
652
652
|
if (gidx >= 0) {
|
|
653
653
|
|
|
654
|
-
|
|
655
|
-
|
|
654
|
+
// The openAPI (and closedAPI anyway) allows smaller intervals again to read data.
|
|
655
|
+
// Therefore we do no more need to wait the complete intarval to read back the changed value.
|
|
656
|
+
// const groupInfo = this.stateInfoList[gidx];
|
|
657
|
+
// nextReadTimeout = this.adapter.jsonConfig.items[groupInfo.intervalName].min * groupInfo.intervalFactor;
|
|
656
658
|
|
|
657
659
|
const groupStates = this.stateInfoList[gidx].states;
|
|
658
660
|
for (let i = 0; i < groupStates.length; i++) {
|
|
@@ -1965,67 +1967,71 @@ class AlphaEss extends utils.Adapter {
|
|
|
1965
1967
|
this.log.info('States will be migrated.');
|
|
1966
1968
|
}
|
|
1967
1969
|
|
|
1968
|
-
|
|
1970
|
+
if (this.config.apiType == 3) { // For future possibility to disable Closed API
|
|
1971
|
+
this.log.error('Closed API: Sorry, Closed API currently not supported because of changes by Alpha-ESS.');
|
|
1972
|
+
}
|
|
1973
|
+
else {
|
|
1974
|
+
await this.closedApi.resetAuth();
|
|
1969
1975
|
|
|
1970
|
-
|
|
1971
|
-
|
|
1976
|
+
if (this.config.apiType == 0 && this.config.password && this.config.username && this.config.systemId ||
|
|
1977
|
+
this.config.apiType == 1 && this.config.appID && this.config.appSecret && this.config.systemId) {
|
|
1972
1978
|
|
|
1973
|
-
|
|
1974
|
-
|
|
1979
|
+
for (const gidx of Object.keys(this.getStateInfoList())) {
|
|
1980
|
+
const groupInfo = this.getStateInfoList()[gidx];
|
|
1975
1981
|
|
|
1976
|
-
|
|
1977
|
-
|
|
1982
|
+
groupInfo.interval = this.config[groupInfo.intervalName] * groupInfo.intervalFactor;
|
|
1983
|
+
this.log.debug(`${groupInfo.intervalName}: ${groupInfo.interval}`);
|
|
1978
1984
|
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
+
if (this.jsonConfig.items[groupInfo.intervalName] && this.jsonConfig.items[groupInfo.intervalName].min) {
|
|
1986
|
+
if (groupInfo.interval < this.jsonConfig.items[groupInfo.intervalName].min * groupInfo.intervalFactor) {
|
|
1987
|
+
const oldVal = groupInfo.interval;
|
|
1988
|
+
groupInfo.interval = this.jsonConfig.items[groupInfo.intervalName].min * groupInfo.intervalFactor;
|
|
1989
|
+
if (this.config[groupInfo.enabledName]) {
|
|
1990
|
+
this.log.warn(`Configured interval ${oldVal} for ${groupInfo.Group} no longer supported. Changed to ${groupInfo.interval}. Please change your configuration!`);
|
|
1991
|
+
}
|
|
1985
1992
|
}
|
|
1986
1993
|
}
|
|
1987
|
-
}
|
|
1988
1994
|
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1995
|
+
if (this.config[groupInfo.enabledName]) {
|
|
1996
|
+
await this.setQualityForGroup(groupInfo.Group, 0x2);
|
|
1997
|
+
await groupInfo.fnct(groupInfo.Group);
|
|
1998
|
+
}
|
|
1999
|
+
else {
|
|
2000
|
+
this.log.info(groupInfo.Group + ' data disabled! Adapter won\'t fetch ' + groupInfo.Group + ' data. According states deleted.');
|
|
2001
|
+
await this.delObjectAsync(groupInfo.Group, { recursive: true });
|
|
2002
|
+
}
|
|
1996
2003
|
}
|
|
1997
2004
|
}
|
|
1998
|
-
}
|
|
1999
|
-
else {
|
|
2000
|
-
if (this.config.apiType == 0) {
|
|
2001
|
-
this.log.error('Closed API: No username, password and/or system ID set! Adapter won\'t fetch any data.');
|
|
2002
|
-
}
|
|
2003
2005
|
else {
|
|
2004
|
-
this.
|
|
2006
|
+
if (this.config.apiType == 0) {
|
|
2007
|
+
this.log.error('Closed API: No username, password and/or system ID set! Adapter won\'t fetch any data.');
|
|
2008
|
+
}
|
|
2009
|
+
else {
|
|
2010
|
+
this.log.error('Open API: No appID, appSecret and/or system ID set! Adapter won\'t fetch any data.');
|
|
2011
|
+
}
|
|
2005
2012
|
}
|
|
2013
|
+
this.watchDogIntervalHandle = this.setInterval(this.watchDogFunction, WATCHDOG_TIMER);
|
|
2014
|
+
this.log.debug('Watchdog interval started!');
|
|
2006
2015
|
}
|
|
2007
|
-
|
|
2008
|
-
await this.setStateAsync('info.version', this.version, true);
|
|
2016
|
+
await this.setStateAsync('info.version', '' + this.version, true);
|
|
2009
2017
|
}
|
|
2010
2018
|
catch (e) {
|
|
2011
2019
|
this.log.error('onReady Exception occurred: ' + e);
|
|
2012
2020
|
}
|
|
2013
|
-
this.watchDogIntervalHandle = this.setInterval(this.watchDogFunction, WATCHDOG_TIMER);
|
|
2014
|
-
this.log.debug('Watchdog interval started!');
|
|
2015
2021
|
}
|
|
2016
2022
|
|
|
2017
2023
|
/**
|
|
2018
2024
|
* Is called when adapter shuts down - callback has to be called under any circumstances!
|
|
2019
2025
|
* @param {() => void} callback
|
|
2020
2026
|
*/
|
|
2021
|
-
onUnload(callback) {
|
|
2027
|
+
async onUnload(callback) {
|
|
2022
2028
|
try {
|
|
2023
2029
|
// Clear all timers
|
|
2024
2030
|
for (const gidx of Object.keys(this.getStateInfoList())) {
|
|
2025
2031
|
const group = this.getStateInfoList()[gidx].Group;
|
|
2026
2032
|
this.stopGroupTimeout(group);
|
|
2027
2033
|
this.stopGroupWriteTimeout(group);
|
|
2028
|
-
this.setQualityForGroup(group, 0x12);
|
|
2034
|
+
await this.setQualityForGroup(group, 0x12);
|
|
2029
2035
|
}
|
|
2030
2036
|
|
|
2031
2037
|
if (this.watchDogIntervalHandle) {
|
|
@@ -2163,7 +2169,7 @@ class AlphaEss extends utils.Adapter {
|
|
|
2163
2169
|
const gidx = this.getStateInfoList().findIndex((/** @type {{ Group: string; }} */ i) => i.Group == group);
|
|
2164
2170
|
if (this.getStateInfoList()[gidx].timeoutHandle) {
|
|
2165
2171
|
this.log.debug('Timeout cleared for group ' + group);
|
|
2166
|
-
clearTimeout(this.getStateInfoList()[gidx].timeoutHandle);
|
|
2172
|
+
this.clearTimeout(this.getStateInfoList()[gidx].timeoutHandle);
|
|
2167
2173
|
this.getStateInfoList()[gidx].timeoutHandle = 0;
|
|
2168
2174
|
}
|
|
2169
2175
|
}
|
|
@@ -2178,7 +2184,7 @@ class AlphaEss extends utils.Adapter {
|
|
|
2178
2184
|
if (!this.getStateInfoList()[gidx].timeoutHandle) {
|
|
2179
2185
|
const interval = this.calculateIntervalInMs(intervalInS, group);
|
|
2180
2186
|
this.log.debug('Timeout with interval ' + interval + ' ms started for group ' + group);
|
|
2181
|
-
this.getStateInfoList()[gidx].timeoutHandle = setTimeout(() => { this.getStateInfoList()[gidx].fnct(group); }, interval);
|
|
2187
|
+
this.getStateInfoList()[gidx].timeoutHandle = this.setTimeout(() => { this.getStateInfoList()[gidx].fnct(group); }, interval);
|
|
2182
2188
|
}
|
|
2183
2189
|
}
|
|
2184
2190
|
|
|
@@ -2191,7 +2197,7 @@ class AlphaEss extends utils.Adapter {
|
|
|
2191
2197
|
const gidx = this.getStateInfoList().findIndex((/** @type {{ Group: string; }} */ i) => i.Group == group);
|
|
2192
2198
|
if (this.getStateInfoList()[gidx].writeTimeoutHandle) {
|
|
2193
2199
|
this.log.debug('Write Timeout cleared for group ' + group);
|
|
2194
|
-
clearTimeout(this.getStateInfoList()[gidx].writeTimeoutHandle);
|
|
2200
|
+
this.clearTimeout(this.getStateInfoList()[gidx].writeTimeoutHandle);
|
|
2195
2201
|
this.getStateInfoList()[gidx].writeTimeoutHandle = 0;
|
|
2196
2202
|
}
|
|
2197
2203
|
}
|
|
@@ -2208,7 +2214,7 @@ class AlphaEss extends utils.Adapter {
|
|
|
2208
2214
|
this.log.debug('Write Timeout with interval ' + interval + ' ms started for group ' + group);
|
|
2209
2215
|
const wf = this.getStateInfoList()[gidx].writeFnct;
|
|
2210
2216
|
if (wf) {
|
|
2211
|
-
this.getStateInfoList()[gidx].writeTimeoutHandle = setTimeout(() => { wf(group); }, interval);
|
|
2217
|
+
this.getStateInfoList()[gidx].writeTimeoutHandle = this.setTimeout(() => { wf(group); }, interval);
|
|
2212
2218
|
}
|
|
2213
2219
|
}
|
|
2214
2220
|
}
|
|
@@ -2284,23 +2290,29 @@ class AlphaEss extends utils.Adapter {
|
|
|
2284
2290
|
for (const [alphaAttrName, rawValue] of Object.entries(data)) {
|
|
2285
2291
|
const stateInfo = this.getStateInfoByAlphaAttrName(group, alphaAttrName);
|
|
2286
2292
|
if (stateInfo) {
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2293
|
+
// The type checker has a problem with type: stateInfo.type. I have no clue why.
|
|
2294
|
+
// All possible types are correct and valid. To get rid of the type checker error, we check for valid types:
|
|
2295
|
+
if (stateInfo.type == 'string' || stateInfo.type == 'boolean' || stateInfo.type == 'number') {
|
|
2296
|
+
await setObjectFunc(group + '.' + this.osn(stateInfo.id), {
|
|
2297
|
+
type: 'state',
|
|
2298
|
+
common: {
|
|
2299
|
+
name: stateInfo.name + ' [' + stateInfo.alphaAttrName + ']'
|
|
2300
|
+
, type: stateInfo.type
|
|
2301
|
+
, role: stateInfo.role
|
|
2302
|
+
, read: true
|
|
2303
|
+
, write: stateInfo.writeable ? stateInfo.writeable : false
|
|
2304
|
+
, unit: stateInfo.unit === '{money_type}' ? data['money_type'] : stateInfo.unit === '{moneyType}' ? data['moneyType'] : stateInfo.unit
|
|
2305
|
+
, desc: stateInfo.alphaAttrName
|
|
2306
|
+
},
|
|
2307
|
+
native: {},
|
|
2308
|
+
});
|
|
2309
|
+
if (stateInfo.writeable) {
|
|
2310
|
+
await this.subscribeStatesAsync(`${group}.${stateInfo.id}`);
|
|
2311
|
+
this.log.debug(`Subscribed State: ${group}.${stateInfo.id}`);
|
|
2312
|
+
}
|
|
2313
|
+
}
|
|
2314
|
+
else {
|
|
2315
|
+
this.log.error('Internal error: Skipped object ' + group + '.' + alphaAttrName + ' with value ' + rawValue + ' because of invalid type definition!');
|
|
2304
2316
|
}
|
|
2305
2317
|
}
|
|
2306
2318
|
else {
|
|
@@ -2421,18 +2433,25 @@ class AlphaEss extends utils.Adapter {
|
|
|
2421
2433
|
* @param {number} q
|
|
2422
2434
|
*/
|
|
2423
2435
|
async setQualityForGroup(group, q) {
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
const
|
|
2427
|
-
|
|
2428
|
-
newState.
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2436
|
+
try {
|
|
2437
|
+
const states = await this.getStatesAsync(group + '.*');
|
|
2438
|
+
for (const sid in states) {
|
|
2439
|
+
const newState = states[sid];
|
|
2440
|
+
if (newState.ack) {
|
|
2441
|
+
newState.q = q;
|
|
2442
|
+
this.log.debug(`Set state ${sid} to val: ${newState.val}; q: ${newState.q}; ack: ${newState.ack}`);
|
|
2443
|
+
await this.setStateAsync(sid, newState, true);
|
|
2444
|
+
}
|
|
2445
|
+
else {
|
|
2446
|
+
this.log.debug(`Set state ${sid} NOT to val: ${newState.val}; q: ${newState.q} because ack of this state is ${newState.ack}`);
|
|
2447
|
+
}
|
|
2434
2448
|
}
|
|
2435
2449
|
}
|
|
2450
|
+
catch (e) {
|
|
2451
|
+
this.log.error('setQualityForGroup Exception occurred: ' + e);
|
|
2452
|
+
this.log.info('Group: ' + group);
|
|
2453
|
+
return null;
|
|
2454
|
+
}
|
|
2436
2455
|
}
|
|
2437
2456
|
|
|
2438
2457
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.alpha-ess",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Read and write data from and to Alpha ESS systems.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Gaspode",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"node": ">= 16"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@iobroker/adapter-core": "^3.0.
|
|
22
|
+
"@iobroker/adapter-core": "^3.0.4",
|
|
23
23
|
"axios": "^1.5.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@tsconfig/node14": "^14.1.0",
|
|
33
33
|
"@tsconfig/node18": "^18.2.2",
|
|
34
34
|
"@types/chai": "^4.3.5",
|
|
35
|
-
"@types/chai-as-promised": "^7.1.
|
|
35
|
+
"@types/chai-as-promised": "^7.1.7",
|
|
36
36
|
"@types/mocha": "^10.0.2",
|
|
37
37
|
"@types/node": "^20.8.0",
|
|
38
38
|
"@types/proxyquire": "^1.3.28",
|
|
@@ -40,7 +40,7 @@
|
|
|
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.
|
|
43
|
+
"eslint": "^8.52.0",
|
|
44
44
|
"eslint-config-prettier": "^9.0.0",
|
|
45
45
|
"eslint-plugin-prettier": "^4.2.1",
|
|
46
46
|
"mocha": "^10.2.0",
|