iobroker.openknx 0.7.2 → 0.7.3-alpha.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 +14 -6
- package/admin/i18n/de/translations.json +2 -1
- package/admin/index_m.html +14 -17
- package/io-package.json +15 -14
- package/lib/doubleKeyedMap.js +7 -0
- package/main.js +58 -58
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -58,10 +58,14 @@ If you experience disconnects from your KNX IP Gateway in the log then increase
|
|
|
58
58
|
|
|
59
59
|
Use in IOB Object common.type boolean for 1 bit enum instead of number.
|
|
60
60
|
|
|
61
|
-
### readout values of
|
|
61
|
+
### readout KNX values on startup of iob objects that are configured for autoread
|
|
62
62
|
|
|
63
63
|
All IOB objects that are configured with the autoread flag are requested on the bus to be synchronized with IOB.
|
|
64
64
|
|
|
65
|
+
### do not warn on unknown KNX group adresses
|
|
66
|
+
|
|
67
|
+
Do not create a warn log entry in the protocol on receiving an unknown ga.
|
|
68
|
+
|
|
65
69
|
### do not overwrite existing IOB objects
|
|
66
70
|
|
|
67
71
|
If checked, the import will skip overwriting existing communication objects.
|
|
@@ -401,13 +405,17 @@ Openknx estimates the current bus load of the KNX line it is connected to in obj
|
|
|
401
405
|
* .... -> this is used by script to generate a new entry, copy after a new release
|
|
402
406
|
* npm run release
|
|
403
407
|
* npm run release major/minor/patch major.minor.patch
|
|
408
|
+
* update gui: iob upload openknx
|
|
404
409
|
-->
|
|
410
|
+
### 0.7.3-alpha.0 (2024-03-04)
|
|
411
|
+
|
|
412
|
+
- feature: one of the warnings is configurable in the dialog
|
|
405
413
|
|
|
406
|
-
### **WORK IN PROGRESS**
|
|
407
414
|
### 0.7.2 (2024-01-09)
|
|
408
|
-
|
|
409
|
-
-
|
|
410
|
-
-
|
|
415
|
+
|
|
416
|
+
- feature: handle network connection instability issues
|
|
417
|
+
- feature: generate more log messages
|
|
418
|
+
- bugfix: telegram count
|
|
411
419
|
|
|
412
420
|
### 0.7.1 (2024-01-07)
|
|
413
421
|
|
|
@@ -584,7 +592,7 @@ Openknx estimates the current bus load of the KNX line it is connected to in obj
|
|
|
584
592
|
|
|
585
593
|
### 0.1.13 (2021-12-30)
|
|
586
594
|
|
|
587
|
-
- bugfix: state.value of
|
|
595
|
+
- bugfix: state.value of type object must be serialized
|
|
588
596
|
- bugfix: alias algorithm error handling, takover more info to alias
|
|
589
597
|
|
|
590
598
|
### 0.1.12 (2021-12-30)
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
"detect interface": "Schnittstelle erkennen",
|
|
6
6
|
"Local IPv4 network interface": "Lokale IPv4-Netzwerkschnittstelle",
|
|
7
7
|
"Minimum send delay between two frames [ms]": "Minimale Sendeverzögerung zwischen zwei Frames [ms]",
|
|
8
|
-
"readout values of
|
|
8
|
+
"readout KNX values on startup of iob objects that are configured for autoread": "Werte von atoread IOB objekten beim Start auslesen",
|
|
9
|
+
"do not warn on unknown KNX group adresses": "keine Protokoll Warnung bei Empfang unbekannter KNX GAs",
|
|
9
10
|
"do not overwrite existing IOB objects": "Importieren Sie nur GAs, die nicht in IOB-Objekten vorhanden sind",
|
|
10
11
|
"remove existing IOB objects that are not in ETS import file": "Entfernen Sie vorhandene IOB-Objekte, die nicht in der ETS Importdatei enthalten sind",
|
|
11
12
|
"use common.type boolean for 1 bit enum instead of number": "Verwenden Sie common.type boolean für 1-Bit-Enum anstelle von Zahl",
|
package/admin/index_m.html
CHANGED
|
@@ -301,7 +301,7 @@
|
|
|
301
301
|
|
|
302
302
|
function processDetectInterface() {
|
|
303
303
|
if ($("#localInterface")[0].value == "") {
|
|
304
|
-
showMessage(_("Please select your local interface first."));
|
|
304
|
+
showMessage(_("Please select your local network interface first."));
|
|
305
305
|
} else {
|
|
306
306
|
disableAllButtons();
|
|
307
307
|
window.isProcessingRequest = true;
|
|
@@ -362,11 +362,8 @@
|
|
|
362
362
|
Note: KNX secure is not supported, please do not activate secure comissioning in
|
|
363
363
|
ETS.<br />
|
|
364
364
|
If you like OpenKNX, please consider a donation:<br />
|
|
365
|
-
<a
|
|
366
|
-
|
|
367
|
-
>
|
|
368
|
-
<img src=https://www.paypalobjects.com/en_US/DK/i/btn/btn_donateCC_LG.gif></a
|
|
369
|
-
>
|
|
365
|
+
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Z8UFC8QEC4ARW&source=url">
|
|
366
|
+
<img src=https://www.paypalobjects.com/en_US/DK/i/btn/btn_donateCC_LG.gif></a>
|
|
370
367
|
</span>
|
|
371
368
|
</div>
|
|
372
369
|
</div>
|
|
@@ -386,8 +383,7 @@
|
|
|
386
383
|
<div class="col s6 l2">
|
|
387
384
|
<a id="detectInterface" class="waves-effect waves-light btn"
|
|
388
385
|
><i class="material-icons right">live help</i
|
|
389
|
-
><span class="translate">detect interface</span></a
|
|
390
|
-
>
|
|
386
|
+
><span class="translate">detect interface</span></a>
|
|
391
387
|
</div>
|
|
392
388
|
<div class="col s12 l3">
|
|
393
389
|
<h7 id="deviceName"> </h7>
|
|
@@ -401,15 +397,18 @@
|
|
|
401
397
|
<div class="col s6 l2 input-field">
|
|
402
398
|
<input id="minimumDelay" class="value" type="text" />
|
|
403
399
|
<label for="minimumDelay" class="translate">
|
|
404
|
-
Minimum send delay between two frames [ms]</label
|
|
405
|
-
>
|
|
400
|
+
Minimum send delay between two frames [ms]</label>
|
|
406
401
|
</div>
|
|
407
402
|
<!-- materialize grid small 12 of 12 columns https://materializecss.com/grid.html -->
|
|
408
403
|
<div class="col s12 input-field">
|
|
409
404
|
<input class="value" id="autoreadEnabled" type="checkbox" />
|
|
410
405
|
<label class="translate" for="autoreadEnabled">
|
|
411
|
-
readout values of autoread iob objects on startup</label
|
|
412
|
-
|
|
406
|
+
readout values of autoread iob objects on startup</label>
|
|
407
|
+
<div class="col s12 input-field">
|
|
408
|
+
<input class="value" id="noWarnUnknownGa" type="checkbox" />
|
|
409
|
+
<label class="translate" for="onlyAddNewObjects"
|
|
410
|
+
>do not warn on unknown KNX group adresses</label>
|
|
411
|
+
</div>
|
|
413
412
|
</div>
|
|
414
413
|
</div>
|
|
415
414
|
</div>
|
|
@@ -422,18 +421,16 @@
|
|
|
422
421
|
<label class="translate" for="onlyAddNewObjects"
|
|
423
422
|
>do not overwrite existing IOB objects</label
|
|
424
423
|
>
|
|
425
|
-
</div>
|
|
424
|
+
</div>
|
|
426
425
|
<div class="col s12 input-field">
|
|
427
426
|
<input class="value" id="removeUnusedObjects" type="checkbox" />
|
|
428
427
|
<label class="translate" for="removeUnusedObjects"
|
|
429
|
-
>remove existing IOB objects that are not in ETS import file</label
|
|
430
|
-
>
|
|
428
|
+
>remove existing IOB objects that are not in ETS import file</label>
|
|
431
429
|
</div>
|
|
432
430
|
<div class="col s12 input-field">
|
|
433
431
|
<input class="value" id="useBoolean" type="checkbox" />
|
|
434
432
|
<label class="translate" for="useBoolean"
|
|
435
|
-
>use common.type boolean for 1 bit enum instead of number</label
|
|
436
|
-
>
|
|
433
|
+
>use common.type boolean for 1 bit enum instead of number</label>
|
|
437
434
|
</div>
|
|
438
435
|
|
|
439
436
|
<div class="col s12 m12 l6 file-field input-field">
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "openknx",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.3-alpha.0",
|
|
5
5
|
"news": {
|
|
6
|
+
"0.7.3-alpha.0": {
|
|
7
|
+
"en": "feature: one of the warnings is configurable in the dialog",
|
|
8
|
+
"de": "feature: eine der warnungen ist im dialog konfigurierbar",
|
|
9
|
+
"ru": "функция: одно из предупреждений настраивается в диалоге",
|
|
10
|
+
"pt": "recurso: um dos avisos é configurável na caixa de diálogo",
|
|
11
|
+
"nl": "functie: een van de waarschuwingen is in het dialoogvenster instelbaar",
|
|
12
|
+
"fr": "fonctionnalité : un des avertissements est configurable dans la boîte de dialogue",
|
|
13
|
+
"it": "caratteristica: uno degli avvisi è configurabile nella finestra di dialogo",
|
|
14
|
+
"es": "función: una de las advertencias es configurable en el diálogo",
|
|
15
|
+
"pl": "funkcja: jeden z ostrzeżeń jest konfigurowalny w oknie dialogowym",
|
|
16
|
+
"uk": "функція: один з попереджень налаштований у діалоговому вікні",
|
|
17
|
+
"zh-cn": "特性: 在对话框中可配置警告之一"
|
|
18
|
+
},
|
|
6
19
|
"0.7.2": {
|
|
7
20
|
"en": "feature: handle network connection instability issesues\nfeature: generate more log messages\nbugfix: telegram count",
|
|
8
21
|
"de": "funktion: netzwerk-verbindung instabilität ist\nfeature: mehr log-nachrichten generieren\nbugfix: telegrammzählung",
|
|
@@ -80,19 +93,6 @@
|
|
|
80
93
|
"pl": "wykorzystywanie: KNX\nwykorzystywać standardowe autoready umożliwiające niektóre typy danych DPT1, które są uruchamiane\ntrąbka: w błędzie logowania",
|
|
81
94
|
"uk": "функція: додати вимірювання навантаження на автобус KNX\nфункція: видалення стандартних автопрочитаних пристроїв для деяких типів даних DPT1, які є тригерами\nвиправлення помилок",
|
|
82
95
|
"zh-cn": "特征:增加KNX汽车载荷测量\n特点:取消标准汽车,使一些DPT1数据型能够触发。\nbugfix:错误伐木"
|
|
83
|
-
},
|
|
84
|
-
"0.5.3": {
|
|
85
|
-
"en": "savek-cc bugfix: Fix handling of addinfo_length - used to crash if addinfo was actually supplied #338\nbugfix: admin menu scroll small screen #339\nfeature: add dpt 9.009",
|
|
86
|
-
"de": "speicher-cc Bugfix: Fix Handling von addinfo_length - verwendet, um abzustürzen, wenn addinfo tatsächlich geliefert wurde #338\nbugfix: admin-menü scroll kleinen bildschirm #339\nfunktion: dpt 9.009 hinzufügen",
|
|
87
|
-
"ru": "savek-cc багфикс: Исправление обработки addinfo_length - используется для сбоя, если addinfo был фактически поставлен #338\nbugfix: admin меню прокрутите небольшой экран #339\nфункция: добавить dpt 9.009",
|
|
88
|
-
"pt": "savek-cc bugfix: Fix manuseio de addinfo_length - usado para travar se addinfo foi realmente fornecido #338\nbugfix: menu admin scroll pequena tela #339\ncaracterística: adicionar dpt 9.009",
|
|
89
|
-
"nl": "redk-cc bugfix: Vertaling:\nquality over quantity (qoq) releases vertaling:\nvertaling:",
|
|
90
|
-
"fr": "savek-cc bugfix: Correction de la manipulation de addinfo_length - utilisé pour planter si addinfo a été effectivement fourni #338\nbugfix: menu administrateur défilement petit écran #339\nfonction: ajouter dpt 9.009",
|
|
91
|
-
"it": "savek-cc bugfix: Fissare la gestione di addinfo_length - usato per crash se addinfo è stato effettivamente fornito #338\nbugfix: admin menu scroll piccolo schermo #339\ncaratteristica: aggiungere dpt 9.009",
|
|
92
|
-
"es": "savek-cc bugfix: Manejo fijo de addinfo_length - utilizado para chocar si addinfo fue realmente suministrado #338\nbugfix: menú de administración desplazar pequeña pantalla #339\nfunción: añadir dpt 9.009",
|
|
93
|
-
"pl": "bujny Fix obsługa dodatków - używana do rozbicia, jeżeli dodanie info było w rzeczywistości zaopatrzone na #338\ntrąbka: admin menu zwój mały ekran #339\nprzykład: dpt 9.009",
|
|
94
|
-
"uk": "removek-cc - відео @ Виправлена обробка довжини addinfo_width - використовується для аварійної ситуації, якщо addinfo було фактично передано #338\nвиправлено помилку: меню адміністратора прокручувати невеликий екран #339\nмфо 322669",
|
|
95
|
-
"zh-cn": "拯救kccbugfix: 第338号增援物品实际供应时,用于坠落的包装。\nb ugfix:memin menuroll小型屏幕\n特点:增加9.009"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"title": "Open KNX",
|
|
@@ -167,6 +167,7 @@
|
|
|
167
167
|
},
|
|
168
168
|
"native": {
|
|
169
169
|
"autoreadEnabled": true,
|
|
170
|
+
"noWarnUnknownGa": false,
|
|
170
171
|
"useBoolean": true,
|
|
171
172
|
"gwip": "",
|
|
172
173
|
"gwipport": "3671",
|
package/lib/doubleKeyedMap.js
CHANGED
|
@@ -9,18 +9,22 @@ module.exports = class DoubleKeyedMap {
|
|
|
9
9
|
//id, knx dp 1:1
|
|
10
10
|
this.dp = new Map();
|
|
11
11
|
}
|
|
12
|
+
|
|
12
13
|
//update or add
|
|
13
14
|
set(id, ga, data) {
|
|
14
15
|
this.data.set(id, data);
|
|
15
16
|
this.ga.set(ga, this.ga.has(ga) ? this.ga.get(ga).concat(id) : [id]);
|
|
16
17
|
}
|
|
18
|
+
|
|
17
19
|
//only dp returns transformed value, hold a reference to it
|
|
18
20
|
setDpById(id, dp) {
|
|
19
21
|
this.dp.set(id, dp);
|
|
20
22
|
}
|
|
23
|
+
|
|
21
24
|
getDataById(id) {
|
|
22
25
|
return this.data.get(id);
|
|
23
26
|
}
|
|
27
|
+
|
|
24
28
|
getIdsByGa(ga) {
|
|
25
29
|
const ret = [];
|
|
26
30
|
if (this.ga.size != 0 && this.ga.get(ga)) {
|
|
@@ -34,10 +38,12 @@ module.exports = class DoubleKeyedMap {
|
|
|
34
38
|
}
|
|
35
39
|
return ret;
|
|
36
40
|
}
|
|
41
|
+
|
|
37
42
|
//depends on knx startup
|
|
38
43
|
getDpById(id) {
|
|
39
44
|
return this.dp.get(id);
|
|
40
45
|
}
|
|
46
|
+
|
|
41
47
|
//depends on knx startup
|
|
42
48
|
getDpsByGa(ga) {
|
|
43
49
|
const ret = [];
|
|
@@ -47,6 +53,7 @@ module.exports = class DoubleKeyedMap {
|
|
|
47
53
|
}
|
|
48
54
|
return ret;
|
|
49
55
|
}
|
|
56
|
+
|
|
50
57
|
getDataByGa(ga) {
|
|
51
58
|
const ret = [];
|
|
52
59
|
if (this.ga.size != 0 && this.getIdsByGa(ga))
|
package/main.js
CHANGED
|
@@ -46,14 +46,14 @@ class openknx extends utils.Adapter {
|
|
|
46
46
|
this.timeout2;
|
|
47
47
|
this.interval1;
|
|
48
48
|
|
|
49
|
-
//redirect log from knx.js that contain [..] to adapter log
|
|
49
|
+
// redirect log from knx.js that contain [..] to adapter log
|
|
50
50
|
console.log = (args) => {
|
|
51
51
|
if (args && typeof args === "string") {
|
|
52
|
-
//handling special messages of the KNX lib
|
|
52
|
+
// handling special messages of the KNX lib
|
|
53
53
|
if (args.indexOf("deferring outbound_TUNNELING_REQUEST") !== -1) {
|
|
54
54
|
return;
|
|
55
55
|
} else if (args.indexOf("empty internal fsm queue due to inbound_DISCONNECT_REQUEST") !== -1) {
|
|
56
|
-
//this.log.warn("possible data loss due to gateway reset, consider increasing minimum send delay between two frames");
|
|
56
|
+
// this.log.warn("possible data loss due to gateway reset, consider increasing minimum send delay between two frames");
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
if (args.indexOf("[trace]") !== -1) this.log.silly(args);
|
|
@@ -63,7 +63,7 @@ class openknx extends utils.Adapter {
|
|
|
63
63
|
else if (args.indexOf("[error]") !== -1) {
|
|
64
64
|
this.log.error(args);
|
|
65
65
|
if (args.indexOf("Conversion error DPT") == -1) {
|
|
66
|
-
//do not report errors from bad bus data
|
|
66
|
+
// do not report errors from bad bus data
|
|
67
67
|
if (this.getSentry()) {
|
|
68
68
|
this.getSentry().withScope((scope) => {
|
|
69
69
|
scope.setLevel("error");
|
|
@@ -73,8 +73,8 @@ class openknx extends utils.Adapter {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
} else {
|
|
76
|
-
//dont forward all other internal console.logs
|
|
77
|
-
//this.log.info(args);
|
|
76
|
+
// dont forward all other internal console.logs
|
|
77
|
+
// this.log.info(args);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
};
|
|
@@ -87,8 +87,8 @@ class openknx extends utils.Adapter {
|
|
|
87
87
|
// adapter initialization
|
|
88
88
|
|
|
89
89
|
this.getSentry()?.Sentry?.init({
|
|
90
|
-
//"development" or "production"
|
|
91
|
-
//environment: "production",
|
|
90
|
+
// "development" or "production"
|
|
91
|
+
// environment: "production",
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
//after installation
|
|
@@ -222,11 +222,11 @@ class openknx extends utils.Adapter {
|
|
|
222
222
|
Object.keys(object[1].native).length === 0 &&
|
|
223
223
|
Object.getPrototypeOf(object[1].native) === Object.prototype
|
|
224
224
|
) {
|
|
225
|
-
//object is no knx element, skip
|
|
225
|
+
// object is no knx element, skip
|
|
226
226
|
} else {
|
|
227
227
|
const found = importObjects.find((element) => this.mynamespace + "." + element._id === object[0]);
|
|
228
228
|
if (!found) {
|
|
229
|
-
//knx element in object tree not found in import file
|
|
229
|
+
// knx element in object tree not found in import file
|
|
230
230
|
this.log.info(
|
|
231
231
|
`${removeUnusedObjects ? "deleting" : ""}
|
|
232
232
|
existing element in object tree not found in import file: ${object[0]}`,
|
|
@@ -243,10 +243,10 @@ class openknx extends utils.Adapter {
|
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
//write found communication objects to adapter object tree
|
|
246
|
+
// write found communication objects to adapter object tree
|
|
247
247
|
updateObjects(objects, i, onlyAddNewObjects, callback) {
|
|
248
248
|
if (i >= objects.length) {
|
|
249
|
-
//end of recursion reached
|
|
249
|
+
// end of recursion reached
|
|
250
250
|
let err = this.warnDuplicates(objects);
|
|
251
251
|
|
|
252
252
|
this.getObjectList(
|
|
@@ -286,8 +286,8 @@ class openknx extends utils.Adapter {
|
|
|
286
286
|
return;
|
|
287
287
|
}
|
|
288
288
|
if (onlyAddNewObjects) {
|
|
289
|
-
//if user setting Add only new Objects write only new objects
|
|
290
|
-
//extend object would overwrite user made element changes if known in the import, not intended
|
|
289
|
+
// if user setting Add only new Objects write only new objects
|
|
290
|
+
// extend object would overwrite user made element changes if known in the import, not intended
|
|
291
291
|
this.setObjectNotExists(this.mynamespace + "." + objects[i]._id, objects[i], (err) => {
|
|
292
292
|
if (err) {
|
|
293
293
|
this.log.warn("error store Object " + objects[i]._id + " " + (err ? " " + err : ""));
|
|
@@ -302,7 +302,7 @@ class openknx extends utils.Adapter {
|
|
|
302
302
|
);
|
|
303
303
|
});
|
|
304
304
|
} else {
|
|
305
|
-
//setObjet to overwrite all existing settings, default
|
|
305
|
+
// setObjet to overwrite all existing settings, default
|
|
306
306
|
this.setObject(this.mynamespace + "." + objects[i]._id, objects[i], (err) => {
|
|
307
307
|
if (err) {
|
|
308
308
|
this.log.warn("error store Object " + objects[i]._id + (err ? " " + err : ""));
|
|
@@ -344,21 +344,21 @@ class openknx extends utils.Adapter {
|
|
|
344
344
|
return duplicates.length ? message : "";
|
|
345
345
|
}
|
|
346
346
|
|
|
347
|
-
//obj to string and date to number for iobroker from knx stack
|
|
347
|
+
// obj to string and date to number for iobroker from knx stack
|
|
348
348
|
convertType(val) {
|
|
349
349
|
let ret;
|
|
350
|
-
//convert, state value for iobroker to set has to be one of type "string", "number", "boolean" and additionally type "object"
|
|
350
|
+
// convert, state value for iobroker to set has to be one of type "string", "number", "boolean" and additionally type "object"
|
|
351
351
|
if (val instanceof Date) {
|
|
352
|
-
//convert Date to number
|
|
352
|
+
// convert Date to number
|
|
353
353
|
ret = Number(new Date(val));
|
|
354
354
|
} else if (Buffer.isBuffer(val)) {
|
|
355
|
-
//before object check
|
|
355
|
+
// before object check
|
|
356
356
|
ret = val.toString("hex");
|
|
357
357
|
} else if (typeof val === "object") {
|
|
358
|
-
//https://github.com/ioBroker/ioBroker.docs/blob/master/docs/en/dev/objectsschema.md#states
|
|
358
|
+
// https://github.com/ioBroker/ioBroker.docs/blob/master/docs/en/dev/objectsschema.md#states
|
|
359
359
|
ret = JSON.stringify(val);
|
|
360
360
|
} else {
|
|
361
|
-
//keep string, boolean and number
|
|
361
|
+
// keep string, boolean and number
|
|
362
362
|
ret = val;
|
|
363
363
|
}
|
|
364
364
|
|
|
@@ -390,10 +390,10 @@ class openknx extends utils.Adapter {
|
|
|
390
390
|
}
|
|
391
391
|
|
|
392
392
|
if (state.ack) {
|
|
393
|
-
//only continue when application triggered a change without ack flag, filter out reception state changes
|
|
393
|
+
// only continue when application triggered a change without ack flag, filter out reception state changes
|
|
394
394
|
|
|
395
|
-
//enable this for system testing
|
|
396
|
-
//this.interfaceTest(id, state);
|
|
395
|
+
// enable this for system testing
|
|
396
|
+
// this.interfaceTest(id, state);
|
|
397
397
|
return "ack is set";
|
|
398
398
|
}
|
|
399
399
|
if (!this.connected) {
|
|
@@ -406,7 +406,7 @@ class openknx extends utils.Adapter {
|
|
|
406
406
|
let knxVal = state.val;
|
|
407
407
|
let rawVal;
|
|
408
408
|
|
|
409
|
-
//plausibilize against configured datatype
|
|
409
|
+
// plausibilize against configured datatype
|
|
410
410
|
if (this.gaList.getDataById(id).common && this.gaList.getDataById(id).common.type == "boolean") {
|
|
411
411
|
knxVal = knxVal ? true : false;
|
|
412
412
|
} else if (
|
|
@@ -418,10 +418,10 @@ class openknx extends utils.Adapter {
|
|
|
418
418
|
}
|
|
419
419
|
// else take plain value
|
|
420
420
|
} else if (tools.isDateDPT(dpt)) {
|
|
421
|
-
//before composite check, date is possibly composite
|
|
421
|
+
// before composite check, date is possibly composite
|
|
422
422
|
knxVal = new Date(knxVal);
|
|
423
423
|
} else if (this.gaList.getDataById(id).native.valuetype == "composite") {
|
|
424
|
-
//input from IOB is either object or string in object notation, type of this conversion is object needed by the knx lib
|
|
424
|
+
// input from IOB is either object or string in object notation, type of this conversion is object needed by the knx lib
|
|
425
425
|
if (typeof knxVal != "object") {
|
|
426
426
|
try {
|
|
427
427
|
knxVal = JSON.parse(knxVal);
|
|
@@ -431,10 +431,10 @@ class openknx extends utils.Adapter {
|
|
|
431
431
|
}
|
|
432
432
|
}
|
|
433
433
|
} else if (tools.isStringDPT(dpt)) {
|
|
434
|
-
//take plain value
|
|
434
|
+
// take plain value
|
|
435
435
|
} else if (tools.isUnknownDPT(dpt)) {
|
|
436
|
-
//write raw buffers for unknown dpts, iterface is a hex value
|
|
437
|
-
//bitlength is the buffers bytelength * 8.
|
|
436
|
+
// write raw buffers for unknown dpts, iterface is a hex value
|
|
437
|
+
// bitlength is the buffers bytelength * 8.
|
|
438
438
|
if (typeof knxVal != "string") {
|
|
439
439
|
this.log.warn("unsupported datatype for raw value");
|
|
440
440
|
return "unsupported datatype";
|
|
@@ -461,10 +461,10 @@ class openknx extends utils.Adapter {
|
|
|
461
461
|
|
|
462
462
|
// @ts-ignore
|
|
463
463
|
if (state.c == "GroupValue_Read" || state.q == 0x10) {
|
|
464
|
-
//interface to trigger GrouValue_Read is this object comment or StateQuality 16
|
|
464
|
+
// interface to trigger GrouValue_Read is this object comment or StateQuality 16
|
|
465
465
|
this.log.debug("Outbound GroupValue_Read to GA " + ga);
|
|
466
466
|
this.knxConnection.read(ga, () => {
|
|
467
|
-
//ack is generated with GroupValue_Response
|
|
467
|
+
// ack is generated with GroupValue_Response
|
|
468
468
|
});
|
|
469
469
|
return "read";
|
|
470
470
|
} else if (this.gaList.getDataById(id).common.write) {
|
|
@@ -473,9 +473,9 @@ class openknx extends utils.Adapter {
|
|
|
473
473
|
);
|
|
474
474
|
if (isRaw) {
|
|
475
475
|
this.knxConnection.writeRaw(ga, rawVal, (grpaddr, confirmed, timeout) => {
|
|
476
|
-
//l_data.con confirmation set by any receiver connected to the ga
|
|
476
|
+
// l_data.con confirmation set by any receiver connected to the ga
|
|
477
477
|
if (confirmed) {
|
|
478
|
-
//iob ack is set in event handler when value is sent successfully on the bus, otherwise keep unset
|
|
478
|
+
// iob ack is set in event handler when value is sent successfully on the bus, otherwise keep unset
|
|
479
479
|
this.log.debug(`Inbound GroupValue_Write confirmation true received for ${grpaddr} ${id}`);
|
|
480
480
|
} else if (timeout) this.log.info(`GroupValue_Write timeout for ${grpaddr} ${id}`);
|
|
481
481
|
else this.log.info(`Inbound GroupValue_Write confirmation false received for ${grpaddr} ${id}`);
|
|
@@ -483,9 +483,9 @@ class openknx extends utils.Adapter {
|
|
|
483
483
|
return "write raw";
|
|
484
484
|
} else {
|
|
485
485
|
this.knxConnection.write(ga, knxVal, dpt, (grpaddr, confirmed, timeout) => {
|
|
486
|
-
//l_data.con confirmation set by any receiver connected to the ga
|
|
486
|
+
// l_data.con confirmation set by any receiver connected to the ga
|
|
487
487
|
if (confirmed) {
|
|
488
|
-
//iob ack is set in event handler when value is sent successfully on the bus, otherwise keep unset
|
|
488
|
+
// iob ack is set in event handler when value is sent successfully on the bus, otherwise keep unset
|
|
489
489
|
this.log.debug(`Inbound GroupValue_Write confirmation true received for ${grpaddr} ${id}`);
|
|
490
490
|
} else if (timeout) this.log.info(`GroupValue_Write timeout for ${grpaddr} ${id}`);
|
|
491
491
|
else this.log.info(`Inbound GroupValue_Write confirmation false received for ${grpaddr} ${id}`);
|
|
@@ -505,21 +505,21 @@ class openknx extends utils.Adapter {
|
|
|
505
505
|
physAddr: "0.0.0",
|
|
506
506
|
interface: this.translateInterface(this.config.localInterface),
|
|
507
507
|
minimumDelay: this.config.minimumDelay,
|
|
508
|
-
//https://github.com/Supergiovane/node-red-contrib-knx-ultimate/issues/78, some receivers cannot handle a ack request, spec makes no difference
|
|
508
|
+
// https://github.com/Supergiovane/node-red-contrib-knx-ultimate/issues/78, some receivers cannot handle a ack request, spec makes no difference
|
|
509
509
|
suppress_ack_ldatareq: true,
|
|
510
|
-
//map set the log level for messsages printed on the console. This can be 'error', 'warn', 'info' (default), 'debug', or 'trace'.
|
|
511
|
-
//log is written to console, not in IoB log
|
|
510
|
+
// map set the log level for messsages printed on the console. This can be 'error', 'warn', 'info' (default), 'debug', or 'trace'.
|
|
511
|
+
// log is written to console, not in IoB log
|
|
512
512
|
loglevel: this.log.level == "silly" ? "trace" : this.log.level,
|
|
513
513
|
handlers: {
|
|
514
514
|
connected: () => {
|
|
515
515
|
this.log.info("Connected!");
|
|
516
516
|
this.setState("info.messagecount", 0, true);
|
|
517
517
|
|
|
518
|
-
//create new knx datapoint and bind to connection
|
|
519
|
-
//in order to have autoread work
|
|
518
|
+
// create new knx datapoint and bind to connection
|
|
519
|
+
// in order to have autoread work
|
|
520
520
|
let cnt_withDPT = 0;
|
|
521
521
|
if (!this.autoreaddone) {
|
|
522
|
-
//do autoread on start of adapter and not every connection
|
|
522
|
+
// do autoread on start of adapter and not every connection
|
|
523
523
|
for (const key of this.gaList) {
|
|
524
524
|
try {
|
|
525
525
|
const datapoint = new this.knx.Datapoint(
|
|
@@ -568,13 +568,13 @@ class openknx extends utils.Adapter {
|
|
|
568
568
|
this.log.warn(connstatus);
|
|
569
569
|
},
|
|
570
570
|
|
|
571
|
-
//l_data.con, confirmation set by a receiver which has the sending flag
|
|
571
|
+
// l_data.con, confirmation set by a receiver which has the sending flag
|
|
572
572
|
confirmed: (dest, confirmed) => {
|
|
573
573
|
for (const id of this.gaList.getIdsByGa(dest)) {
|
|
574
574
|
if (confirmed) {
|
|
575
575
|
this.log.debug(`A receiver confirmed reception of our message for ${dest} ${id}`);
|
|
576
576
|
} else {
|
|
577
|
-
//otherwise keep unset
|
|
577
|
+
// otherwise keep unset
|
|
578
578
|
this.log.info(
|
|
579
579
|
`Got confirmation flag false for ${dest} ${id}. Possibly no receiver available or missing ETS receiver configuration.`,
|
|
580
580
|
);
|
|
@@ -582,9 +582,9 @@ class openknx extends utils.Adapter {
|
|
|
582
582
|
}
|
|
583
583
|
},
|
|
584
584
|
|
|
585
|
-
//KNX Bus event received
|
|
586
|
-
//src: KnxDeviceAddress, dest: KnxGroupAddress,
|
|
587
|
-
//val: raw value not used, using dp interface instead
|
|
585
|
+
// KNX Bus event received
|
|
586
|
+
// src: KnxDeviceAddress, dest: KnxGroupAddress,
|
|
587
|
+
// val: raw value not used, using dp interface instead
|
|
588
588
|
// @ts-ignore
|
|
589
589
|
event: (
|
|
590
590
|
/** @type {string} */ evt,
|
|
@@ -599,11 +599,11 @@ class openknx extends utils.Adapter {
|
|
|
599
599
|
|
|
600
600
|
/* some checks */
|
|
601
601
|
if (dest == "0/0/0" || tools.isDeviceAddress(dest)) {
|
|
602
|
-
//seems that knx lib does not guarantee dest group adresses
|
|
602
|
+
// seems that knx lib does not guarantee dest group adresses
|
|
603
603
|
return "bad address";
|
|
604
604
|
}
|
|
605
|
-
if (!this.gaList.getIdsByGa(dest).length) {
|
|
606
|
-
this.log.warn(`Ignoring ${evt} of
|
|
605
|
+
if (!this.config.noWarnUnknownGa && !this.gaList.getIdsByGa(dest).length) {
|
|
606
|
+
this.log.warn(`Ignoring ${evt} of unknown GA ${dest}`);
|
|
607
607
|
return "unknown GA";
|
|
608
608
|
}
|
|
609
609
|
|
|
@@ -612,7 +612,7 @@ class openknx extends utils.Adapter {
|
|
|
612
612
|
const dp = this.gaList.getDpById(id);
|
|
613
613
|
|
|
614
614
|
if (id == undefined || data == undefined || dp == undefined) {
|
|
615
|
-
//debug trap, should not be reached
|
|
615
|
+
// debug trap, should not be reached
|
|
616
616
|
throw new Error(`Invalid data for GA ${dest} id ${id} data ${data} dp ${dp}`);
|
|
617
617
|
}
|
|
618
618
|
|
|
@@ -624,7 +624,7 @@ class openknx extends utils.Adapter {
|
|
|
624
624
|
|
|
625
625
|
switch (evt) {
|
|
626
626
|
case "GroupValue_Read":
|
|
627
|
-
//fetch val from addressed object and write on bus if configured to answer
|
|
627
|
+
// fetch val from addressed object and write on bus if configured to answer
|
|
628
628
|
this.getState(id, (err, state) => {
|
|
629
629
|
let ret;
|
|
630
630
|
if (state) {
|
|
@@ -678,7 +678,7 @@ class openknx extends utils.Adapter {
|
|
|
678
678
|
ret = "unhandeled";
|
|
679
679
|
}
|
|
680
680
|
}
|
|
681
|
-
return ret; //last processed
|
|
681
|
+
return ret; // last processed
|
|
682
682
|
},
|
|
683
683
|
},
|
|
684
684
|
});
|
|
@@ -699,7 +699,7 @@ class openknx extends utils.Adapter {
|
|
|
699
699
|
}
|
|
700
700
|
}
|
|
701
701
|
|
|
702
|
-
//admin dialog uses different name than knx lib, translate ip to interface name
|
|
702
|
+
// admin dialog uses different name than knx lib, translate ip to interface name
|
|
703
703
|
translateInterface(interfaceIp) {
|
|
704
704
|
const interfaces = os.networkInterfaces();
|
|
705
705
|
|
|
@@ -760,7 +760,7 @@ class openknx extends utils.Adapter {
|
|
|
760
760
|
self.setState("info.messagecount", loadMeasurement.gettelegramCount(), true);
|
|
761
761
|
}, loadMeasurement.intervalTime);
|
|
762
762
|
|
|
763
|
-
//fill gaList from iobroker objects
|
|
763
|
+
// fill gaList from iobroker objects
|
|
764
764
|
this.getObjectView(
|
|
765
765
|
"system",
|
|
766
766
|
"state",
|
|
@@ -783,7 +783,7 @@ class openknx extends utils.Adapter {
|
|
|
783
783
|
value.native.address.match(/\d*\/\d*\/\d*/) &&
|
|
784
784
|
value.native.dpt
|
|
785
785
|
) {
|
|
786
|
-
//add only elements from tree that are knx objects, identified by a group adress
|
|
786
|
+
// add only elements from tree that are knx objects, identified by a group adress
|
|
787
787
|
this.gaList.set(id, value.native.address, res.rows[i].value);
|
|
788
788
|
if (this.gaList.getIdsByGa(value.native.address).length > 1)
|
|
789
789
|
this.log.warn(
|
|
@@ -800,8 +800,8 @@ class openknx extends utils.Adapter {
|
|
|
800
800
|
this.startKnxStack();
|
|
801
801
|
} catch (e) {
|
|
802
802
|
if (e.toString().indexOf("not found or has no useful IPv4 address!") !== -1)
|
|
803
|
-
//ipaddr: the address has neither IPv6 nor IPv4 format ??
|
|
804
|
-
//only handle certain exceptions
|
|
803
|
+
// ipaddr: the address has neither IPv6 nor IPv4 format ??
|
|
804
|
+
// only handle certain exceptions
|
|
805
805
|
this.log.error(`Cannot start KNX Stack ${e}`);
|
|
806
806
|
else throw e;
|
|
807
807
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.openknx",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3-alpha.0",
|
|
4
4
|
"description": "ioBroker knx Adapter",
|
|
5
5
|
"author": "boellner",
|
|
6
6
|
"homepage": "https://github.com/iobroker-community-adapters/ioBroker.openknx.git",
|
|
@@ -44,24 +44,24 @@
|
|
|
44
44
|
"@alcalzone/release-script-plugin-iobroker": "^3.7.0",
|
|
45
45
|
"@alcalzone/release-script-plugin-license": "^3.7.0",
|
|
46
46
|
"@alcalzone/release-script-plugin-manual-review": "^3.7.0",
|
|
47
|
-
"@iobroker/adapter-dev": "^1.
|
|
47
|
+
"@iobroker/adapter-dev": "^1.3.0",
|
|
48
48
|
"@iobroker/testing": "^4.1.0",
|
|
49
49
|
"@material-ui/core": "^4.12.4",
|
|
50
50
|
"@tsconfig/node14": "^14.1.0",
|
|
51
51
|
"@types/chai": "^4.3.11",
|
|
52
52
|
"@types/chai-as-promised": "^7.1.8",
|
|
53
53
|
"@types/mocha": "^10.0.6",
|
|
54
|
-
"@types/node": "^20.
|
|
54
|
+
"@types/node": "^20.11.24",
|
|
55
55
|
"@types/proxyquire": "^1.3.31",
|
|
56
|
-
"@types/sinon": "^17.0.
|
|
56
|
+
"@types/sinon": "^17.0.3",
|
|
57
57
|
"@types/sinon-chai": "^3.2.12",
|
|
58
|
-
"chai": "^4.
|
|
58
|
+
"chai": "^4.4.1",
|
|
59
59
|
"chai-as-promised": "^7.1.1",
|
|
60
|
-
"eslint": "^8.
|
|
60
|
+
"eslint": "^8.57.0",
|
|
61
61
|
"eslint-config-prettier": "^9.1.0",
|
|
62
|
-
"eslint-plugin-prettier": "^5.1.
|
|
63
|
-
"mocha": "^10.
|
|
64
|
-
"prettier": "^3.
|
|
62
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
63
|
+
"mocha": "^10.3.0",
|
|
64
|
+
"prettier": "^3.2.5",
|
|
65
65
|
"proxyquire": "^2.1.3",
|
|
66
66
|
"sinon": "^17.0.1",
|
|
67
67
|
"sinon-chai": "^3.7.0",
|