iobroker.alpha-ess 2.2.0 → 2.3.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 +3 -0
- 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 +10 -0
- package/io-package.json +15 -14
- package/main.js +161 -38
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,6 +61,9 @@ How to find SN and Check code for registration is described here: https://github
|
|
|
61
61
|
**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.**
|
|
62
62
|
|
|
63
63
|
## Changelog
|
|
64
|
+
### 2.3.0 (2024-12-20)
|
|
65
|
+
|
|
66
|
+
- (Gaspode) Provides the ability to read pseudo-realtime power data using the API function getTodayPowerBySn. This feature is useful for systems that lack "realtime data support." When activated, data is fetched every 5 minutes and stored in the "Recent" folder.
|
|
64
67
|
|
|
65
68
|
### 2.2.0 (2024-12-16)
|
|
66
69
|
|
|
@@ -15,5 +15,6 @@
|
|
|
15
15
|
"Interval to read discharging settings": "Intervall zum Lesen der Entladeeinstellungen [min]",
|
|
16
16
|
"Interval to read wallbox data": "Intervall zum Auslesen der Wallbox-Daten [min]",
|
|
17
17
|
"Sorry. Closed API currently not supported!": "Entschuldigung. Closed API wird aufgrund von Änderungen durch Alpha-ESS derzeit nicht unterstützt!",
|
|
18
|
-
"Interval to read system information data": "Intervall zum Lesen von Systeminformationsdaten [s]"
|
|
18
|
+
"Interval to read system information data": "Intervall zum Lesen von Systeminformationsdaten [s]",
|
|
19
|
+
"Get recent power data every 5 minutes (for systems with no realtime data)": "Lese alle 5 Minuten Pseudo-Echtzeit-Leistungsdaten (für Systeme ohne Echtzeitdatenunterstützung)"
|
|
19
20
|
}
|
|
@@ -15,5 +15,6 @@
|
|
|
15
15
|
"Interval to read charging settings": "Interval to read charging settings [min]",
|
|
16
16
|
"Interval to read discharging settings": "Interval to read discharging settings [min]",
|
|
17
17
|
"Interval to read wallbox data": "Interval to read wallbox data [min]",
|
|
18
|
-
"Sorry. Closed API currently not supported!": "Sorry. Closed API currently not supported due to changes by Alpha-ESS!"
|
|
18
|
+
"Sorry. Closed API currently not supported!": "Sorry. Closed API currently not supported due to changes by Alpha-ESS!",
|
|
19
|
+
"Get recent power data every 5 minutes (for systems with no realtime data)": "Get recent power data every 5 minutes (for systems with no realtime data support)"
|
|
19
20
|
}
|
|
@@ -15,5 +15,6 @@
|
|
|
15
15
|
"Interval to read discharging settings": "Intervalo para leer la configuración de descarga",
|
|
16
16
|
"Interval to read wallbox data": "Intervalo para leer los datos del wallbox [min]",
|
|
17
17
|
"Sorry. Closed API currently not supported!": "Lo siento. ¡La API cerrada actualmente no es compatible debido a cambios realizados por Alpha-ESS!",
|
|
18
|
-
"Interval to read system information data": "Intervalo para leer datos de información del sistema [s]"
|
|
18
|
+
"Interval to read system information data": "Intervalo para leer datos de información del sistema [s]",
|
|
19
|
+
"Get recent power data every 5 minutes (for systems with no realtime data)": "Obtenga datos de energía recientes cada 5 minutos (para sistemas sin soporte de datos en tiempo real)"
|
|
19
20
|
}
|
|
@@ -15,5 +15,6 @@
|
|
|
15
15
|
"Interval to read discharging settings": "Intervalle pour lire les paramètres de décharge",
|
|
16
16
|
"Interval to read wallbox data": "Intervalle de lecture des données de la wallbox [min]",
|
|
17
17
|
"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 !",
|
|
18
|
-
"Interval to read system information data": "Intervalle de lecture des données d'informations système [s]"
|
|
18
|
+
"Interval to read system information data": "Intervalle de lecture des données d'informations système [s]",
|
|
19
|
+
"Get recent power data every 5 minutes (for systems with no realtime data)": "Obtenez des données de puissance récentes toutes les 5 minutes (pour les systèmes sans prise en charge des données en temps réel)"
|
|
19
20
|
}
|
|
@@ -15,5 +15,6 @@
|
|
|
15
15
|
"Interval to read discharging settings": "Intervallo per leggere le impostazioni di scarica",
|
|
16
16
|
"Interval to read wallbox data": "Intervallo per leggere i dati della Wallbox [min]",
|
|
17
17
|
"Sorry. Closed API currently not supported!": "Scusa. API chiusa attualmente non supportata a causa di modifiche apportate da Alpha-ESS!",
|
|
18
|
-
"Interval to read system information data": "Intervallo per leggere i dati delle informazioni di sistema [s]"
|
|
18
|
+
"Interval to read system information data": "Intervallo per leggere i dati delle informazioni di sistema [s]",
|
|
19
|
+
"Get recent power data every 5 minutes (for systems with no realtime data)": "Ottieni dati energetici recenti ogni 5 minuti (per sistemi senza supporto dati in tempo reale)"
|
|
19
20
|
}
|
|
@@ -15,5 +15,6 @@
|
|
|
15
15
|
"Interval to read discharging settings": "Interval om ontlaadinstellingen te lezen",
|
|
16
16
|
"Interval to read wallbox data": "Interval voor het lezen van wallbox-gegevens [min]",
|
|
17
17
|
"Sorry. Closed API currently not supported!": "Sorry. Gesloten API momenteel niet ondersteund vanwege wijzigingen door Alpha-ESS!",
|
|
18
|
-
"Interval to read system information data": "Interval voor het lezen van systeeminformatiegegevens [s]"
|
|
18
|
+
"Interval to read system information data": "Interval voor het lezen van systeeminformatiegegevens [s]",
|
|
19
|
+
"Get recent power data every 5 minutes (for systems with no realtime data)": "Ontvang elke 5 minuten recente stroomgegevens (voor systemen zonder realtime gegevensondersteuning)"
|
|
19
20
|
}
|
|
@@ -15,5 +15,6 @@
|
|
|
15
15
|
"Interval to read discharging settings": "Interwał odczytu ustawień rozładowania",
|
|
16
16
|
"Interval to read wallbox data": "Interwał odczytu danych wallboxa [min]",
|
|
17
17
|
"Sorry. Closed API currently not supported!": "Przepraszam. Zamknięte API obecnie nie jest obsługiwane ze względu na zmiany wprowadzone przez Alpha-ESS!",
|
|
18
|
-
"Interval to read system information data": "Interwał odczytu danych informacyjnych systemu [s]"
|
|
18
|
+
"Interval to read system information data": "Interwał odczytu danych informacyjnych systemu [s]",
|
|
19
|
+
"Get recent power data every 5 minutes (for systems with no realtime data)": "Uzyskaj najnowsze dane dotyczące zasilania co 5 minut (w przypadku systemów bez obsługi danych w czasie rzeczywistym)"
|
|
19
20
|
}
|
|
@@ -15,5 +15,6 @@
|
|
|
15
15
|
"Interval to read discharging settings": "Intervalo para ler as configurações de descarga",
|
|
16
16
|
"Interval to read wallbox data": "Intervalo para leitura dos dados da Wallbox [min]",
|
|
17
17
|
"Sorry. Closed API currently not supported!": "Desculpe. API fechada atualmente não suportada devido a alterações do Alpha-ESS!",
|
|
18
|
-
"Interval to read system information data": "Intervalo para leitura de dados de informações do sistema"
|
|
18
|
+
"Interval to read system information data": "Intervalo para leitura de dados de informações do sistema",
|
|
19
|
+
"Get recent power data every 5 minutes (for systems with no realtime data)": "Obtenha dados de energia recentes a cada 5 minutos (para sistemas sem suporte de dados em tempo real)"
|
|
19
20
|
}
|
|
@@ -15,5 +15,6 @@
|
|
|
15
15
|
"Interval to read discharging settings": "Интервал чтения настроек разрядки",
|
|
16
16
|
"Interval to read wallbox data": "Интервал чтения данных Wallbox [мин]",
|
|
17
17
|
"Sorry. Closed API currently not supported!": "Извини. Закрытый API в настоящее время не поддерживается из-за изменений Alpha-ESS!",
|
|
18
|
-
"Interval to read system information data": "Интервал чтения данных системной информации [с]"
|
|
18
|
+
"Interval to read system information data": "Интервал чтения данных системной информации [с]",
|
|
19
|
+
"Get recent power data every 5 minutes (for systems with no realtime data)": "Получайте последние данные о питании каждые 5 минут (для систем без поддержки данных в реальном времени)"
|
|
19
20
|
}
|
|
@@ -15,5 +15,6 @@
|
|
|
15
15
|
"Interval to read discharging settings": "Інтервал зчитування параметрів розрядки",
|
|
16
16
|
"Interval to read wallbox data": "Інтервал зчитування даних Wallbox [хв]",
|
|
17
17
|
"Sorry. Closed API currently not supported!": "вибач Закритий API наразі не підтримується через зміни Alpha-ESS!",
|
|
18
|
-
"Interval to read system information data": "Інтервал читання системної інформації [с]"
|
|
18
|
+
"Interval to read system information data": "Інтервал читання системної інформації [с]",
|
|
19
|
+
"Get recent power data every 5 minutes (for systems with no realtime data)": "Отримувати останні дані про живлення кожні 5 хвилин (для систем без підтримки даних у реальному часі)"
|
|
19
20
|
}
|
|
@@ -15,5 +15,6 @@
|
|
|
15
15
|
"Interval to read discharging settings": "读取放电设置的间隔",
|
|
16
16
|
"Interval to read wallbox data": "读取 Wallbox 数据的时间间隔 [min]",
|
|
17
17
|
"Sorry. Closed API currently not supported!": "对不起。由于 Alpha-ESS 的更改,目前不支持封闭 API!",
|
|
18
|
-
"Interval to read system information data": "读取系统信息数据的时间间隔[s]"
|
|
18
|
+
"Interval to read system information data": "读取系统信息数据的时间间隔[s]",
|
|
19
|
+
"Get recent power data every 5 minutes (for systems with no realtime data)": "每 5 分钟获取一次最新电量数据(适用于不支持实时数据的系统)"
|
|
19
20
|
}
|
package/admin/jsonConfig.json
CHANGED
|
@@ -54,6 +54,16 @@
|
|
|
54
54
|
"newLine": false,
|
|
55
55
|
"disabled": "!data.oAEnableRealtime"
|
|
56
56
|
},
|
|
57
|
+
"oAEnableRecent": {
|
|
58
|
+
"xs": 9.9,
|
|
59
|
+
"sm": 7.4,
|
|
60
|
+
"md": 3.6,
|
|
61
|
+
"lg": 2.8,
|
|
62
|
+
"xl": 2.8,
|
|
63
|
+
"type": "checkbox",
|
|
64
|
+
"newLine": true,
|
|
65
|
+
"label": "Get recent power data every 5 minutes (for systems with no realtime data)"
|
|
66
|
+
},
|
|
57
67
|
"oAEnableEssList": {
|
|
58
68
|
"xs": 1.1,
|
|
59
69
|
"sm": 0.6,
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "alpha-ess",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.3.0",
|
|
5
5
|
"news": {
|
|
6
|
+
"2.3.0": {
|
|
7
|
+
"en": "Provides the ability to read pseudo-realtime power data using the API function getTodayPowerBySn. This feature is useful for systems that lack \"realtime data support.\" When activated, data is fetched every 5 minutes and stored in the \"Recent\" folder.",
|
|
8
|
+
"de": "Bietet die Möglichkeit, pseudo-realtime Stromdaten mit der API-Funktion getTodayPowerBySn zu lesen. Diese Funktion ist nützlich für Systeme, die keinen \"Realtime Data Support\" haben. Wenn aktiviert, werden alle 5 Minuten Daten gelesen und im Ordner \"Recent\" gespeichert.",
|
|
9
|
+
"ru": "Предоставляет возможность чтения псевдо-в реальном времени данных питания с использованием функции API getTodayPowerBySn. Эта функция полезна для систем, которые не имеют «поддержки данных в реальном времени». При активации данные загружаются каждые 5 минут и хранятся в папке «Recent».",
|
|
10
|
+
"pt": "Fornece a capacidade de ler dados de energia pseudo-realtime usando a função API getTodayPowerBySn. Esse recurso é útil para sistemas que não possuem \"apoio de dados em tempo real\". Quando ativado, os dados são obtidos a cada 5 minutos e armazenados na pasta \"Recente\".",
|
|
11
|
+
"nl": "Biedt de mogelijkheid om pseudo-realtime power data te lezen met behulp van de API-functie krijgenTodayPowerBySn. Deze functie is nuttig voor systemen die geen \"realtime data support\" hebben. Wanneer geactiveerd, worden de gegevens elke 5 minuten opgehaald en opgeslagen in de \"Recent\" map.",
|
|
12
|
+
"fr": "Fournit la possibilité de lire des données de puissance pseudo-réel en utilisant la fonction API getTodayPowerBySn. Cette fonctionnalité est utile pour les systèmes qui manquent de « support de données en temps réel ». Une fois activé, les données sont récupérées toutes les 5 minutes et stockées dans le dossier \"Récent\".",
|
|
13
|
+
"it": "Fornisce la capacità di leggere i dati di potenza pseudo-realtime utilizzando la funzione API getTodayPowerBySn. Questa funzione è utile per i sistemi che mancano di \"supporto dati realtime\". Quando si attiva, i dati vengono recuperati ogni 5 minuti e memorizzati nella cartella \"Recent\".",
|
|
14
|
+
"es": "Proporciona la capacidad de leer datos de energía pseudo-realtime usando la función API getTodayPowerBySn. Esta característica es útil para sistemas que carecen de \"apoyo de datos en tiempo real\". Cuando se activa, los datos se recogen cada 5 minutos y se almacenan en la carpeta \"Recent\".",
|
|
15
|
+
"pl": "Zapewnia możliwość odczytu danych o mocy pseudo-realtime za pomocą funkcji API getTodayPowerBySn. Funkcja ta jest przydatna dla systemów, którym brakuje \"wsparcia danych w czasie rzeczywistym\". Po aktywowaniu dane są pobierane co 5 minut i przechowywane w folderze \"Najnowsze\".",
|
|
16
|
+
"uk": "Забезпечує можливість читати дані псевдореального часу за допомогою функції API getTodayPowerBySn. Ця функція є корисною для систем, які не мають підтримки загальних даних. При активації дані подаються кожні 5 хвилин і зберігаються в папці \"Відсоток\".",
|
|
17
|
+
"zh-cn": "提供使用API函数get TodayPowerBySn读取伪实时功率数据的能力. 这个特性对于缺乏\"实时数据支持\"的系统是有用的. 当启动时,数据每5分钟获取一次,并存储在\"Recent\"文件夹中."
|
|
18
|
+
},
|
|
6
19
|
"2.2.0": {
|
|
7
20
|
"en": "Provide system information data (getEssList)",
|
|
8
21
|
"de": "Lesen von System-Informationsdaten (getEssList)",
|
|
@@ -80,19 +93,6 @@
|
|
|
80
93
|
"pl": "Jakość państw zoptymalizowanych",
|
|
81
94
|
"uk": "Якість держав оптимізовано",
|
|
82
95
|
"zh-cn": "国家质量得到优化"
|
|
83
|
-
},
|
|
84
|
-
"2.1.1": {
|
|
85
|
-
"en": "Do not longer report read timeouts as error. It should be enough to set the quality of concerned states to values according the table above and to display warnings, if values were not updated for a long time. To see details, debug log level must be enabled by the user.",
|
|
86
|
-
"de": "Read Timeouts werden nicht länger als Fehler im Log angezeigt. Es sollte ausreichen, dass die Quality der betreffenden States auf Werte gemäß der obigen Tabelle gesetzt wird und dass Warnungen angezeigt werden, wenn Werte lange nicht aktualisiert wurden. Um Details zu sehen, muss der Log-Level Debug vom Benutzer aktiviert werden.",
|
|
87
|
-
"ru": "Не сообщайте больше о времени чтения как об ошибке. Это должно быть достаточно, чтобы установить качество соответствующих состояний к значениям согласно таблице выше и отображать предупреждения, если значения не обновлялись в течение длительного времени. Чтобы увидеть детали, уровень отладки журнала должен быть включен пользователем.",
|
|
88
|
-
"pt": "Não reporte mais tempo de leitura como erro. Deve ser suficiente definir a qualidade dos estados em causa para valores de acordo com a tabela acima e para exibir avisos, se os valores não foram atualizados por muito tempo. Para ver detalhes, o nível de log de depuração deve ser ativado pelo usuário.",
|
|
89
|
-
"nl": "Niet langer lezen time-outs rapporteren als fout. Het zou voldoende moeten zijn om de kwaliteit van de betrokken staten vast te stellen op waarden volgens bovenstaande tabel en waarschuwingen weer te geven, indien de waarden lange tijd niet werden bijgewerkt. Om details te zien, moet het debug-logniveau door de gebruiker worden ingeschakeld.",
|
|
90
|
-
"fr": "Ne déclarez plus les temps de lecture comme erreur. Il devrait suffire de fixer la qualité des états concernés à des valeurs selon le tableau ci-dessus et d'afficher des avertissements, si les valeurs ne sont pas mises à jour pendant longtemps. Pour voir les détails, le niveau de débogage doit être activé par l'utilisateur.",
|
|
91
|
-
"it": "Non report più i timeout di lettura come errore. Dovrebbe essere sufficiente impostare la qualità degli stati interessati ai valori secondo la tabella sopra e mostrare avvisi, se i valori non sono stati aggiornati per molto tempo. Per visualizzare i dettagli, il livello di registro del debug deve essere abilitato dall'utente.",
|
|
92
|
-
"es": "No reporte más tiempo de lectura como error. Debe ser suficiente para establecer la calidad de los estados interesados a valores según la tabla anterior y para mostrar advertencias, si los valores no se actualizaron durante mucho tiempo. Para ver detalles, el nivel de registro de depuración debe ser habilitado por el usuario.",
|
|
93
|
-
"pl": "Nie raportuj już timeout jako błąd. Powinno wystarczyć ustawić jakość danych państw na wartości zgodnie z powyższą tabelą oraz wyświetlić ostrzeżenia, jeżeli wartości nie były aktualizowane przez długi czas. Aby zobaczyć szczegóły, poziom dziennika debugowania musi być włączony przez użytkownika.",
|
|
94
|
-
"uk": "Не довший звіт про те, як помилка. Для того, щоб встановити якість занепокоєних станів до значень, зазначених вище таблиці та для відображення попередження, якщо значення не було оновлено протягом тривалого часу. Щоб дізнатися подробиці, рівень дебюг повинен бути включений користувачем.",
|
|
95
|
-
"zh-cn": "不再将超时读取为错误 。 如果长期不更新有关数值,则应该足以按照上表的数值确定有关国家的质量,并显示警告。 要查看细节,调试日志级别必须由用户启用."
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
|
@@ -173,6 +173,7 @@
|
|
|
173
173
|
"systemId": "",
|
|
174
174
|
"oAEnableRealtime": true,
|
|
175
175
|
"oAIntervalRealtime": 30,
|
|
176
|
+
"oAEnableRecent": false,
|
|
176
177
|
"oAEnableEssList": true,
|
|
177
178
|
"oAIntervalEssList": 30,
|
|
178
179
|
"oAEnableEnergy": true,
|
package/main.js
CHANGED
|
@@ -216,6 +216,71 @@ class OpenAPI {
|
|
|
216
216
|
},
|
|
217
217
|
],
|
|
218
218
|
},
|
|
219
|
+
{
|
|
220
|
+
Group: 'Recent',
|
|
221
|
+
fnct: this.getLatestTodayPowerBySn.bind(this),
|
|
222
|
+
enabledName: 'oAEnableRecent',
|
|
223
|
+
intervalFactor: 1, // For scheduled group not used
|
|
224
|
+
isSchedule: true,
|
|
225
|
+
states: [
|
|
226
|
+
{
|
|
227
|
+
alphaAttrName: 'ppv',
|
|
228
|
+
role: 'value.power',
|
|
229
|
+
id: 'PV_power_total',
|
|
230
|
+
name: 'PV power total',
|
|
231
|
+
type: 'number',
|
|
232
|
+
unit: 'W',
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
alphaAttrName: 'load',
|
|
236
|
+
role: 'value.power',
|
|
237
|
+
id: 'Load_total',
|
|
238
|
+
name: 'Load total',
|
|
239
|
+
type: 'number',
|
|
240
|
+
unit: 'W',
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
alphaAttrName: 'cbat',
|
|
244
|
+
role: 'value.battery',
|
|
245
|
+
id: 'Battery_SOC',
|
|
246
|
+
name: 'State of charge',
|
|
247
|
+
type: 'number',
|
|
248
|
+
unit: '%',
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
alphaAttrName: 'gridCharge',
|
|
252
|
+
role: 'value.power',
|
|
253
|
+
id: 'Grid_power_total_charge',
|
|
254
|
+
name: 'Grid power total charge',
|
|
255
|
+
type: 'number',
|
|
256
|
+
unit: 'W',
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
alphaAttrName: 'feedIn',
|
|
260
|
+
role: 'value.power',
|
|
261
|
+
id: 'Grid_power_total_feedin',
|
|
262
|
+
name: 'Grid power total feedin',
|
|
263
|
+
type: 'number',
|
|
264
|
+
unit: 'W',
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
alphaAttrName: 'pchargingPile',
|
|
268
|
+
role: 'value.power',
|
|
269
|
+
id: 'Charging_pile_power_total',
|
|
270
|
+
name: 'Charging pile (Wallbox) power total',
|
|
271
|
+
type: 'number',
|
|
272
|
+
unit: 'W',
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
alphaAttrName: 'sysSn',
|
|
276
|
+
role: 'text',
|
|
277
|
+
id: 'System_SN',
|
|
278
|
+
name: 'System S/N',
|
|
279
|
+
type: 'string',
|
|
280
|
+
unit: null,
|
|
281
|
+
},
|
|
282
|
+
],
|
|
283
|
+
},
|
|
219
284
|
{
|
|
220
285
|
Group: 'System',
|
|
221
286
|
fnct: this.getEssList.bind(this),
|
|
@@ -773,7 +838,7 @@ class OpenAPI {
|
|
|
773
838
|
*/
|
|
774
839
|
async getLastPowerData(group) {
|
|
775
840
|
try {
|
|
776
|
-
this.adapter.stopGroupTimeout(group);
|
|
841
|
+
await this.adapter.stopGroupTimeout(group);
|
|
777
842
|
|
|
778
843
|
this.adapter.log.debug(`Fetching ${group} data...`);
|
|
779
844
|
|
|
@@ -790,9 +855,50 @@ class OpenAPI {
|
|
|
790
855
|
await this.startGroupTimeout(group);
|
|
791
856
|
}
|
|
792
857
|
|
|
858
|
+
/**
|
|
859
|
+
* @param group Group name
|
|
860
|
+
*/
|
|
861
|
+
async getLatestTodayPowerBySn(group) {
|
|
862
|
+
try {
|
|
863
|
+
await this.adapter.stopGroupTimeout(group);
|
|
864
|
+
this.adapter.log.debug(`Fetching ${group} data...`);
|
|
865
|
+
|
|
866
|
+
const dt = new Date();
|
|
867
|
+
const dts = `${dt.getFullYear()}-${`0${dt.getMonth() + 1}`.slice(-2)}-${`0${dt.getDate()}`.slice(-2)}`;
|
|
868
|
+
const res = await this.getRequest(
|
|
869
|
+
`getOneDayPowerBySn?sysSn=${this.adapter.config.systemId}&queryDate=${dts}`,
|
|
870
|
+
{},
|
|
871
|
+
);
|
|
872
|
+
if (res && res['status'] == 200 && res.data && res.data.data) {
|
|
873
|
+
const latestEntry = res.data.data.reduce((latest, current) => {
|
|
874
|
+
return new Date(current.uploadTime) > new Date(latest.uploadTime) ? current : latest;
|
|
875
|
+
});
|
|
876
|
+
if (latestEntry.uploadTime != null) {
|
|
877
|
+
const deliveredTs = new Date(latestEntry.uploadTime.replace(' ', 'T')).getTime();
|
|
878
|
+
if (Date.now() - deliveredTs < 300000) {
|
|
879
|
+
// ensure that the data is not older than 5 minutes
|
|
880
|
+
await this.adapter.createAndUpdateStates(group, latestEntry);
|
|
881
|
+
} else {
|
|
882
|
+
this.adapter.log.error(
|
|
883
|
+
`Time received for data of group ${group} is too old or invalid (${latestEntry.uploadTime})! States not updated!`,
|
|
884
|
+
);
|
|
885
|
+
}
|
|
886
|
+
} else {
|
|
887
|
+
this.adapter.log.error(`No time received for data of group ${group}! States not updated!`);
|
|
888
|
+
}
|
|
889
|
+
} else {
|
|
890
|
+
await this.handleError(res, group);
|
|
891
|
+
}
|
|
892
|
+
} catch (e) {
|
|
893
|
+
this.adapter.log.error(`Fetching data for group ${group}: Exception occurred: ${e}`);
|
|
894
|
+
await this.handleError(this.emptyBody, group);
|
|
895
|
+
}
|
|
896
|
+
await this.startGroupTimeout(group);
|
|
897
|
+
}
|
|
898
|
+
|
|
793
899
|
async getEssList(group) {
|
|
794
900
|
try {
|
|
795
|
-
this.adapter.stopGroupTimeout(group);
|
|
901
|
+
await this.adapter.stopGroupTimeout(group);
|
|
796
902
|
|
|
797
903
|
this.adapter.log.debug(`Fetching ${group} data...`);
|
|
798
904
|
|
|
@@ -814,7 +920,7 @@ class OpenAPI {
|
|
|
814
920
|
*/
|
|
815
921
|
async getOneDateEnergyBySn(group) {
|
|
816
922
|
try {
|
|
817
|
-
this.adapter.stopGroupTimeout(group);
|
|
923
|
+
await this.adapter.stopGroupTimeout(group);
|
|
818
924
|
|
|
819
925
|
this.adapter.log.debug(`Fetching ${group} data...`);
|
|
820
926
|
|
|
@@ -841,7 +947,7 @@ class OpenAPI {
|
|
|
841
947
|
*/
|
|
842
948
|
async getChargeConfigInfo(group) {
|
|
843
949
|
try {
|
|
844
|
-
this.adapter.stopGroupTimeout(group);
|
|
950
|
+
await this.adapter.stopGroupTimeout(group);
|
|
845
951
|
|
|
846
952
|
this.adapter.log.debug(`Fetching ${group} data...`);
|
|
847
953
|
|
|
@@ -863,7 +969,7 @@ class OpenAPI {
|
|
|
863
969
|
*/
|
|
864
970
|
async getDisChargeConfigInfo(group) {
|
|
865
971
|
try {
|
|
866
|
-
this.adapter.stopGroupTimeout(group);
|
|
972
|
+
await this.adapter.stopGroupTimeout(group);
|
|
867
973
|
|
|
868
974
|
this.adapter.log.debug(`Fetching ${group} data...`);
|
|
869
975
|
|
|
@@ -885,7 +991,7 @@ class OpenAPI {
|
|
|
885
991
|
*/
|
|
886
992
|
async getSumDataForCustomer(group) {
|
|
887
993
|
try {
|
|
888
|
-
this.adapter.stopGroupTimeout(group);
|
|
994
|
+
await this.adapter.stopGroupTimeout(group);
|
|
889
995
|
|
|
890
996
|
this.adapter.log.debug(`Fetching ${group} data...`);
|
|
891
997
|
|
|
@@ -912,7 +1018,7 @@ class OpenAPI {
|
|
|
912
1018
|
*/
|
|
913
1019
|
async getWallboxData(group) {
|
|
914
1020
|
try {
|
|
915
|
-
this.adapter.stopGroupTimeout(group);
|
|
1021
|
+
await this.adapter.stopGroupTimeout(group);
|
|
916
1022
|
|
|
917
1023
|
this.adapter.log.debug(`Fetching ${group} data...`);
|
|
918
1024
|
// First we need to get SN if not already done:
|
|
@@ -977,7 +1083,7 @@ class OpenAPI {
|
|
|
977
1083
|
async writeConfigInfo(group, _updState, _updStateInfo) {
|
|
978
1084
|
try {
|
|
979
1085
|
this.adapter.stopGroupWriteTimeout(group);
|
|
980
|
-
this.adapter.stopGroupTimeout(group);
|
|
1086
|
+
await this.adapter.stopGroupTimeout(group);
|
|
981
1087
|
|
|
982
1088
|
this.adapter.log.debug(`Writing ${group} data...`);
|
|
983
1089
|
|
|
@@ -1027,7 +1133,7 @@ class OpenAPI {
|
|
|
1027
1133
|
async writeWallboxChargerControl(group, _updState, updStateInfo) {
|
|
1028
1134
|
try {
|
|
1029
1135
|
this.adapter.stopGroupWriteTimeout(group);
|
|
1030
|
-
this.adapter.stopGroupTimeout(group);
|
|
1136
|
+
await this.adapter.stopGroupTimeout(group);
|
|
1031
1137
|
|
|
1032
1138
|
this.adapter.log.debug(`Writing ${group} data...`);
|
|
1033
1139
|
|
|
@@ -1271,6 +1377,7 @@ class AlphaEss extends utils.Adapter {
|
|
|
1271
1377
|
this.log.debug(`config oAIntervalSummaryMins: ${this.config.oAIntervalSummaryMins}`);
|
|
1272
1378
|
this.log.debug(`config oAIntervalWallboxMins: ${this.config.oAIntervalWallboxMins}`);
|
|
1273
1379
|
this.log.debug(`config oAEnableRealtime: ${this.config.oAEnableRealtime}`);
|
|
1380
|
+
this.log.debug(`config oAEnableRealtime: ${this.config.oAEnableRecent}`);
|
|
1274
1381
|
this.log.debug(`config oAEnableEnergy: ${this.config.oAEnableEnergy}`);
|
|
1275
1382
|
this.log.debug(`config oAEnableEnergy: ${this.config.oAEnableEssList}`);
|
|
1276
1383
|
this.log.debug(`config oAEnableSettingsCharge: ${this.config.oAEnableSettingsCharge}`);
|
|
@@ -1312,28 +1419,31 @@ class AlphaEss extends utils.Adapter {
|
|
|
1312
1419
|
for (const gidx of Object.keys(this.getStateInfoList())) {
|
|
1313
1420
|
const groupInfo = this.getStateInfoList()[gidx];
|
|
1314
1421
|
|
|
1315
|
-
|
|
1316
|
-
|
|
1422
|
+
if (groupInfo.isSchedule) {
|
|
1423
|
+
groupInfo.interval = 300; // 5 Minutes, used for watchdog only
|
|
1424
|
+
} else {
|
|
1425
|
+
groupInfo.interval = this.config[groupInfo.intervalName] * groupInfo.intervalFactor;
|
|
1426
|
+
this.log.debug(`${groupInfo.intervalName}: ${groupInfo.interval}`);
|
|
1317
1427
|
|
|
1318
|
-
if (
|
|
1319
|
-
this.jsonConfig.items[groupInfo.intervalName] &&
|
|
1320
|
-
this.jsonConfig.items[groupInfo.intervalName].min
|
|
1321
|
-
) {
|
|
1322
1428
|
if (
|
|
1323
|
-
groupInfo.
|
|
1324
|
-
this.jsonConfig.items[groupInfo.intervalName].min
|
|
1429
|
+
this.jsonConfig.items[groupInfo.intervalName] &&
|
|
1430
|
+
this.jsonConfig.items[groupInfo.intervalName].min
|
|
1325
1431
|
) {
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
this.jsonConfig.items[groupInfo.intervalName].min * groupInfo.intervalFactor
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1432
|
+
if (
|
|
1433
|
+
groupInfo.interval <
|
|
1434
|
+
this.jsonConfig.items[groupInfo.intervalName].min * groupInfo.intervalFactor
|
|
1435
|
+
) {
|
|
1436
|
+
const oldVal = groupInfo.interval;
|
|
1437
|
+
groupInfo.interval =
|
|
1438
|
+
this.jsonConfig.items[groupInfo.intervalName].min * groupInfo.intervalFactor;
|
|
1439
|
+
if (this.config[groupInfo.enabledName]) {
|
|
1440
|
+
this.log.warn(
|
|
1441
|
+
`Configured interval ${oldVal} for ${groupInfo.Group} no longer supported. Changed to ${groupInfo.interval}. Please change your configuration!`,
|
|
1442
|
+
);
|
|
1443
|
+
}
|
|
1333
1444
|
}
|
|
1334
1445
|
}
|
|
1335
1446
|
}
|
|
1336
|
-
|
|
1337
1447
|
if (this.config[groupInfo.enabledName]) {
|
|
1338
1448
|
await this.setQualityForGroup(groupInfo.Group, 0x2);
|
|
1339
1449
|
await groupInfo.fnct(groupInfo.Group);
|
|
@@ -1513,11 +1623,12 @@ class AlphaEss extends utils.Adapter {
|
|
|
1513
1623
|
*/
|
|
1514
1624
|
startGroupTimeout(intervalInS, group) {
|
|
1515
1625
|
const gidx = this.getStateInfoList().findIndex(i => i.Group == group);
|
|
1516
|
-
|
|
1517
|
-
|
|
1626
|
+
const groupInfo = this.getStateInfoList()[gidx];
|
|
1627
|
+
if (!groupInfo.timeoutHandle) {
|
|
1628
|
+
const interval = this.calculateIntervalInMs(intervalInS, groupInfo);
|
|
1518
1629
|
this.log.debug(`Timeout with interval ${interval} ms started for group ${group}`);
|
|
1519
|
-
|
|
1520
|
-
|
|
1630
|
+
groupInfo.timeoutHandle = this.setTimeout(() => {
|
|
1631
|
+
groupInfo.fnct(group);
|
|
1521
1632
|
}, interval);
|
|
1522
1633
|
}
|
|
1523
1634
|
}
|
|
@@ -1949,17 +2060,29 @@ class AlphaEss extends utils.Adapter {
|
|
|
1949
2060
|
* This is to avoid too many requests and flooding the ioBroker log file with messages
|
|
1950
2061
|
*
|
|
1951
2062
|
* @param timeInS Interval time in seconds
|
|
1952
|
-
* @param
|
|
2063
|
+
* @param groupInfo Group Info
|
|
1953
2064
|
*/
|
|
1954
|
-
calculateIntervalInMs(timeInS,
|
|
1955
|
-
if (
|
|
1956
|
-
|
|
1957
|
-
|
|
2065
|
+
calculateIntervalInMs(timeInS, groupInfo) {
|
|
2066
|
+
if (groupInfo.isSchedule) {
|
|
2067
|
+
// In this case we calculate the seconds until the next full 5 minutes plus 10 seconds
|
|
2068
|
+
const now = new Date();
|
|
2069
|
+
const minutes = now.getMinutes();
|
|
2070
|
+
const seconds = now.getSeconds();
|
|
2071
|
+
const nextFullFiveMinute = Math.ceil((minutes + 1) / 5) * 5;
|
|
2072
|
+
const remainingMinutes = nextFullFiveMinute - minutes - 1;
|
|
2073
|
+
const remainingSeconds = 60 - seconds;
|
|
2074
|
+
|
|
2075
|
+
timeInS = remainingMinutes * 60 + remainingSeconds + 10;
|
|
2076
|
+
} else {
|
|
2077
|
+
if (this.errorCount < 5) {
|
|
2078
|
+
return timeInS * 1000;
|
|
2079
|
+
}
|
|
1958
2080
|
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
2081
|
+
if (timeInS < 300000) {
|
|
2082
|
+
// 5 minutes
|
|
2083
|
+
this.log.error(`${groupInfo.Group}: Five or more errors occurred, next request in 5 minutes.`);
|
|
2084
|
+
return 300000;
|
|
2085
|
+
}
|
|
1963
2086
|
}
|
|
1964
2087
|
|
|
1965
2088
|
return timeInS * 1000;
|