iobroker.ebus 3.0.0 → 3.0.3
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/LICENSE +18 -4
- package/README.md +13 -0
- package/admin/index_m.html +50 -46
- package/admin/words.js +1 -0
- package/io-package.json +78 -2
- package/main.js +90 -91
- package/package.json +12 -12
- package/widgets/ebus/lib/js/flot/jquery.canvaswrapper.js +0 -2
- package/widgets/ebus/lib/js/flot/jquery.flot.axislabels.js +1 -4
- package/widgets/ebus/lib/js/flot/jquery.flot.hover.js +2 -0
- package/widgets/ebus/lib/js/flot/jquery.flot.js +19 -17
- package/widgets/ebus/lib/js/flot/jquery.flot.time.js +6 -7
- package/widgets/ebus/lib/js/lib/globalize.culture.en-US.js +33 -0
- package/widgets/ebus/lib/js/lib/globalize.js +1601 -0
- package/widgets/ebus/lib/js/lib/jquery.event.drag.js +145 -0
- package/widgets/ebus/lib/js/lib/jquery.mousewheel.js +86 -0
- package/widgets/ebus.html +396 -205
- package/widgets/ebus/lib/js/flot/jquery.flot.axislabels_V2.js +0 -469
- package/widgets/ebus/lib/js/flot/jquery.flot.axislabels_V3.js +0 -221
package/LICENSE
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Copyright (c) 2017-2022 rg-engineering <info@rg-engineering.eu>
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -55,6 +55,19 @@ Attention: command in datapoint ebus.0.cmd is deleted after executing of command
|
|
|
55
55
|
|
|
56
56
|
## Changelog
|
|
57
57
|
|
|
58
|
+
### 3.0.3 (2022-08-18)
|
|
59
|
+
* (René) tooltip in wizard added
|
|
60
|
+
* (René) flot and dependencies updated
|
|
61
|
+
* (René) errors from ebusd are shown as warning here in adapter, details schould be checked in logs of ebusd
|
|
62
|
+
* (René) bug fix in widget: if less data available x axes grid point were not shown
|
|
63
|
+
* (René) except null as valid value from ebusd (e.g. to reset CurrentError)
|
|
64
|
+
|
|
65
|
+
### 3.0.2 (2022-04-02)
|
|
66
|
+
* (René) message for installation added
|
|
67
|
+
|
|
68
|
+
### 3.0.1 (2022-04-02)
|
|
69
|
+
* (René) read interval in admin added
|
|
70
|
+
|
|
58
71
|
### 3.0.0 (2022-04-02)
|
|
59
72
|
* (René) **ATTENTION** change from scheduled to daemon adapter
|
|
60
73
|
* (René) bent by axios replaced
|
package/admin/index_m.html
CHANGED
|
@@ -260,8 +260,7 @@
|
|
|
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>
|
|
@@ -269,76 +268,81 @@
|
|
|
269
268
|
</div>
|
|
270
269
|
<div class="row">
|
|
271
270
|
<div class="input-field col s12 m4 l3">
|
|
272
|
-
<input class="value number" id="
|
|
273
|
-
<label for="
|
|
271
|
+
<input class="value number" id="readInterval" size="3" maxlength="3" type="number" />
|
|
272
|
+
<label for="readInterval" class="translate">readInterval</label>
|
|
274
273
|
</div>
|
|
275
274
|
</div>
|
|
276
275
|
<div class="row">
|
|
276
|
+
<div class="input-field col s12 m4 l3">
|
|
277
|
+
<input class="value number" id="parseTimeout" size="3" maxlength="3" type="number" />
|
|
278
|
+
<label for="parseTimeout" class="translate">parse_timeout</label>
|
|
279
|
+
</div>
|
|
280
|
+
|
|
277
281
|
<div class="input-field col s12 m4 l3">
|
|
278
282
|
<input class="value number" id="maxretries" size="3" maxlength="3" type="number" min="0" max="10" />
|
|
279
283
|
<label for="maxretries" class="translate">maxretries</label>
|
|
280
284
|
</div>
|
|
281
285
|
</div>
|
|
282
286
|
|
|
283
|
-
|
|
287
|
+
|
|
284
288
|
|
|
285
289
|
</div>
|
|
286
290
|
|
|
287
|
-
|
|
288
|
-
|
|
291
|
+
<!-- tab "tab-polledDP" -->
|
|
292
|
+
<div id="tab-polledDP" class="col s12 page">
|
|
289
293
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
294
|
+
<div class="row">
|
|
295
|
+
<div class="col s6">
|
|
296
|
+
<span class="translate">hint_ebusd_polled</span>
|
|
297
|
+
</div>
|
|
293
298
|
</div>
|
|
294
|
-
</div>
|
|
295
299
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
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>
|
|
311
316
|
</div>
|
|
312
317
|
</div>
|
|
313
|
-
</div>
|
|
314
318
|
|
|
315
|
-
|
|
316
|
-
|
|
319
|
+
<!-- tab "tab-historyDP" -->
|
|
320
|
+
<div id="tab-historyDP" class="col s12 page">
|
|
317
321
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
322
|
+
<div class="row">
|
|
323
|
+
<div class="col s6">
|
|
324
|
+
<span class="translate">hint_ebusd_history</span>
|
|
325
|
+
</div>
|
|
321
326
|
</div>
|
|
322
|
-
</div>
|
|
323
327
|
|
|
324
|
-
|
|
328
|
+
<div class="col s12" id="historyDP">
|
|
325
329
|
|
|
326
|
-
|
|
330
|
+
<a class="btn-floating waves-effect waves-light blue table-button-add"><i class="material-icons">add</i></a>
|
|
327
331
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
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>
|
|
337
342
|
</div>
|
|
338
343
|
</div>
|
|
339
|
-
</div>
|
|
340
344
|
|
|
341
|
-
|
|
345
|
+
</div>
|
|
342
346
|
</div>
|
|
343
347
|
</body>
|
|
344
348
|
</html>
|
package/admin/words.js
CHANGED
|
@@ -13,6 +13,7 @@ systemDictionary = {
|
|
|
13
13
|
"name": { "en": "name", "de": "Name", "ru": "имя", "pt": "nome", "nl": "naam", "fr": "Nom", "it": "nome", "es": "nombre", "pl": "Nazwa", "zh-cn": "姓名"},
|
|
14
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": "下载和轮询超时[秒]"},
|
|
15
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 读取数据的间隔 [分钟]"},
|
|
16
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端口以读取数据"},
|
|
17
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"},
|
|
18
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,8 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "ebus",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.3",
|
|
5
5
|
"news": {
|
|
6
|
+
"3.0.3": {
|
|
7
|
+
"en": "widget with tooltip",
|
|
8
|
+
"de": "Widget mit Tooltip",
|
|
9
|
+
"ru": "виджет с подсказкой",
|
|
10
|
+
"pt": "widget com dica de ferramenta",
|
|
11
|
+
"nl": "widget met knopinfo",
|
|
12
|
+
"fr": "widget avec info-bulle",
|
|
13
|
+
"it": "widget con descrizione comando",
|
|
14
|
+
"es": "widget con información sobre herramientas",
|
|
15
|
+
"pl": "widżet z podpowiedź",
|
|
16
|
+
"zh-cn": "带有工具提示的小部件"
|
|
17
|
+
},
|
|
18
|
+
"3.0.2": {
|
|
19
|
+
"en": "message installation hint added",
|
|
20
|
+
"de": "Nachricht Installationshinweis hinzugefügt",
|
|
21
|
+
"ru": "добавлена подсказка установки сообщения",
|
|
22
|
+
"pt": "dica de instalação de mensagem adicionada",
|
|
23
|
+
"nl": "bericht installatie hint toegevoegd",
|
|
24
|
+
"fr": "astuce d'installation de message ajoutée",
|
|
25
|
+
"it": "suggerimento per l'installazione del messaggio aggiunto",
|
|
26
|
+
"es": "sugerencia de instalación de mensajes agregada",
|
|
27
|
+
"pl": "dodano wskazówkę dotyczącą instalacji wiadomości",
|
|
28
|
+
"zh-cn": "添加了消息安装提示"
|
|
29
|
+
},
|
|
30
|
+
"3.0.1": {
|
|
31
|
+
"en": "read interval in admin added",
|
|
32
|
+
"de": "Leseintervall im Admin hinzugefügt",
|
|
33
|
+
"ru": "добавлен интервал чтения в админке",
|
|
34
|
+
"pt": "intervalo de leitura no admin adicionado",
|
|
35
|
+
"nl": "leesinterval in admin toegevoegd",
|
|
36
|
+
"fr": "intervalle de lecture ajouté dans l'administrateur",
|
|
37
|
+
"it": "intervallo di lettura in admin aggiunto",
|
|
38
|
+
"es": "Intervalo de lectura en el administrador agregado",
|
|
39
|
+
"pl": "dodano interwał odczytu w admin",
|
|
40
|
+
"zh-cn": "添加了管理员中的读取间隔"
|
|
41
|
+
},
|
|
6
42
|
"3.0.0": {
|
|
7
43
|
"en": "from 'scheduled' to 'daemon' adapter changed",
|
|
8
44
|
"de": "von 'geplant' zu 'daemon' Adapter geändert",
|
|
@@ -101,7 +137,47 @@
|
|
|
101
137
|
"dataSource": "push",
|
|
102
138
|
"adminUI": {
|
|
103
139
|
"config": "materialize"
|
|
104
|
-
}
|
|
140
|
+
},
|
|
141
|
+
"messages": [
|
|
142
|
+
{
|
|
143
|
+
"condition": {
|
|
144
|
+
"operand": "and",
|
|
145
|
+
"rules": [
|
|
146
|
+
"oldVersion<3.0.0",
|
|
147
|
+
"newVersion>=3.0.0"
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
"title": {
|
|
151
|
+
"en": "from 'scheduled' to 'daemon' adapter changed",
|
|
152
|
+
"de": "von 'geplant' zu 'daemon' Adapter geändert",
|
|
153
|
+
"ru": "изменен адаптер с «запланированного» на «демон»",
|
|
154
|
+
"pt": "adaptador 'agendado' para 'daemon' alterado",
|
|
155
|
+
"nl": "van 'scheduled' naar 'daemon' adapter gewijzigd",
|
|
156
|
+
"fr": "de l'adaptateur 'scheduled' à 'daemon' changé",
|
|
157
|
+
"it": "adattatore da \"programmato\" a \"demone\" modificato",
|
|
158
|
+
"es": "Se cambió el adaptador de 'programado' a 'daemon'",
|
|
159
|
+
"pl": "Zmieniono adapter z „zaplanowanego” na „demon”",
|
|
160
|
+
"zh-cn": "从 'scheduled' 到 'daemon' 适配器已更改"
|
|
161
|
+
},
|
|
162
|
+
"text": {
|
|
163
|
+
"en": "it might be necessary to deinstall old version and then install new version",
|
|
164
|
+
"de": "Es kann erforderlich sein, die alte Version zu deinstallieren und dann die neue Version zu installieren",
|
|
165
|
+
"ru": "может быть необходимо удалить старую версию, а затем установить новую версию",
|
|
166
|
+
"pt": "pode ser necessário desinstalar a versão antiga e depois instalar a nova versão",
|
|
167
|
+
"nl": "het kan nodig zijn om de oude versie te deïnstalleren en vervolgens de nieuwe versie te installeren",
|
|
168
|
+
"fr": "il peut être nécessaire de désinstaller l'ancienne version puis d'installer la nouvelle version",
|
|
169
|
+
"it": "potrebbe essere necessario disinstallare la vecchia versione e quindi installare la nuova versione",
|
|
170
|
+
"es": "puede ser necesario desinstalar la versión anterior y luego instalar la nueva versión",
|
|
171
|
+
"pl": "może być konieczne odinstalowanie starej wersji, a następnie zainstalowanie nowej wersji",
|
|
172
|
+
"zh-cn": "可能需要卸载旧版本,然后安装新版本"
|
|
173
|
+
},
|
|
174
|
+
"level": "warn",
|
|
175
|
+
"buttons": [
|
|
176
|
+
"agree",
|
|
177
|
+
"cancel"
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
]
|
|
105
181
|
},
|
|
106
182
|
"native": {
|
|
107
183
|
"targetIP": "192.168.0.1",
|
package/main.js
CHANGED
|
@@ -48,10 +48,12 @@ function startAdapter(options) {
|
|
|
48
48
|
},
|
|
49
49
|
//#######################################
|
|
50
50
|
//
|
|
51
|
-
SIGINT: function () {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
//SIGINT: function () {
|
|
52
|
+
// clearInterval(intervalID);
|
|
53
|
+
// intervalID = null;
|
|
54
|
+
// adapter && adapter.log && adapter.log.info && adapter.log.info("cleaned everything up...");
|
|
55
|
+
// CronStop();
|
|
56
|
+
//},
|
|
55
57
|
//#######################################
|
|
56
58
|
// is called if a subscribed object changes
|
|
57
59
|
//objectChange: function (id, obj) {
|
|
@@ -259,7 +261,7 @@ async function ebusd_Command() {
|
|
|
259
261
|
const data = await promiseSocket.read();
|
|
260
262
|
|
|
261
263
|
if (data.includes("ERR")) {
|
|
262
|
-
adapter.log.
|
|
264
|
+
adapter.log.warn("sent " + oCmds[n] + ", received " + data + " please check ebusd logs for details!";
|
|
263
265
|
}
|
|
264
266
|
else {
|
|
265
267
|
adapter.log.debug("received " + data);
|
|
@@ -295,6 +297,39 @@ function subscribeVars() {
|
|
|
295
297
|
adapter.subscribeStates("cmd");
|
|
296
298
|
}
|
|
297
299
|
|
|
300
|
+
async function CreateObject(key, obj) {
|
|
301
|
+
|
|
302
|
+
const obj_new = await adapter.getObjectAsync(key);
|
|
303
|
+
//adapter.log.warn("got object " + JSON.stringify(obj_new));
|
|
304
|
+
|
|
305
|
+
if (obj_new != null) {
|
|
306
|
+
|
|
307
|
+
if ((obj_new.common.role != obj.common.role
|
|
308
|
+
|| obj_new.common.type != obj.common.type
|
|
309
|
+
|| (obj_new.common.unit != obj.common.unit && obj.common.unit != null)
|
|
310
|
+
|| obj_new.common.read != obj.common.read
|
|
311
|
+
|| obj_new.common.write != obj.common.write
|
|
312
|
+
|| obj_new.common.name != obj.common.name)
|
|
313
|
+
&& obj.type === "state"
|
|
314
|
+
) {
|
|
315
|
+
adapter.log.warn("change object " + JSON.stringify(obj) + " " + JSON.stringify(obj_new));
|
|
316
|
+
await adapter.extendObject(key, {
|
|
317
|
+
common: {
|
|
318
|
+
name: obj.common.name,
|
|
319
|
+
role: obj.common.role,
|
|
320
|
+
type: obj.common.type,
|
|
321
|
+
unit: obj.common.unit,
|
|
322
|
+
read: obj.common.read,
|
|
323
|
+
write: obj.common.write
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
await adapter.setObjectNotExistsAsync(key, obj);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
298
333
|
|
|
299
334
|
async function checkVariables() {
|
|
300
335
|
adapter.log.debug("init variables ");
|
|
@@ -303,7 +338,7 @@ async function checkVariables() {
|
|
|
303
338
|
let obj;
|
|
304
339
|
|
|
305
340
|
key = "cmd";
|
|
306
|
-
|
|
341
|
+
obj= {
|
|
307
342
|
type: "state",
|
|
308
343
|
common: {
|
|
309
344
|
name: "ebusd command",
|
|
@@ -312,23 +347,11 @@ async function checkVariables() {
|
|
|
312
347
|
read: true,
|
|
313
348
|
write: true
|
|
314
349
|
}
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
obj = await adapter.getObjectAsync(key);
|
|
318
|
-
|
|
319
|
-
if (obj != null) {
|
|
320
|
-
|
|
321
|
-
if (obj.common.role != "text") {
|
|
322
|
-
await adapter.extendObject(key, {
|
|
323
|
-
common: {
|
|
324
|
-
role: "text",
|
|
325
|
-
}
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
}
|
|
350
|
+
};
|
|
351
|
+
await CreateObject(key, obj);
|
|
329
352
|
|
|
330
353
|
key = "cmdResult";
|
|
331
|
-
|
|
354
|
+
obj = {
|
|
332
355
|
type: "state",
|
|
333
356
|
common: {
|
|
334
357
|
name: "ebusd command result",
|
|
@@ -337,25 +360,11 @@ async function checkVariables() {
|
|
|
337
360
|
read: true,
|
|
338
361
|
write: false
|
|
339
362
|
}
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
if (obj != null) {
|
|
344
|
-
|
|
345
|
-
if (obj.common.role != "text") {
|
|
346
|
-
await adapter.extendObject(key, {
|
|
347
|
-
common: {
|
|
348
|
-
role: "text",
|
|
349
|
-
}
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
|
|
363
|
+
};
|
|
364
|
+
await CreateObject(key, obj);
|
|
355
365
|
|
|
356
366
|
adapter.log.debug("init common variables and " + oHistoryVars.length + " history DP's");
|
|
357
367
|
|
|
358
|
-
|
|
359
368
|
if (oHistoryVars.length > 0) {
|
|
360
369
|
|
|
361
370
|
if (oHistoryVars.length > 4) {
|
|
@@ -367,7 +376,7 @@ async function checkVariables() {
|
|
|
367
376
|
if (oHistoryVars[n - 1].name.length > 0) {
|
|
368
377
|
const name = "history value " + n + " as JSON " + oHistoryVars[n - 1].name;
|
|
369
378
|
key = "history.value" + n;
|
|
370
|
-
|
|
379
|
+
obj= {
|
|
371
380
|
type: "state",
|
|
372
381
|
common: {
|
|
373
382
|
name: name,
|
|
@@ -378,21 +387,8 @@ async function checkVariables() {
|
|
|
378
387
|
write: false
|
|
379
388
|
},
|
|
380
389
|
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
|
-
}
|
|
390
|
+
};
|
|
391
|
+
await CreateObject(key, obj);
|
|
396
392
|
}
|
|
397
393
|
else {
|
|
398
394
|
adapter.log.warn("ignoring history value " + n + " (invalid name)");
|
|
@@ -400,42 +396,36 @@ async function checkVariables() {
|
|
|
400
396
|
}
|
|
401
397
|
|
|
402
398
|
key = "history.date";
|
|
403
|
-
|
|
399
|
+
obj= {
|
|
404
400
|
type: "state",
|
|
405
|
-
common: {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
role: "value",
|
|
416
|
-
}
|
|
417
|
-
});
|
|
401
|
+
common: {
|
|
402
|
+
name: "ebus history date as JSON",
|
|
403
|
+
type: "string",
|
|
404
|
+
role: "value",
|
|
405
|
+
unit: "",
|
|
406
|
+
read: true,
|
|
407
|
+
write: false
|
|
408
|
+
},
|
|
409
|
+
native: {
|
|
410
|
+
location: key
|
|
418
411
|
}
|
|
419
|
-
}
|
|
412
|
+
};
|
|
413
|
+
await CreateObject(key, obj);
|
|
420
414
|
}
|
|
421
415
|
key = "history.error";
|
|
422
|
-
|
|
416
|
+
obj= {
|
|
423
417
|
type: "state",
|
|
424
|
-
common: {
|
|
418
|
+
common: {
|
|
419
|
+
name: "ebus error",
|
|
420
|
+
type: "string",
|
|
421
|
+
role: "value",
|
|
422
|
+
unit: "",
|
|
423
|
+
read: true,
|
|
424
|
+
write: false
|
|
425
|
+
},
|
|
425
426
|
native: { location: key }
|
|
426
|
-
}
|
|
427
|
-
|
|
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
|
-
}
|
|
427
|
+
};
|
|
428
|
+
await CreateObject(key, obj);
|
|
439
429
|
}
|
|
440
430
|
|
|
441
431
|
|
|
@@ -534,7 +524,7 @@ async function ebusd_ReceiveData() {
|
|
|
534
524
|
//adapter.log.info("in version, value " + value);
|
|
535
525
|
const versionInfo = value.split('.');
|
|
536
526
|
if (versionInfo.length > 1) {
|
|
537
|
-
adapter.log.info("
|
|
527
|
+
adapter.log.info("installed ebusd version is " + versionInfo[0] + "." + versionInfo[1]);
|
|
538
528
|
|
|
539
529
|
ebusdVersion[0] = versionInfo[0];
|
|
540
530
|
ebusdVersion[1] = versionInfo[1];
|
|
@@ -578,11 +568,17 @@ async function ebusd_ReceiveData() {
|
|
|
578
568
|
|
|
579
569
|
|
|
580
570
|
if (name === "hcmode2") {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
571
|
+
if (parseInt(value) === 0) {
|
|
572
|
+
adapter.log.info(key + "in hcmode2 with value 0: off");
|
|
573
|
+
value = "off";
|
|
574
|
+
}
|
|
575
|
+
else if (parseInt(value) === 5) {
|
|
576
|
+
adapter.log.info(key + " with value 5: EVU Sperrzeit");
|
|
584
577
|
value = "EVU Sperrzeit";
|
|
585
578
|
}
|
|
579
|
+
else {
|
|
580
|
+
adapter.log.debug("in hcmode2, value " + value);
|
|
581
|
+
}
|
|
586
582
|
}
|
|
587
583
|
|
|
588
584
|
let type = typeof value;
|
|
@@ -894,12 +890,15 @@ async function AddObject(key, type) {
|
|
|
894
890
|
|
|
895
891
|
async function UpdateObject(key, value) {
|
|
896
892
|
try {
|
|
897
|
-
if (
|
|
898
|
-
adapter.log.
|
|
893
|
+
if (typeof value == undefined) {
|
|
894
|
+
adapter.log.warn("updateObject: not updated " + key + " value: " + value + " " + typeof value);
|
|
895
|
+
}
|
|
896
|
+
else if (value == null ) {
|
|
897
|
+
adapter.log.debug("updateObject: update to null " + key + " value: " + value);
|
|
898
|
+
await adapter.setStateAsync(key, { ack: true, val: null });
|
|
899
899
|
}
|
|
900
900
|
else {
|
|
901
901
|
adapter.log.debug("updateObject " + key + " : " + value);
|
|
902
|
-
|
|
903
902
|
await adapter.setStateAsync(key, { ack: true, val: value });
|
|
904
903
|
}
|
|
905
904
|
} catch (e) {
|
|
@@ -963,7 +962,7 @@ async function ebusd_ReadValues() {
|
|
|
963
962
|
|
|
964
963
|
//received ERR: arbitration lost for YieldThisYear
|
|
965
964
|
if (data.includes("ERR")) {
|
|
966
|
-
adapter.log.
|
|
965
|
+
adapter.log.warn("sent " + cmd + ", received " + data + " for " + JSON.stringify(oPolledVars[nCtr]) + " please check ebusd logs for details!");
|
|
967
966
|
|
|
968
967
|
/*
|
|
969
968
|
* sent read -f YieldLastYear, received ERR: arbitration lost for {"circuit":"","name":"YieldLastYear","parameter":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.ebus",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "ioBroker ebus Adapter",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "René G.",
|
|
@@ -21,31 +21,31 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@iobroker/adapter-core": "2.6.0",
|
|
24
|
-
"@sentry/node": "6.19.3",
|
|
25
24
|
"flat": "5.0.2",
|
|
26
25
|
"net": "1.0.2",
|
|
27
26
|
"promise-socket": "7.0.0",
|
|
28
|
-
"cron": "1.
|
|
27
|
+
"cron": "2.1.0",
|
|
28
|
+
"axios": "0.27.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@iobroker/testing": "
|
|
32
|
-
"@types/chai": "4.3.
|
|
31
|
+
"@iobroker/testing": "3.0.2",
|
|
32
|
+
"@types/chai": "4.3.3",
|
|
33
33
|
"@types/chai-as-promised": "7.1.5",
|
|
34
34
|
"@types/gulp": "4.0.9",
|
|
35
|
-
"@types/mocha": "9.1.
|
|
36
|
-
"@types/node": "
|
|
35
|
+
"@types/mocha": "9.1.1",
|
|
36
|
+
"@types/node": "18.7.3",
|
|
37
37
|
"@types/proxyquire": "1.3.28",
|
|
38
38
|
"@types/request-promise-native": "1.0.18",
|
|
39
|
-
"@types/sinon": "10.0.
|
|
39
|
+
"@types/sinon": "10.0.13",
|
|
40
40
|
"@types/sinon-chai": "3.2.8",
|
|
41
|
-
"axios": "0.
|
|
41
|
+
"axios": "0.27.2",
|
|
42
42
|
"chai": "4.3.6",
|
|
43
43
|
"chai-as-promised": "7.1.1",
|
|
44
|
-
"eslint": "8.
|
|
44
|
+
"eslint": "8.22.0",
|
|
45
45
|
"gulp": "4.0.2",
|
|
46
|
-
"mocha": "
|
|
46
|
+
"mocha": "10.0.0",
|
|
47
47
|
"proxyquire": "2.1.3",
|
|
48
|
-
"sinon": "
|
|
48
|
+
"sinon": "14.0.0",
|
|
49
49
|
"sinon-chai": "3.7.0"
|
|
50
50
|
},
|
|
51
51
|
"main": "main.js",
|
|
@@ -372,8 +372,6 @@ don't work unless the canvas is attached to the DOM.
|
|
|
372
372
|
|
|
373
373
|
// Tweak the div's position to match the text's alignment
|
|
374
374
|
|
|
375
|
-
console.log('add text ' + text);
|
|
376
|
-
|
|
377
375
|
if (halign === 'center') {
|
|
378
376
|
x -= info.width / 2;
|
|
379
377
|
} else if (halign === 'right') {
|