iobroker.ebus 2.5.0 → 3.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/.github/workflows/test-and-release.yml +5 -5
- package/LICENSE +1 -1
- package/README.md +16 -3
- package/admin/index_m.html +53 -65
- package/admin/words.js +2 -0
- package/io-package.json +54 -156
- package/main.js +195 -104
- package/package.json +16 -16
|
@@ -28,7 +28,7 @@ jobs:
|
|
|
28
28
|
node-version: [12.x]
|
|
29
29
|
|
|
30
30
|
steps:
|
|
31
|
-
- uses: actions/checkout@
|
|
31
|
+
- uses: actions/checkout@v2
|
|
32
32
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
33
33
|
uses: actions/setup-node@v1
|
|
34
34
|
with:
|
|
@@ -58,7 +58,7 @@ jobs:
|
|
|
58
58
|
- os: windows-latest
|
|
59
59
|
node-version: 8.x
|
|
60
60
|
steps:
|
|
61
|
-
- uses: actions/checkout@
|
|
61
|
+
- uses: actions/checkout@v2
|
|
62
62
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
63
63
|
uses: actions/setup-node@v1
|
|
64
64
|
with:
|
|
@@ -78,7 +78,7 @@ jobs:
|
|
|
78
78
|
if: startsWith(runner.OS, 'windows')
|
|
79
79
|
run: set DEBUG=testing:* & npm run test:integration
|
|
80
80
|
|
|
81
|
-
# TODO: To enable automatic npm releases, create a token on npmjs.org
|
|
81
|
+
# TODO: To enable automatic npm releases, create a token on npmjs.org
|
|
82
82
|
# Enter this token as a GitHub secret (with name NPM_TOKEN) in the repository options
|
|
83
83
|
# Then uncomment the following block:
|
|
84
84
|
|
|
@@ -90,7 +90,7 @@ jobs:
|
|
|
90
90
|
# if: |
|
|
91
91
|
# contains(github.event.head_commit.message, '[skip ci]') == false &&
|
|
92
92
|
# github.event_name == 'push' &&
|
|
93
|
-
#
|
|
93
|
+
# github.event.base_ref == 'refs/heads/master' &&
|
|
94
94
|
# startsWith(github.ref, 'refs/tags/v')
|
|
95
95
|
#
|
|
96
96
|
# runs-on: ubuntu-latest
|
|
@@ -99,7 +99,7 @@ jobs:
|
|
|
99
99
|
# node-version: [12.x]
|
|
100
100
|
#
|
|
101
101
|
# steps:
|
|
102
|
-
# - uses: actions/checkout@
|
|
102
|
+
# - uses: actions/checkout@v2
|
|
103
103
|
# - name: Use Node.js ${{ matrix.node-version }}
|
|
104
104
|
# uses: actions/setup-node@v1
|
|
105
105
|
# with:
|
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright (C) <2017 -
|
|
1
|
+
Copyright (C) <2017 - 2022> <info@rg-engineering.eu>
|
|
2
2
|
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
4
|
|
package/README.md
CHANGED
|
@@ -30,7 +30,10 @@ There is a possibillity to poll data which are not polled by ebusd directly. Com
|
|
|
30
30
|
|
|
31
31
|
Another feature is to send any command to ebusd and receive answer to work with e.g. scripts.
|
|
32
32
|
|
|
33
|
-
current supported ebusd-version:
|
|
33
|
+
current supported ebusd-version: 22.2
|
|
34
|
+
|
|
35
|
+
**Attention** with ebusd - version 22.1 config path has been changed to http://cfg.ebusd.eu/. Make sure you change it in your installation of ebusd.
|
|
36
|
+
details see in [changelog](https://github.com/john30/ebusd/blob/master/ChangeLog.md)
|
|
34
37
|
|
|
35
38
|
|
|
36
39
|
## how to send commands to ebusd
|
|
@@ -52,7 +55,17 @@ Attention: command in datapoint ebus.0.cmd is deleted after executing of command
|
|
|
52
55
|
|
|
53
56
|
## Changelog
|
|
54
57
|
|
|
55
|
-
###
|
|
58
|
+
### 3.0.1 (2022-04-02)
|
|
59
|
+
* (René) read interval in admin added
|
|
60
|
+
|
|
61
|
+
### 3.0.0 (2022-04-02)
|
|
62
|
+
* (René) **ATTENTION** change from scheduled to daemon adapter
|
|
63
|
+
* (René) bent by axios replaced
|
|
64
|
+
|
|
65
|
+
### 2.5.1 (2021-12-29)
|
|
66
|
+
* (René) adjustable retries to send data if arbitration error appeared
|
|
67
|
+
|
|
68
|
+
### 2.5.0 (2021-12-28)
|
|
56
69
|
* (René) see issue #62: support ebusd 21.3
|
|
57
70
|
|
|
58
71
|
### 2.4.5 (2021-11-07)
|
|
@@ -168,7 +181,7 @@ Attention: command in datapoint ebus.0.cmd is deleted after executing of command
|
|
|
168
181
|
* (René) initial release
|
|
169
182
|
|
|
170
183
|
## License
|
|
171
|
-
Copyright (C) <2017 -
|
|
184
|
+
Copyright (C) <2017 - 2022> <info@rg-engineering.eu>
|
|
172
185
|
|
|
173
186
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
174
187
|
|
package/admin/index_m.html
CHANGED
|
@@ -260,101 +260,89 @@
|
|
|
260
260
|
<input class="value number" id="targetHTTPPort" size="5" maxlength="5" type="number" />
|
|
261
261
|
<label for="targetHTTPPort" class="translate">target_HTTPPort</label>
|
|
262
262
|
</div>
|
|
263
|
-
|
|
264
|
-
<div class="row">
|
|
263
|
+
|
|
265
264
|
<div class="input-field col s12 m4 l3">
|
|
266
265
|
<input class="value number" id="targetTelnetPort" size="5" maxlength="5" type="number" />
|
|
267
266
|
<label for="targetTelnetPort" class="translate">target_TelnetPort</label>
|
|
268
267
|
</div>
|
|
269
268
|
</div>
|
|
269
|
+
<div class="row">
|
|
270
|
+
<div class="input-field col s12 m4 l3">
|
|
271
|
+
<input class="value number" id="readInterval" size="3" maxlength="3" type="number" />
|
|
272
|
+
<label for="readInterval" class="translate">readInterval</label>
|
|
273
|
+
</div>
|
|
274
|
+
</div>
|
|
270
275
|
<div class="row">
|
|
271
276
|
<div class="input-field col s12 m4 l3">
|
|
272
277
|
<input class="value number" id="parseTimeout" size="3" maxlength="3" type="number" />
|
|
273
278
|
<label for="parseTimeout" class="translate">parse_timeout</label>
|
|
274
279
|
</div>
|
|
275
|
-
</div>
|
|
276
|
-
|
|
277
|
-
<!--
|
|
278
|
-
<div class="row">
|
|
279
|
-
<div class="input-field col s6">
|
|
280
|
-
<textarea class="value materialize-textarea polled" id="PolledValues"></textarea>
|
|
281
|
-
<label class="translate" for="PolledValues">ListOfAllPolledValues</label>
|
|
282
|
-
</div>
|
|
283
280
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
281
|
+
<div class="input-field col s12 m4 l3">
|
|
282
|
+
<input class="value number" id="maxretries" size="3" maxlength="3" type="number" min="0" max="10" />
|
|
283
|
+
<label for="maxretries" class="translate">maxretries</label>
|
|
284
|
+
</div>
|
|
285
|
+
</div>
|
|
288
286
|
|
|
289
|
-
<div class="row">
|
|
290
|
-
<div class="input-field col s6">
|
|
291
|
-
<textarea class="value materialize-textarea polled" id="HistoryValues"></textarea>
|
|
292
|
-
<label class="translate" for="HistoryValues">ListOfAllHistoryValues</label>
|
|
293
|
-
</div>
|
|
294
287
|
|
|
295
|
-
<div class="col s6">
|
|
296
|
-
<span class="translate">hint_ebusd_history</span>
|
|
297
|
-
</div>
|
|
298
|
-
</div>
|
|
299
|
-
-->
|
|
300
288
|
|
|
301
289
|
</div>
|
|
302
290
|
|
|
303
|
-
|
|
304
|
-
|
|
291
|
+
<!-- tab "tab-polledDP" -->
|
|
292
|
+
<div id="tab-polledDP" class="col s12 page">
|
|
305
293
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
294
|
+
<div class="row">
|
|
295
|
+
<div class="col s6">
|
|
296
|
+
<span class="translate">hint_ebusd_polled</span>
|
|
297
|
+
</div>
|
|
309
298
|
</div>
|
|
310
|
-
</div>
|
|
311
299
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
300
|
+
<div class="col s12" id="polledDP">
|
|
301
|
+
|
|
302
|
+
<a class="btn-floating waves-effect waves-light blue table-button-add"><i class="material-icons">add</i></a>
|
|
303
|
+
|
|
304
|
+
<div class="table-values-div">
|
|
305
|
+
<table id="table_polledDP" class="table-values" style="width: 100%;">
|
|
306
|
+
<thead>
|
|
307
|
+
<tr>
|
|
308
|
+
<th id="polledDP_col_1" data-name="circuit" style="width: 20%; background: #64b5f6 " class="translate">circuit</th>
|
|
309
|
+
<th id="polledDP_col_2" data-name="name" style="background: #64b5f6" class="translate">name</th>
|
|
310
|
+
<th id="polledDP_col_3" data-name="parameter" style="background: #64b5f6" class="translate">addParameter</th>
|
|
311
|
+
<th data-buttons="up down delete" style="width: 100px; background: #64b5f6"></th>
|
|
312
|
+
</tr>
|
|
313
|
+
</thead>
|
|
314
|
+
</table>
|
|
315
|
+
</div>
|
|
327
316
|
</div>
|
|
328
317
|
</div>
|
|
329
|
-
</div>
|
|
330
318
|
|
|
331
|
-
|
|
332
|
-
|
|
319
|
+
<!-- tab "tab-historyDP" -->
|
|
320
|
+
<div id="tab-historyDP" class="col s12 page">
|
|
333
321
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
322
|
+
<div class="row">
|
|
323
|
+
<div class="col s6">
|
|
324
|
+
<span class="translate">hint_ebusd_history</span>
|
|
325
|
+
</div>
|
|
337
326
|
</div>
|
|
338
|
-
</div>
|
|
339
327
|
|
|
340
|
-
|
|
328
|
+
<div class="col s12" id="historyDP">
|
|
341
329
|
|
|
342
|
-
|
|
330
|
+
<a class="btn-floating waves-effect waves-light blue table-button-add"><i class="material-icons">add</i></a>
|
|
343
331
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
332
|
+
<div class="table-values-div">
|
|
333
|
+
<table id="table_historyDP" class="table-values" style="width: 100%;">
|
|
334
|
+
<thead>
|
|
335
|
+
<tr>
|
|
336
|
+
<th id="historyDP_col_1" data-name="name" style="width: 20%; background: #64b5f6 " class="translate">name</th>
|
|
337
|
+
<th data-buttons="add up down delete" style="width: 100px; background: #64b5f6"></th>
|
|
338
|
+
</tr>
|
|
339
|
+
</thead>
|
|
340
|
+
</table>
|
|
341
|
+
</div>
|
|
353
342
|
</div>
|
|
354
343
|
</div>
|
|
355
|
-
</div>
|
|
356
344
|
|
|
357
|
-
|
|
345
|
+
</div>
|
|
358
346
|
</div>
|
|
359
347
|
</body>
|
|
360
348
|
</html>
|
package/admin/words.js
CHANGED
|
@@ -9,9 +9,11 @@ systemDictionary = {
|
|
|
9
9
|
"hint_ebusd_history": { "en": "list of all datapoint names which should be used with ebus history widget. ", "de": "Liste aller Datenpunktnamen, die mit dem ebus-History-Widget verwendet werden sollen.", "ru": "список всех имен точек данных, которые следует использовать с виджетом истории ebus.", "pt": "lista de todos os nomes de pontos de dados que devem ser usados com o widget de histórico do ebus.", "nl": "lijst met alle datapuntnamen die moeten worden gebruikt met de ebus-geschiedeniswidget.", "fr": "liste de tous les noms de points de données qui doivent être utilisés avec le widget historique ebus.", "it": "elenco di tutti i nomi dei punti dati che dovrebbero essere utilizzati con il widget cronologia ebus.", "es": "lista de todos los nombres de puntos de datos que deben usarse con el widget de historial de ebus.", "pl": "lista wszystkich nazw punktów danych, które powinny być używane z widżetem historii ebus.", "zh-cn": "应与 ebus 历史小部件一起使用的所有数据点名称的列表。"},
|
|
10
10
|
"hint_ebusd_polled": { "en": "list of all datapoint names which should be polled from adapter. Do not add datapoints which are already polled from ebusd. Circuit and additional parameter are optionally.", "de": "Liste aller Datenpunktnamen, die vom Adapter abgefragt werden sollen. ", "ru": "список всех имен точек данных, которые должны быть опрошены от адаптера. ", "pt": "lista de todos os nomes de pontos de dados que devem ser pesquisados no adaptador. ", "nl": "lijst met alle datapuntnamen die van de adapter moeten worden opgevraagd. ", "fr": "liste de tous les noms de points de données qui doivent être interrogés à partir de l'adaptateur. ", "it": "elenco di tutti i nomi dei punti dati che devono essere interrogati dall'adattatore. ", "es": "lista de todos los nombres de puntos de datos que deben consultarse desde el adaptador. ", "pl": "lista wszystkich nazw punktów danych, które powinny być odpytywane z adaptera. ", "zh-cn": "应从适配器轮询的所有数据点名称的列表。"},
|
|
11
11
|
"historyDP": { "en": "history datapoints", "de": "Verlaufsdatenpunkte", "ru": "исторические данные", "pt": "pontos de dados de história", "nl": "geschiedenis datapunten", "fr": "points de données d'historique", "it": "punti dati della cronologia", "es": "puntos de datos históricos", "pl": "punkty danych historii", "zh-cn": "历史数据点"},
|
|
12
|
+
"maxretries": { "en": "maximum number of retries to send a command ", "de": "maximale Anzahl von Wiederholungen, um einen Befehl zu senden", "ru": "максимальное количество попыток отправки команды", "pt": "número máximo de tentativas para enviar um comando", "nl": "maximum aantal pogingen om een opdracht te verzenden", "fr": "nombre maximum de tentatives pour envoyer une commande", "it": "numero massimo di tentativi per inviare un comando", "es": "número máximo de reintentos para enviar un comando", "pl": "maksymalna liczba ponownych prób wysłania polecenia", "zh-cn": "发送命令的最大重试次数"},
|
|
12
13
|
"name": { "en": "name", "de": "Name", "ru": "имя", "pt": "nome", "nl": "naam", "fr": "Nom", "it": "nome", "es": "nombre", "pl": "Nazwa", "zh-cn": "姓名"},
|
|
13
14
|
"parse_timeout": { "en": "download and poll timeout [seconds]", "de": "Download und Abfrage-Timeout [Sekunden]", "ru": "время ожидания загрузки и опроса [секунд]", "pt": "tempo de download e poll timeout [segundos]", "nl": "downloaden en poll time-out [seconden]", "fr": "délai de téléchargement et d'interrogation [secondes]", "it": "download e polling timeout [secondi]", "es": "tiempo de espera de descarga y encuesta [segundos]", "pl": "czas pobierania i odpytywania [sekundy]", "zh-cn": "下载和轮询超时[秒]"},
|
|
14
15
|
"polledDP": { "en": "polled datapoints", "de": "abgefragte Datenpunkte", "ru": "опрошенные точки данных", "pt": "pontos de dados sondados", "nl": "opgevraagde datapunten", "fr": "points de données interrogés", "it": "punti dati interrogati", "es": "puntos de datos sondeados", "pl": "odpytywane punkty danych", "zh-cn": "轮询数据点"},
|
|
16
|
+
"readInterval": { "en": "interval to read data from ebusd [min]", "de": "Intervall zum Lesen von Daten aus ebusd [min]", "ru": "интервал чтения данных из ebusd [мин]", "pt": "intervalo para ler dados de ebusd [min]", "nl": "interval om gegevens van ebusd te lezen [min]", "fr": "intervalle de lecture des données depuis ebusd [min]", "it": "intervallo per leggere i dati da ebusd [min]", "es": "intervalo para leer datos de ebusd [min]", "pl": "interwał odczytu danych z ebusd [min]", "zh-cn": "从 ebusd 读取数据的间隔 [分钟]"},
|
|
15
17
|
"target_HTTPPort": { "en": "target HTTP Port to read data", "de": "target HTTP Port zum Lesen von Daten", "ru": "целевой HTTP-порт для чтения данных", "pt": "porta HTTP de destino para ler dados", "nl": "doel HTTP-poort om gegevens te lezen", "fr": "Port HTTP cible pour lire les données", "it": "Porta HTTP di destinazione per leggere i dati", "es": "target HTTP Port para leer datos", "pl": "docelowy port HTTP do odczytu danych", "zh-cn": "目标HTTP端口以读取数据"},
|
|
16
18
|
"target_IP": { "en": "target IP", "de": "Ziel-IP", "ru": "целевой IP-адрес", "pt": "IP alvo", "nl": "doel-IP", "fr": "cible IP", "it": "IP di destinazione", "es": "IP objetivo", "pl": "docelowy adres IP", "zh-cn": "目标IP"},
|
|
17
19
|
"target_TelnetPort": { "en": "target telnet Port to write data", "de": "target telnet Port zum Schreiben von Daten", "ru": "целевой порт telnet для записи данных", "pt": "destino telnet porta para escrever dados", "nl": "doel telnet-poort om gegevens te schrijven", "fr": "Port telnet cible pour écrire des données", "it": "Porta telnet target per scrivere dati", "es": "target telnet Port para escribir datos", "pl": "docelowy port telnet do zapisu danych", "zh-cn": "目标telnet用于写入数据的端口"},
|
package/io-package.json
CHANGED
|
@@ -1,163 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "ebus",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.1",
|
|
5
5
|
"news": {
|
|
6
|
-
"
|
|
7
|
-
"en": "
|
|
8
|
-
"de": "
|
|
9
|
-
"ru": "
|
|
10
|
-
"pt": "
|
|
11
|
-
"nl": "
|
|
12
|
-
"fr": "
|
|
13
|
-
"it": "
|
|
14
|
-
"es": "
|
|
15
|
-
"pl": "
|
|
16
|
-
"zh-cn": "
|
|
6
|
+
"3.0.1": {
|
|
7
|
+
"en": "read interval in admin added",
|
|
8
|
+
"de": "Leseintervall im Admin hinzugefügt",
|
|
9
|
+
"ru": "добавлен интервал чтения в админке",
|
|
10
|
+
"pt": "intervalo de leitura no admin adicionado",
|
|
11
|
+
"nl": "leesinterval in admin toegevoegd",
|
|
12
|
+
"fr": "intervalle de lecture ajouté dans l'administrateur",
|
|
13
|
+
"it": "intervallo di lettura in admin aggiunto",
|
|
14
|
+
"es": "Intervalo de lectura en el administrador agregado",
|
|
15
|
+
"pl": "dodano interwał odczytu w admin",
|
|
16
|
+
"zh-cn": "添加了管理员中的读取间隔"
|
|
17
17
|
},
|
|
18
|
-
"
|
|
19
|
-
"en": "
|
|
20
|
-
"de": "
|
|
21
|
-
"ru": "
|
|
22
|
-
"pt": "
|
|
23
|
-
"nl": "
|
|
24
|
-
"fr": "
|
|
25
|
-
"it": "
|
|
26
|
-
"es": "
|
|
27
|
-
"pl": "
|
|
28
|
-
"zh-cn": "
|
|
18
|
+
"3.0.0": {
|
|
19
|
+
"en": "from 'scheduled' to 'daemon' adapter changed",
|
|
20
|
+
"de": "von 'geplant' zu 'daemon' Adapter geändert",
|
|
21
|
+
"ru": "изменен адаптер с «запланированного» на «демон»",
|
|
22
|
+
"pt": "adaptador 'agendado' para 'daemon' alterado",
|
|
23
|
+
"nl": "van 'scheduled' naar 'daemon' adapter gewijzigd",
|
|
24
|
+
"fr": "de l'adaptateur 'scheduled' à 'daemon' changé",
|
|
25
|
+
"it": "adattatore da \"programmato\" a \"demone\" modificato",
|
|
26
|
+
"es": "Se cambió el adaptador de 'programado' a 'daemon'",
|
|
27
|
+
"pl": "Zmieniono adapter z „zaplanowanego” na „demon”",
|
|
28
|
+
"zh-cn": "从 'scheduled' 到 'daemon' 适配器已更改"
|
|
29
29
|
},
|
|
30
|
-
"2.
|
|
31
|
-
"en": "
|
|
32
|
-
"de": "
|
|
33
|
-
"ru": "
|
|
34
|
-
"pt": "
|
|
35
|
-
"nl": "
|
|
36
|
-
"fr": "
|
|
37
|
-
"it": "
|
|
38
|
-
"es": "
|
|
39
|
-
"pl": "
|
|
40
|
-
"zh-cn": "
|
|
30
|
+
"2.6.0": {
|
|
31
|
+
"en": " 'bent' replaced by 'axios'",
|
|
32
|
+
"de": "'bent' ersetzt durch 'axios'",
|
|
33
|
+
"ru": "«согнутый» заменен на «аксиос»",
|
|
34
|
+
"pt": "'curvado' substituído por 'axios'",
|
|
35
|
+
"nl": "'gebogen' vervangen door 'axios'",
|
|
36
|
+
"fr": "'plié' remplacé par 'axios'",
|
|
37
|
+
"it": "'piegato' sostituito da 'assios'",
|
|
38
|
+
"es": "'doblado' reemplazado por 'axios'",
|
|
39
|
+
"pl": "„wygięty” zastąpiony przez „axios”",
|
|
40
|
+
"zh-cn": "'bent' 替换为 'axios'"
|
|
41
41
|
},
|
|
42
|
-
"2.
|
|
43
|
-
"en": "
|
|
44
|
-
"de": "
|
|
45
|
-
"ru": "
|
|
46
|
-
"pt": "
|
|
47
|
-
"nl": "
|
|
48
|
-
"fr": "
|
|
49
|
-
"it": "
|
|
50
|
-
"es": "
|
|
51
|
-
"pl": "
|
|
52
|
-
"zh-cn": "
|
|
53
|
-
},
|
|
54
|
-
"2.4.0": {
|
|
55
|
-
"en": "overwork handling of read and history datapoints; support of list of commands ",
|
|
56
|
-
"de": "Überarbeitung von Lese- und Verlaufsdatenpunkten; ",
|
|
57
|
-
"ru": "чрезмерная работа с точками чтения и истории; ",
|
|
58
|
-
"pt": "excesso de trabalho no manuseio de pontos de dados de leitura e histórico; ",
|
|
59
|
-
"nl": "overwerk afhandeling van lees- en geschiedenisdatapunten; ",
|
|
60
|
-
"fr": "traitement excessif des points de données de lecture et d'historique ; ",
|
|
61
|
-
"it": "gestione del lavoro eccessivo dei punti dati di lettura e cronologia; ",
|
|
62
|
-
"es": "manejo de exceso de trabajo de los puntos de datos de lectura e historial; ",
|
|
63
|
-
"pl": "przepracowanie obsługi odczytanych i historycznych punktów danych; ",
|
|
64
|
-
"zh-cn": "读取和历史数据点的过度处理;"
|
|
65
|
-
},
|
|
66
|
-
"2.3.1": {
|
|
67
|
-
"en": "support for ebusd 21.2",
|
|
68
|
-
"de": "unterstützung für ebusd 21.2",
|
|
69
|
-
"ru": "поддержка ebusd 21.2",
|
|
70
|
-
"pt": "suporte para ebusd 21.2",
|
|
71
|
-
"nl": "ondersteuning voor ebusd 21.2",
|
|
72
|
-
"fr": "prise en charge d'ebusd 21.2",
|
|
73
|
-
"it": "supporto per ebusd 21.2",
|
|
74
|
-
"es": "soporte para ebusd 21.2",
|
|
75
|
-
"pl": "obsługa ebusd 21,2",
|
|
76
|
-
"zh-cn": "支持 ebusd 21.2"
|
|
77
|
-
},
|
|
78
|
-
"2.2.7": {
|
|
79
|
-
"en": "bug fix for wrong data type logs",
|
|
80
|
-
"de": "Bugfix für falsche Datentyp-Logs",
|
|
81
|
-
"ru": "исправление ошибки для журналов неправильного типа данных",
|
|
82
|
-
"pt": "correção de bug para registros de tipo de dados errado",
|
|
83
|
-
"nl": "bugfix voor logs van verkeerde gegevenstypes",
|
|
84
|
-
"fr": "correction de bogues pour les journaux de type de données incorrect",
|
|
85
|
-
"it": "correzione di bug per log di tipi di dati errati",
|
|
86
|
-
"es": "corrección de errores para registros de tipo de datos incorrectos",
|
|
87
|
-
"pl": "poprawka błędów w logach z nieprawidłowymi typami danych",
|
|
88
|
-
"zh-cn": "错误数据类型日志的错误修复"
|
|
89
|
-
},
|
|
90
|
-
"2.2.5": {
|
|
91
|
-
"en": "dependencies updated",
|
|
92
|
-
"de": "Abhängigkeiten aktualisiert",
|
|
93
|
-
"ru": "зависимости обновлены",
|
|
94
|
-
"pt": "dependências atualizadas",
|
|
95
|
-
"nl": "afhankelijkheden bijgewerkt",
|
|
96
|
-
"fr": "dépendances mises à jour",
|
|
97
|
-
"it": "dipendenze aggiornate",
|
|
98
|
-
"es": "dependencias actualizadas",
|
|
99
|
-
"pl": "zaktualizowane zależności",
|
|
100
|
-
"zh-cn": "依赖关系已更新"
|
|
101
|
-
},
|
|
102
|
-
"2.2.4": {
|
|
103
|
-
"en": "bug fix: exception in widget removed",
|
|
104
|
-
"de": "Fehlerbehebung: Ausnahme im Widget entfernt",
|
|
105
|
-
"ru": "исправление ошибки: исключение в виджете удалено",
|
|
106
|
-
"pt": "correção de bug: exceção no widget removida",
|
|
107
|
-
"nl": "bug fix: uitzondering in widget verwijderd",
|
|
108
|
-
"fr": "correction de bogue: exception dans le widget supprimée",
|
|
109
|
-
"it": "correzione bug: eccezione nel widget rimossa",
|
|
110
|
-
"es": "corrección de errores: excepción en el widget eliminado",
|
|
111
|
-
"pl": "poprawka: wyjątek w widżecie został usunięty",
|
|
112
|
-
"zh-cn": "错误修复:删除了小部件中的异常"
|
|
113
|
-
},
|
|
114
|
-
"2.2.3": {
|
|
115
|
-
"en": "create history DP if not available ",
|
|
116
|
-
"de": "History-DP erstellen, falls nicht verfügbar",
|
|
117
|
-
"ru": "создать историю DP, если недоступен",
|
|
118
|
-
"pt": "criar histórico DP se não estiver disponível",
|
|
119
|
-
"nl": "maak een geschiedenis-DP als deze niet beschikbaar is",
|
|
120
|
-
"fr": "créer l'historique DP s'il n'est pas disponible",
|
|
121
|
-
"it": "creare la cronologia DP se non disponibile",
|
|
122
|
-
"es": "crear historial DP si no está disponible",
|
|
123
|
-
"pl": "utwórz historię DP, jeśli nie jest dostępna",
|
|
124
|
-
"zh-cn": "创建历史记录DP(如果不可用)"
|
|
125
|
-
},
|
|
126
|
-
"2.2.0": {
|
|
127
|
-
"en": "change DP only if necessary to reduce system load",
|
|
128
|
-
"de": "Ändern Sie den DP nur bei Bedarf, um die Systemlast zu verringern",
|
|
129
|
-
"ru": "изменяйте DP только в случае необходимости для снижения нагрузки на систему",
|
|
130
|
-
"pt": "mude DP apenas se necessário para reduzir a carga do sistema",
|
|
131
|
-
"nl": "verander DP alleen indien nodig om de systeembelasting te verminderen",
|
|
132
|
-
"fr": "changer DP uniquement si nécessaire pour réduire la charge du système",
|
|
133
|
-
"it": "cambiare DP solo se necessario per ridurre il carico del sistema",
|
|
134
|
-
"es": "cambie DP solo si es necesario para reducir la carga del sistema",
|
|
135
|
-
"pl": "zmień DP tylko wtedy, gdy jest to konieczne, aby zmniejszyć obciążenie systemu",
|
|
136
|
-
"zh-cn": "仅在需要减少系统负载时才更改DP"
|
|
137
|
-
},
|
|
138
|
-
"2.1.1": {
|
|
139
|
-
"en": "refactoring: 'async/await' used",
|
|
140
|
-
"de": "Refactoring: 'async / await' verwendet",
|
|
141
|
-
"ru": "рефакторинг: используется async / await",
|
|
142
|
-
"pt": "refatoração: 'async / waitit' usado",
|
|
143
|
-
"nl": "refactoring: 'async / await' gebruikt",
|
|
144
|
-
"fr": "refactoring: 'async / wait' utilisé",
|
|
145
|
-
"it": "refactoring: 'async / await' usato",
|
|
146
|
-
"es": "refactorización: 'async / await' usado",
|
|
147
|
-
"pl": "refaktoryzacja: użyto opcji „asynchronizuj / czekaj”",
|
|
148
|
-
"zh-cn": "重构:使用“异步/等待”"
|
|
149
|
-
},
|
|
150
|
-
"1.0.0": {
|
|
151
|
-
"en": "update to flot 3.0",
|
|
152
|
-
"de": "Update auf Flot 3.0",
|
|
153
|
-
"ru": "обновление до флота 3.0",
|
|
154
|
-
"pt": "atualizar para o flot 3.0",
|
|
155
|
-
"nl": "update naar flot 3.0",
|
|
156
|
-
"fr": "mise à jour vers flot 3.0",
|
|
157
|
-
"it": "aggiornamento a flot 3.0",
|
|
158
|
-
"es": "actualizar a flot 3.0",
|
|
159
|
-
"pl": "aktualizacja do flot 3.0",
|
|
160
|
-
"zh-cn": "更新到flot 3.0"
|
|
42
|
+
"2.5.1": {
|
|
43
|
+
"en": "maximum retries to send data in case of arbitration error",
|
|
44
|
+
"de": "maximale Wiederholungsversuche zum Senden von Daten im Falle eines Vermittlungsfehlers",
|
|
45
|
+
"ru": "максимальное количество попыток отправки данных в случае ошибки арбитража",
|
|
46
|
+
"pt": "máximo de tentativas para enviar dados em caso de erro de arbitragem",
|
|
47
|
+
"nl": "maximaal aantal pogingen om gegevens te verzenden in geval van arbitragefout",
|
|
48
|
+
"fr": "nombre maximum de tentatives d'envoi de données en cas d'erreur d'arbitrage",
|
|
49
|
+
"it": "numero massimo di tentativi di invio dei dati in caso di errore di arbitrato",
|
|
50
|
+
"es": "reintentos máximos para enviar datos en caso de error de arbitraje",
|
|
51
|
+
"pl": "maksymalna liczba prób wysłania danych w przypadku błędu arbitrażu",
|
|
52
|
+
"zh-cn": "仲裁错误时发送数据的最大重试次数"
|
|
161
53
|
}
|
|
162
54
|
},
|
|
163
55
|
"title": "ebus",
|
|
@@ -186,8 +78,7 @@
|
|
|
186
78
|
"zh-cn": "ebus适配器;"
|
|
187
79
|
},
|
|
188
80
|
"platform": "Javascript/Node.js",
|
|
189
|
-
"mode": "
|
|
190
|
-
"schedule": "*/5 * * * *",
|
|
81
|
+
"mode": "daemon",
|
|
191
82
|
"icon": "ebus.png",
|
|
192
83
|
"enabled": true,
|
|
193
84
|
"messagebox": true,
|
|
@@ -201,6 +92,11 @@
|
|
|
201
92
|
"type": "hardware",
|
|
202
93
|
"license": "MIT",
|
|
203
94
|
"materialize": true,
|
|
95
|
+
"dependencies": [
|
|
96
|
+
{
|
|
97
|
+
"js-controller": ">=2.0.0"
|
|
98
|
+
}
|
|
99
|
+
],
|
|
204
100
|
"plugins": {
|
|
205
101
|
"sentry": {
|
|
206
102
|
"dsn": "https://bb7e6f51a1274ced81576d84f82f667e@o390433.ingest.sentry.io/5434784"
|
|
@@ -229,6 +125,8 @@
|
|
|
229
125
|
"parseTimeout": 60,
|
|
230
126
|
"useBoolean4Onoff": false,
|
|
231
127
|
"PolledDPs": [],
|
|
232
|
-
"HistoryDPs": []
|
|
128
|
+
"HistoryDPs": [],
|
|
129
|
+
"maxretries": 5,
|
|
130
|
+
"readInterval": 5
|
|
233
131
|
}
|
|
234
132
|
}
|
package/main.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
const utils = require("@iobroker/adapter-core");
|
|
18
|
-
const ebusdMinVersion = [
|
|
18
|
+
const ebusdMinVersion = [22, 2];
|
|
19
19
|
let ebusdVersion = [0, 0];
|
|
20
20
|
let ebusdUpdateVersion = [0, 0];
|
|
21
21
|
|
|
@@ -24,6 +24,8 @@ function startAdapter(options) {
|
|
|
24
24
|
options = options || {};
|
|
25
25
|
Object.assign(options, {
|
|
26
26
|
name: "ebus",
|
|
27
|
+
//#######################################
|
|
28
|
+
//
|
|
27
29
|
ready: function () {
|
|
28
30
|
try {
|
|
29
31
|
//adapter.log.debug('start');
|
|
@@ -32,7 +34,39 @@ function startAdapter(options) {
|
|
|
32
34
|
catch (e) {
|
|
33
35
|
adapter.log.error("exception catch after ready [" + e + "]");
|
|
34
36
|
}
|
|
35
|
-
}
|
|
37
|
+
},
|
|
38
|
+
//#######################################
|
|
39
|
+
// is called when adapter shuts down
|
|
40
|
+
unload: function (callback) {
|
|
41
|
+
try {
|
|
42
|
+
adapter && adapter.log && adapter.log.info && adapter.log.info("cleaned everything up...");
|
|
43
|
+
//to do stop intervall
|
|
44
|
+
callback();
|
|
45
|
+
} catch (e) {
|
|
46
|
+
callback();
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
//#######################################
|
|
50
|
+
//
|
|
51
|
+
SIGINT: function () {
|
|
52
|
+
adapter && adapter.log && adapter.log.info && adapter.log.info("cleaned everything up...");
|
|
53
|
+
CronStop();
|
|
54
|
+
},
|
|
55
|
+
//#######################################
|
|
56
|
+
// is called if a subscribed object changes
|
|
57
|
+
//objectChange: function (id, obj) {
|
|
58
|
+
// adapter.log.debug("[OBJECT CHANGE] ==== " + id + " === " + JSON.stringify(obj));
|
|
59
|
+
//},
|
|
60
|
+
//#######################################
|
|
61
|
+
// is called if a subscribed state changes
|
|
62
|
+
//stateChange: function (id, state) {
|
|
63
|
+
//HandleStateChange(id, state);
|
|
64
|
+
//},
|
|
65
|
+
stateChange: async (id, state) => {
|
|
66
|
+
await HandleStateChange(id, state);
|
|
67
|
+
},
|
|
68
|
+
//#######################################
|
|
69
|
+
//
|
|
36
70
|
});
|
|
37
71
|
adapter = new utils.Adapter(options);
|
|
38
72
|
|
|
@@ -40,18 +74,21 @@ function startAdapter(options) {
|
|
|
40
74
|
}
|
|
41
75
|
|
|
42
76
|
//var request = require('request');
|
|
43
|
-
const bent = require("bent");
|
|
77
|
+
//const bent = require("bent");
|
|
78
|
+
const axios = require('axios');
|
|
44
79
|
//const parseString = require("xml2js").parseString;
|
|
45
80
|
const net = require("net");
|
|
46
81
|
const { PromiseSocket } = require("promise-socket");
|
|
47
82
|
|
|
48
83
|
|
|
49
84
|
|
|
50
|
-
let killTimer;
|
|
85
|
+
//let killTimer;
|
|
86
|
+
let intervalID;
|
|
51
87
|
|
|
52
88
|
|
|
53
89
|
async function main() {
|
|
54
90
|
|
|
91
|
+
/*
|
|
55
92
|
let nParseTimeout = 60;
|
|
56
93
|
if (adapter.config.parseTimeout > 0) {
|
|
57
94
|
nParseTimeout = adapter.config.parseTimeout;
|
|
@@ -65,30 +102,68 @@ async function main() {
|
|
|
65
102
|
//process.exit(0);
|
|
66
103
|
adapter.terminate ? adapter.terminate(15) : process.exit(15);
|
|
67
104
|
}, nParseTimeout);
|
|
105
|
+
*/
|
|
68
106
|
|
|
69
107
|
adapter.log.debug("start with interface ebusd ");
|
|
70
108
|
|
|
71
109
|
FillPolledVars();
|
|
72
110
|
FillHistoryVars();
|
|
73
111
|
|
|
74
|
-
await
|
|
112
|
+
await checkVariables();
|
|
75
113
|
|
|
76
|
-
|
|
77
|
-
await ebusd_ReadValues();
|
|
114
|
+
subscribeVars();
|
|
78
115
|
|
|
79
116
|
//await TestFunction();
|
|
80
117
|
|
|
81
|
-
|
|
118
|
+
let readInterval = 5;
|
|
119
|
+
if (parseInt(adapter.config.readInterval) > 0) {
|
|
120
|
+
readInterval = adapter.config.readInterval;
|
|
121
|
+
}
|
|
122
|
+
adapter.log.debug("read every " + readInterval + " minutes");
|
|
123
|
+
intervalID = setInterval(Do, readInterval * 60 * 1000);
|
|
82
124
|
|
|
125
|
+
/*
|
|
83
126
|
if (killTimer) {
|
|
84
127
|
clearTimeout(killTimer);
|
|
85
128
|
adapter.log.debug("timer killed");
|
|
86
129
|
}
|
|
87
130
|
|
|
88
131
|
adapter.terminate ? adapter.terminate(0) : process.exit(0);
|
|
132
|
+
*/
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
async function Do() {
|
|
136
|
+
|
|
137
|
+
adapter.log.debug("starting ... " );
|
|
138
|
+
|
|
139
|
+
await ebusd_Command();
|
|
140
|
+
|
|
141
|
+
await ebusd_ReadValues();
|
|
142
|
+
|
|
143
|
+
await ebusd_ReceiveData();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
async function HandleStateChange(id, state) {
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
if (state.ack !== true) {
|
|
151
|
+
|
|
152
|
+
adapter.log.debug("handle state change " + id);
|
|
153
|
+
const ids = id.split(".");
|
|
154
|
+
|
|
155
|
+
if (ids[2] === "cmd") {
|
|
156
|
+
await ebusd_Command();
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
adapter.log.warn("unhandled state change " + id);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
89
162
|
|
|
90
163
|
}
|
|
91
164
|
|
|
165
|
+
|
|
166
|
+
|
|
92
167
|
let oPolledVars = [];
|
|
93
168
|
function FillPolledVars() {
|
|
94
169
|
|
|
@@ -146,93 +221,7 @@ function FillHistoryVars() {
|
|
|
146
221
|
}
|
|
147
222
|
|
|
148
223
|
|
|
149
|
-
async function Common_checkVariables() {
|
|
150
|
-
|
|
151
|
-
adapter.log.debug("init common variables and " + oHistoryVars.length + " history DP's");
|
|
152
|
-
let key;
|
|
153
|
-
let obj;
|
|
154
|
-
|
|
155
|
-
if (oHistoryVars.length > 0) {
|
|
156
|
-
|
|
157
|
-
if (oHistoryVars.length > 4) {
|
|
158
|
-
adapter.log.warn("too many history values " + oHistoryVars.length + " -> maximum is 4");
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
for (let n = 1; n <= oHistoryVars.length; n++) {
|
|
162
|
-
|
|
163
|
-
if (oHistoryVars[n - 1].name.length > 0) {
|
|
164
|
-
const name = "history value " + n + " as JSON " + oHistoryVars[n - 1].name;
|
|
165
|
-
key = "history.value" + n;
|
|
166
|
-
await adapter.setObjectNotExistsAsync(key, {
|
|
167
|
-
type: "state",
|
|
168
|
-
common: {
|
|
169
|
-
name: name,
|
|
170
|
-
type: "string",
|
|
171
|
-
role: "value",
|
|
172
|
-
unit: "",
|
|
173
|
-
read: true,
|
|
174
|
-
write: false
|
|
175
|
-
},
|
|
176
|
-
native: { location: key }
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
obj = await adapter.getObjectAsync(key);
|
|
180
|
-
|
|
181
|
-
if (obj != null) {
|
|
182
224
|
|
|
183
|
-
if (obj.common.role != "value" || obj.common.name != name) {
|
|
184
|
-
await adapter.extendObject(key, {
|
|
185
|
-
common: {
|
|
186
|
-
name: name,
|
|
187
|
-
role: "value",
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
adapter.log.warn("ignoring history value " + n + " (invalid name)");
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
key = "history.date";
|
|
199
|
-
await adapter.setObjectNotExistsAsync(key, {
|
|
200
|
-
type: "state",
|
|
201
|
-
common: { name: "ebus history date as JSON", type: "string", role: "value", unit: "", read: true, write: false },
|
|
202
|
-
native: { location: key }
|
|
203
|
-
});
|
|
204
|
-
obj = await adapter.getObjectAsync(key);
|
|
205
|
-
|
|
206
|
-
if (obj != null) {
|
|
207
|
-
|
|
208
|
-
if (obj.common.role != "value") {
|
|
209
|
-
await adapter.extendObject(key, {
|
|
210
|
-
common: {
|
|
211
|
-
role: "value",
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
key = "history.error";
|
|
218
|
-
await adapter.setObjectNotExistsAsync(key, {
|
|
219
|
-
type: "state",
|
|
220
|
-
common: { name: "ebus error", type: "string", role: "value", unit: "", read: true, write: false },
|
|
221
|
-
native: { location: key }
|
|
222
|
-
});
|
|
223
|
-
obj = await adapter.getObjectAsync(key);
|
|
224
|
-
|
|
225
|
-
if (obj != null) {
|
|
226
|
-
|
|
227
|
-
if (obj.common.role != "value") {
|
|
228
|
-
await adapter.extendObject(key, {
|
|
229
|
-
common: {
|
|
230
|
-
role: "value",
|
|
231
|
-
}
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
225
|
|
|
237
226
|
|
|
238
227
|
|
|
@@ -302,7 +291,12 @@ async function ebusd_Command() {
|
|
|
302
291
|
|
|
303
292
|
//just call http://192.168.0.123:8889/data
|
|
304
293
|
|
|
305
|
-
|
|
294
|
+
function subscribeVars() {
|
|
295
|
+
adapter.subscribeStates("cmd");
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
async function checkVariables() {
|
|
306
300
|
adapter.log.debug("init variables ");
|
|
307
301
|
|
|
308
302
|
let key;
|
|
@@ -356,7 +350,92 @@ async function ebusd_checkVariables() {
|
|
|
356
350
|
});
|
|
357
351
|
}
|
|
358
352
|
}
|
|
359
|
-
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
adapter.log.debug("init common variables and " + oHistoryVars.length + " history DP's");
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
if (oHistoryVars.length > 0) {
|
|
360
|
+
|
|
361
|
+
if (oHistoryVars.length > 4) {
|
|
362
|
+
adapter.log.warn("too many history values " + oHistoryVars.length + " -> maximum is 4");
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
for (let n = 1; n <= oHistoryVars.length; n++) {
|
|
366
|
+
|
|
367
|
+
if (oHistoryVars[n - 1].name.length > 0) {
|
|
368
|
+
const name = "history value " + n + " as JSON " + oHistoryVars[n - 1].name;
|
|
369
|
+
key = "history.value" + n;
|
|
370
|
+
await adapter.setObjectNotExistsAsync(key, {
|
|
371
|
+
type: "state",
|
|
372
|
+
common: {
|
|
373
|
+
name: name,
|
|
374
|
+
type: "string",
|
|
375
|
+
role: "value",
|
|
376
|
+
unit: "",
|
|
377
|
+
read: true,
|
|
378
|
+
write: false
|
|
379
|
+
},
|
|
380
|
+
native: { location: key }
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
obj = await adapter.getObjectAsync(key);
|
|
384
|
+
|
|
385
|
+
if (obj != null) {
|
|
386
|
+
|
|
387
|
+
if (obj.common.role != "value" || obj.common.name != name) {
|
|
388
|
+
await adapter.extendObject(key, {
|
|
389
|
+
common: {
|
|
390
|
+
name: name,
|
|
391
|
+
role: "value",
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
else {
|
|
398
|
+
adapter.log.warn("ignoring history value " + n + " (invalid name)");
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
key = "history.date";
|
|
403
|
+
await adapter.setObjectNotExistsAsync(key, {
|
|
404
|
+
type: "state",
|
|
405
|
+
common: { name: "ebus history date as JSON", type: "string", role: "value", unit: "", read: true, write: false },
|
|
406
|
+
native: { location: key }
|
|
407
|
+
});
|
|
408
|
+
obj = await adapter.getObjectAsync(key);
|
|
409
|
+
|
|
410
|
+
if (obj != null) {
|
|
411
|
+
|
|
412
|
+
if (obj.common.role != "value") {
|
|
413
|
+
await adapter.extendObject(key, {
|
|
414
|
+
common: {
|
|
415
|
+
role: "value",
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
key = "history.error";
|
|
422
|
+
await adapter.setObjectNotExistsAsync(key, {
|
|
423
|
+
type: "state",
|
|
424
|
+
common: { name: "ebus error", type: "string", role: "value", unit: "", read: true, write: false },
|
|
425
|
+
native: { location: key }
|
|
426
|
+
});
|
|
427
|
+
obj = await adapter.getObjectAsync(key);
|
|
428
|
+
|
|
429
|
+
if (obj != null) {
|
|
430
|
+
|
|
431
|
+
if (obj.common.role != "value") {
|
|
432
|
+
await adapter.extendObject(key, {
|
|
433
|
+
common: {
|
|
434
|
+
role: "value",
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
}
|
|
360
439
|
}
|
|
361
440
|
|
|
362
441
|
|
|
@@ -390,13 +469,19 @@ async function ebusd_ReceiveData() {
|
|
|
390
469
|
adapter.log.debug("request data from " + sUrl);
|
|
391
470
|
|
|
392
471
|
try {
|
|
393
|
-
|
|
472
|
+
/*
|
|
394
473
|
const getBuffer = bent("string");
|
|
395
474
|
const buffer = await getBuffer(sUrl);
|
|
475
|
+
*/
|
|
476
|
+
|
|
477
|
+
const buffer = await axios.get(sUrl);
|
|
396
478
|
|
|
397
|
-
|
|
479
|
+
adapter.log.debug("got data " + typeof buffer.data + " " + JSON.stringify(buffer.data));
|
|
398
480
|
|
|
399
|
-
|
|
481
|
+
//const oData = JSON.parse(buffer.data);
|
|
482
|
+
const oData = buffer.data;
|
|
483
|
+
|
|
484
|
+
//adapter.log.debug("oData " + oData);
|
|
400
485
|
|
|
401
486
|
const flatten = require("flat");
|
|
402
487
|
|
|
@@ -844,10 +929,6 @@ read -f YieldTotal,read LegioProtectionEnabled,read -f -c broadcast outsidetemp
|
|
|
844
929
|
//here we need a loop over all configured read data in admin-page
|
|
845
930
|
async function ebusd_ReadValues() {
|
|
846
931
|
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
932
|
if (oPolledVars.length > 0) {
|
|
852
933
|
|
|
853
934
|
adapter.log.debug("to poll ctr " + oPolledVars.length + " vals: " + JSON.stringify(oPolledVars));
|
|
@@ -860,6 +941,7 @@ async function ebusd_ReadValues() {
|
|
|
860
941
|
adapter.log.debug("telnet connected to poll variables " + adapter.config.targetIP + " port " + adapter.config.targetTelnetPort);
|
|
861
942
|
promiseSocket.setTimeout(5000);
|
|
862
943
|
|
|
944
|
+
let retries = 0;
|
|
863
945
|
for (let nCtr = 0; nCtr < oPolledVars.length; nCtr++) {
|
|
864
946
|
|
|
865
947
|
let circuit = "";
|
|
@@ -887,7 +969,16 @@ async function ebusd_ReadValues() {
|
|
|
887
969
|
* sent read -f YieldLastYear, received ERR: arbitration lost for {"circuit":"","name":"YieldLastYear","parameter":""}
|
|
888
970
|
* */
|
|
889
971
|
if (data.includes("arbitration lost")) {
|
|
890
|
-
|
|
972
|
+
|
|
973
|
+
retries++;
|
|
974
|
+
if (retries > adapter.config.maxretries) {
|
|
975
|
+
adapter.log.error("max retries, skip cmd " + cmd);
|
|
976
|
+
retries = 0;
|
|
977
|
+
}
|
|
978
|
+
else {
|
|
979
|
+
nCtr--;
|
|
980
|
+
adapter.log.debug("retry to send data ");
|
|
981
|
+
}
|
|
891
982
|
}
|
|
892
983
|
}
|
|
893
984
|
else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.ebus",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "ioBroker ebus Adapter",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "René G.",
|
|
@@ -20,32 +20,32 @@
|
|
|
20
20
|
"url": "https://github.com/rg-engineering/ioBroker.ebus"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@iobroker/adapter-core": "2.
|
|
24
|
-
"@sentry/node": "6.
|
|
25
|
-
"bent": "7.3.12",
|
|
23
|
+
"@iobroker/adapter-core": "2.6.0",
|
|
24
|
+
"@sentry/node": "6.19.3",
|
|
26
25
|
"flat": "5.0.2",
|
|
27
26
|
"net": "1.0.2",
|
|
28
|
-
"promise-socket": "7.0.0"
|
|
27
|
+
"promise-socket": "7.0.0",
|
|
28
|
+
"cron": "1.8.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@iobroker/testing": "2.5.
|
|
31
|
+
"@iobroker/testing": "2.5.6",
|
|
32
32
|
"@types/chai": "4.3.0",
|
|
33
|
-
"@types/chai-as-promised": "7.1.
|
|
33
|
+
"@types/chai-as-promised": "7.1.5",
|
|
34
34
|
"@types/gulp": "4.0.9",
|
|
35
|
-
"@types/mocha": "9.
|
|
36
|
-
"@types/node": "
|
|
35
|
+
"@types/mocha": "9.1.0",
|
|
36
|
+
"@types/node": "17.0.23",
|
|
37
37
|
"@types/proxyquire": "1.3.28",
|
|
38
38
|
"@types/request-promise-native": "1.0.18",
|
|
39
|
-
"@types/sinon": "10.0.
|
|
40
|
-
"@types/sinon-chai": "3.2.
|
|
41
|
-
"axios": "0.
|
|
42
|
-
"chai": "4.3.
|
|
39
|
+
"@types/sinon": "10.0.11",
|
|
40
|
+
"@types/sinon-chai": "3.2.8",
|
|
41
|
+
"axios": "0.26.1",
|
|
42
|
+
"chai": "4.3.6",
|
|
43
43
|
"chai-as-promised": "7.1.1",
|
|
44
|
-
"eslint": "8.
|
|
44
|
+
"eslint": "8.12.0",
|
|
45
45
|
"gulp": "4.0.2",
|
|
46
|
-
"mocha": "9.
|
|
46
|
+
"mocha": "9.2.2",
|
|
47
47
|
"proxyquire": "2.1.3",
|
|
48
|
-
"sinon": "
|
|
48
|
+
"sinon": "13.0.1",
|
|
49
49
|
"sinon-chai": "3.7.0"
|
|
50
50
|
},
|
|
51
51
|
"main": "main.js",
|