iobroker.lorawan 1.19.26 → 1.19.28
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 +6 -0
- package/io-package.json +40 -27
- package/lib/modules/bridge.js +10 -23
- package/main.js +26 -23
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,6 +23,12 @@ For now there is documentation in English here: https://wiki.hafenmeister.de
|
|
|
23
23
|
Placeholder for the next version (at the beginning of the line):
|
|
24
24
|
### **WORK IN PROGRESS**
|
|
25
25
|
-->
|
|
26
|
+
### 1.19.28 (2026-01-16)
|
|
27
|
+
* (BenAhrdt) add logging possibility info, debug, warn, error to internal logging
|
|
28
|
+
|
|
29
|
+
### 1.19.27 (2026-01-15)
|
|
30
|
+
* (BenAhrdt) setting internal logging to debug path in bridge and query the json entries
|
|
31
|
+
|
|
26
32
|
### 1.19.26 (2026-01-15)
|
|
27
33
|
* (BenAhrdt) build internal logging
|
|
28
34
|
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "lorawan",
|
|
4
|
-
"version": "1.19.
|
|
4
|
+
"version": "1.19.28",
|
|
5
5
|
"news": {
|
|
6
|
+
"1.19.28": {
|
|
7
|
+
"en": "add logging possibility info, debug, warn, error to internal logging",
|
|
8
|
+
"de": "hinzufügen von logging-möglichkeiten info, debug, warnen, fehler in der internen protokollierung",
|
|
9
|
+
"ru": "добавьте информацию о возможности регистрации, отладку, предупреждение, ошибку к внутренней регистрации",
|
|
10
|
+
"pt": "adicionar informações de possibilidade de registro, depurar, alertar, erro ao registro interno",
|
|
11
|
+
"nl": "log mogelijkheid info toevoegen, debug, waarschuwen, fout bij interne logging",
|
|
12
|
+
"fr": "ajouter des informations de possibilité de log, debug, avertissement, erreur à la log interne",
|
|
13
|
+
"it": "aggiungere informazioni possibilità di registrazione, debug, avvertire, errore di registrazione interna",
|
|
14
|
+
"es": "añadir información de la posibilidad de registro, depuración, aviso, error al registro interno",
|
|
15
|
+
"pl": "dodaj informacje o możliwości logowania, debugowanie, ostrzeganie, błąd logowania wewnętrznego",
|
|
16
|
+
"uk": "додайте інформацію про можливість входу, відхилити, попереджати, похибка до внутрішнього входу",
|
|
17
|
+
"zh-cn": "将记录可能性信息、调试、警告、错误添加到内部记录"
|
|
18
|
+
},
|
|
19
|
+
"1.19.27": {
|
|
20
|
+
"en": "setting internal logging to debug path in bridge and query the json entries",
|
|
21
|
+
"de": "interne protokollierung zum debug-pfad in der brücke einstellen und die json-einträge abfragen",
|
|
22
|
+
"ru": "установка внутренней регистрации для отладки пути в мосту и запроса записей json",
|
|
23
|
+
"pt": "definindo o registro interno para o caminho de depuração na ponte e consultando os itens json",
|
|
24
|
+
"nl": "interne logging instellen op debugpad in de brug en de json-items opvragen",
|
|
25
|
+
"fr": "paramétrer l'enregistrement interne pour déboguer le chemin dans le pont et interroger les entrées de json",
|
|
26
|
+
"it": "impostare logging interno per debug percorso in ponte e query le voci json",
|
|
27
|
+
"es": "establecer registro interno para depurar el camino en puente y consultar las entradas json",
|
|
28
|
+
"pl": "ustawienie wewnętrznego logowania do debugowania ścieżki w moście i zapytanie wpisów json",
|
|
29
|
+
"uk": "встановлення внутрішнього входу в дебюговий шлях в мост і переробити записи json",
|
|
30
|
+
"zh-cn": "设置内部日志以调试桥上的路径并查询 json 条目"
|
|
31
|
+
},
|
|
6
32
|
"1.19.26": {
|
|
7
33
|
"en": "build internal logging",
|
|
8
34
|
"de": "interne protokollierung erstellen",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "zmiana Sprawdź getForeigen ObjectAsync do zagranicy ObjectExists (obiekty konfiguracyjne chek)",
|
|
68
94
|
"uk": "увійти Перевірити getForeigen Об'єкт Об'єктExists (пристрої налаштування)",
|
|
69
95
|
"zh-cn": "变动 检查是否获取 Foreigen 对象同步到外国 对象Exists (切克配置对象)"
|
|
70
|
-
},
|
|
71
|
-
"1.19.21": {
|
|
72
|
-
"en": "add color Termperature mode to foreign light config",
|
|
73
|
-
"de": "farbe hinzufügen Termperatur-Modus zu ausländischen Licht config",
|
|
74
|
-
"ru": "добавить цветовой режим термометрии в конфигурацию иностранного света",
|
|
75
|
-
"pt": "adicionar o modo de termos de cores à configuração de luz estrangeira",
|
|
76
|
-
"nl": "kleur Termperatuurmodus toevoegen aan vreemde lichtconfiguratie",
|
|
77
|
-
"fr": "ajouter le mode couleur Termperature à la configuration de la lumière étrangère",
|
|
78
|
-
"it": "aggiungere la modalità Termperature colore alla configurazione della luce straniera",
|
|
79
|
-
"es": "añadir el modo Termperature color a la luz extranjera",
|
|
80
|
-
"pl": "dodaj kolor Tryb termperature do konfigu światła obcego",
|
|
81
|
-
"uk": "додати кольоровий режим Termperature до зовнішньої конфігурації світла",
|
|
82
|
-
"zh-cn": "在外光配置中添加颜色"
|
|
83
|
-
},
|
|
84
|
-
"1.19.20": {
|
|
85
|
-
"en": "bugfix virtual ending",
|
|
86
|
-
"de": "bugfix virtuelles ende",
|
|
87
|
-
"ru": "bugfix виртуальная концовка",
|
|
88
|
-
"pt": "finalização virtual do bugfix",
|
|
89
|
-
"nl": "bugfix virtueel einde",
|
|
90
|
-
"fr": "bugfix virtual ending",
|
|
91
|
-
"it": "bugfix virtuale finale",
|
|
92
|
-
"es": "final virtual de bugfix",
|
|
93
|
-
"pl": "wirtualne zakończenie bugfix",
|
|
94
|
-
"uk": "виправлення віртуальних даних",
|
|
95
|
-
"zh-cn": "错误修正虚拟结尾"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
|
@@ -577,6 +577,19 @@
|
|
|
577
577
|
},
|
|
578
578
|
"native": {}
|
|
579
579
|
},
|
|
580
|
+
{
|
|
581
|
+
"_id": "bridge.debug.logtypes",
|
|
582
|
+
"type": "state",
|
|
583
|
+
"common": {
|
|
584
|
+
"type": "string",
|
|
585
|
+
"role": "json",
|
|
586
|
+
"name": "internal logging types",
|
|
587
|
+
"read": true,
|
|
588
|
+
"write": true,
|
|
589
|
+
"def": "{\"discovery\":false, \"assign\": false}"
|
|
590
|
+
},
|
|
591
|
+
"native": {}
|
|
592
|
+
},
|
|
580
593
|
{
|
|
581
594
|
"_id": "bridge.notification",
|
|
582
595
|
"type": "state",
|
package/lib/modules/bridge.js
CHANGED
|
@@ -1209,11 +1209,9 @@ class bridgeClass {
|
|
|
1209
1209
|
}
|
|
1210
1210
|
}
|
|
1211
1211
|
// Check for logging
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
);
|
|
1216
|
-
}
|
|
1212
|
+
this.adapter.log[this.adapter.logtypes.assign]?.(
|
|
1213
|
+
`Assign IdStructure for id: ${indexId}. Object: ${JSON.stringify(assignObject[indexId])}`,
|
|
1214
|
+
);
|
|
1217
1215
|
}
|
|
1218
1216
|
|
|
1219
1217
|
/*********************************************************************
|
|
@@ -1244,11 +1242,9 @@ class bridgeClass {
|
|
|
1244
1242
|
}
|
|
1245
1243
|
}
|
|
1246
1244
|
// Check for logging
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
);
|
|
1251
|
-
}
|
|
1245
|
+
this.adapter.log[this.adapter.logtypes.assign]?.(
|
|
1246
|
+
`Assign TopicStructure for Topic: ${indexTopic}. Object: ${JSON.stringify(assignObject[indexTopic])}`,
|
|
1247
|
+
);
|
|
1252
1248
|
}
|
|
1253
1249
|
|
|
1254
1250
|
/*********************************************************************
|
|
@@ -1344,11 +1340,6 @@ class bridgeClass {
|
|
|
1344
1340
|
this.adapter.log.silly(`Function ${activeFunction} started.`);
|
|
1345
1341
|
const returnValue = { newDevice: undefined, newId: undefined };
|
|
1346
1342
|
try {
|
|
1347
|
-
let internalLogging = false;
|
|
1348
|
-
// Check for discoverylogging
|
|
1349
|
-
if (this.adapter.logtypes.includes(this.logging.discovery)) {
|
|
1350
|
-
internalLogging = true;
|
|
1351
|
-
}
|
|
1352
1343
|
if (!DiscoveryObject.lastDiscover) {
|
|
1353
1344
|
DiscoveryObject.lastDiscover = {};
|
|
1354
1345
|
}
|
|
@@ -1366,11 +1357,9 @@ class bridgeClass {
|
|
|
1366
1357
|
// in case of delete entity => setting paylod = ''
|
|
1367
1358
|
// check for new device discovered, or new Id discovered
|
|
1368
1359
|
if (typeof DiscoveryObject.payload !== 'string') {
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
);
|
|
1373
|
-
}
|
|
1360
|
+
this.adapter.log[this.adapter.logtypes.discovery]?.(
|
|
1361
|
+
`Discover id: ${id} with Discoveryobject: ${JSON.stringify(DiscoveryObject)}`,
|
|
1362
|
+
);
|
|
1374
1363
|
// Payload is not empty => discover
|
|
1375
1364
|
const normalizedDeficeIdentifier = DiscoveryObject.payload.device.identifiers[0];
|
|
1376
1365
|
|
|
@@ -1407,9 +1396,7 @@ class bridgeClass {
|
|
|
1407
1396
|
returnValue.newId = DiscoveryObject;
|
|
1408
1397
|
}
|
|
1409
1398
|
} else {
|
|
1410
|
-
|
|
1411
|
-
this.adapter.log.warn(`Delete discover for id: ${id}`);
|
|
1412
|
-
}
|
|
1399
|
+
this.adapter.log[this.adapter.logtypes.discovery]?.(`Delete discover for id: ${id}`);
|
|
1413
1400
|
}
|
|
1414
1401
|
/******************************************************
|
|
1415
1402
|
* ****************************************************
|
package/main.js
CHANGED
|
@@ -56,7 +56,7 @@ class Lorawan extends utils.Adapter {
|
|
|
56
56
|
this._adapterObjectsCache = null;
|
|
57
57
|
|
|
58
58
|
// Internal Logging Table
|
|
59
|
-
this.logtypes =
|
|
59
|
+
this.logtypes = {};
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
onFileChange(_id, _fileName, _size) {
|
|
@@ -71,12 +71,8 @@ class Lorawan extends utils.Adapter {
|
|
|
71
71
|
const activeFunction = 'onReady';
|
|
72
72
|
try {
|
|
73
73
|
// Get Logtypes
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (logtypes && typeof logtypes.val === 'string') {
|
|
77
|
-
this.logtypes = JSON.parse(logtypes.val);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
74
|
+
this.logtypes = JSON.parse(await this.setDefIfEmptyAndReturnVal('bridge.debug.logtypes'));
|
|
75
|
+
|
|
80
76
|
// read system translation out of i18n translation
|
|
81
77
|
this.i18nTranslation = await this.geti18nTranslation();
|
|
82
78
|
|
|
@@ -150,6 +146,28 @@ class Lorawan extends utils.Adapter {
|
|
|
150
146
|
.digest('hex');
|
|
151
147
|
}
|
|
152
148
|
|
|
149
|
+
/**
|
|
150
|
+
* CHeck Id for '' and set to def, if preset
|
|
151
|
+
*
|
|
152
|
+
* @param id id to check for empty
|
|
153
|
+
*/
|
|
154
|
+
async setDefIfEmptyAndReturnVal(id) {
|
|
155
|
+
if (await this.objectExists(id)) {
|
|
156
|
+
const stateOfId = await this.getStateAsync(id);
|
|
157
|
+
if (stateOfId && typeof stateOfId.val) {
|
|
158
|
+
if (stateOfId.val === '') {
|
|
159
|
+
const objectOfId = await this.getObjectAsync(id);
|
|
160
|
+
if (objectOfId?.common.def) {
|
|
161
|
+
await this.setState(id, objectOfId?.common.def, true);
|
|
162
|
+
return objectOfId?.common.def;
|
|
163
|
+
}
|
|
164
|
+
} else {
|
|
165
|
+
return stateOfId.val;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
153
171
|
async geti18nTranslation() {
|
|
154
172
|
const systemConfig = await this.getForeignObjectAsync('system.config');
|
|
155
173
|
if (systemConfig) {
|
|
@@ -852,21 +870,6 @@ class Lorawan extends utils.Adapter {
|
|
|
852
870
|
native: {},
|
|
853
871
|
});
|
|
854
872
|
await this.setState(id, '', true);
|
|
855
|
-
} else if (words[1] === 'logging') {
|
|
856
|
-
this.extendObject('bridge.debug.logtypes', {
|
|
857
|
-
type: 'state',
|
|
858
|
-
common: {
|
|
859
|
-
name: 'topic of mqtt message',
|
|
860
|
-
type: 'string',
|
|
861
|
-
role: 'json',
|
|
862
|
-
read: true,
|
|
863
|
-
write: true,
|
|
864
|
-
desc: 'Possible array entries eg.: ["discovery", "assign"]',
|
|
865
|
-
def: '',
|
|
866
|
-
},
|
|
867
|
-
native: {},
|
|
868
|
-
});
|
|
869
|
-
await this.setState(id, '', true);
|
|
870
873
|
}
|
|
871
874
|
} else {
|
|
872
875
|
let notificationId = `${this.namespace}.${this.bridge?.Words.notification}${this.bridge?.GeneralId}`;
|
|
@@ -905,8 +908,8 @@ class Lorawan extends utils.Adapter {
|
|
|
905
908
|
await this.setState(id, state.val, true);
|
|
906
909
|
}
|
|
907
910
|
} else if (id.endsWith('bridge.debug.logtypes')) {
|
|
908
|
-
this.logtypes = JSON.parse(state.val);
|
|
909
911
|
await this.setState(id, state.val, true);
|
|
912
|
+
this.logtypes = JSON.parse(await this.setDefIfEmptyAndReturnVal(id));
|
|
910
913
|
}
|
|
911
914
|
} else {
|
|
912
915
|
// Query for 0_userdata or alias => states also publish with ack = false
|