iobroker.lorawan 1.16.10 → 1.16.12
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 +7 -0
- package/admin/i18n/de/translations.json +1 -1
- package/admin/jsonTab.json +1 -0
- package/io-package.json +29 -27
- package/lib/modules/bridge.js +20 -19
- package/lib/modules/directorieshandler.js +0 -2
- package/main.js +17 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,6 +23,13 @@ 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.16.12 (2025-09-18)
|
|
27
|
+
* (BenAhrdt) delete devices in bridge (discover empty) after changing the device_identifier
|
|
28
|
+
|
|
29
|
+
### 1.16.11 (2025-09-18)
|
|
30
|
+
* (BenAhrdt) dont use bridge enum within namespace of adapter
|
|
31
|
+
* (BenAhrdt) Improve Namebuilding of foreign states to bridge
|
|
32
|
+
|
|
26
33
|
### 1.16.10 (2025-09-18)
|
|
27
34
|
* (BenAhrdt) bugfix change query of Bridgeurl to LoRaWAN url
|
|
28
35
|
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"applicationId": "Applikations Id",
|
|
104
104
|
"applicationName": "Applikationsname",
|
|
105
105
|
"usedApplicationName": "Benutzter Applikationsname (common.name)",
|
|
106
|
-
"deviceEUI": "
|
|
106
|
+
"deviceEUI": "Geräte EUI",
|
|
107
107
|
"deviceId": "Geräte Id",
|
|
108
108
|
"usedDeviceId": "Benutzte Geräte Id (common.name)",
|
|
109
109
|
"underline": "Unterstrich",
|
package/admin/jsonTab.json
CHANGED
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "lorawan",
|
|
4
|
-
"version": "1.16.
|
|
4
|
+
"version": "1.16.12",
|
|
5
5
|
"news": {
|
|
6
|
+
"1.16.12": {
|
|
7
|
+
"en": "delete devices in bridge (discover empty) after changing the device_identifier",
|
|
8
|
+
"de": "Löschen Sie Geräte in der Brücke (entdecken leer), nachdem die Gerätekennung geändert wurde.",
|
|
9
|
+
"ru": "Удаление устройств в мосту (обнаружить пустоту) после изменения идентификатора устройства",
|
|
10
|
+
"pt": "excluir dispositivos na ponte (descoberta vazia) após alterar o device_identifier",
|
|
11
|
+
"nl": "Verwijder apparaten in de brug (ontdek leeg) na het wijzigen van de apparaat_identifier.",
|
|
12
|
+
"fr": "Supprimer les appareils dans le bridge (découverte vide) après avoir modifié l'identifiant de l'appareil",
|
|
13
|
+
"it": "Eliminare i dispositivi nel bridge (scoprire vuoto) dopo aver cambiato l'identificatore del dispositivo.",
|
|
14
|
+
"es": "eliminar dispositivos en el puente (descubrir vacío) después de cambiar el device_identifier",
|
|
15
|
+
"pl": "Usuń urządzenia z mostka (odkryj puste) po zmianie identyfikatora urządzenia",
|
|
16
|
+
"uk": "видалити пристрої у мості (відкрити порожнечу) після зміни ідентифікатора пристрою",
|
|
17
|
+
"zh-cn": "更改设备标识符后,在桥接器中删除设备(发现为空)。"
|
|
18
|
+
},
|
|
19
|
+
"1.16.11": {
|
|
20
|
+
"en": "dont use bridge enum within namespace of adapter\nImprove Namebuilding of foreign states to bridge",
|
|
21
|
+
"de": "Verwenden Sie keine Bridge-Enum innerhalb des Namensraums des Adapters.\nVerbessern Sie den Namensaufbau ausländischer Staaten auf Bridging",
|
|
22
|
+
"ru": "не используйте перечисление bridge в пространстве имен адаптера\nУлучшено построение имен иностранных государств для функции bridge.",
|
|
23
|
+
"pt": "Não use a enumeração de ponte dentro do namespace do adaptador.\nMelhorar a construção de nomes de estados estrangeiros para ponte",
|
|
24
|
+
"nl": "Gebruik geen brugenum binnen de namespace van de adapter.\nVerbeter de naamopbouw van buitenlandse staten naar brug",
|
|
25
|
+
"fr": "Ne pas utiliser l'énumération pont (bridge enum) à l'intérieur de l'espace de noms de l'adaptateur.\nAmélioration de la construction du nom des états étrangers pour les ponts.",
|
|
26
|
+
"it": "Non utilizzare l'enumerazione del ponte all'interno dello spazio dei nomi dell'adattatore.\nMiglioramento del nome delle costruzioni degli stati stranieri per rendere più coerente",
|
|
27
|
+
"es": "no use el enum de puente dentro del espacio de nombres del adaptador\nMejorar la construcción de nombres de estados extranjeros para la conexión.",
|
|
28
|
+
"pl": "Nie używaj typu enum bridge w przestrzeni nazw adaptera.\nPoprawiono nazewnictwo zagranicznych stanów, aby ułatwić ich identyfikację.",
|
|
29
|
+
"uk": "не використовуйте перелік `bridge` в межах простору імен адаптера\nПокращено назви зовнішніх держав для зручності.",
|
|
30
|
+
"zh-cn": "在适配器的命名空间中不要使用桥接枚举。\n改进外国状态的名称构建以弥合差异"
|
|
31
|
+
},
|
|
6
32
|
"1.16.10": {
|
|
7
33
|
"en": "bugfix change query of Bridgeurl to LoRaWAN url",
|
|
8
34
|
"de": "Fehlerbehebung Änderung der Abfrage von Bridge-URL zu LoRaWAN-URL",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "Wykrywanie zmian w nowym Discovery urządzeń LoRaWAN",
|
|
68
94
|
"uk": "Виявлення нових пристроїв Discovery з LoRaWAN",
|
|
69
95
|
"zh-cn": "更改LoRaWAN设备的新发现检测"
|
|
70
|
-
},
|
|
71
|
-
"1.16.5": {
|
|
72
|
-
"en": "Bugfix in notifications to Bridge (new device dicovered) => namespace not set",
|
|
73
|
-
"de": "Fehlerbehebung bei Benachrichtigungen an Bridge (neues Gerät erkannt) => Namespace nicht festgelegt",
|
|
74
|
-
"ru": "Исправлена ошибка в уведомлениях для моста (обнаружение нового устройства) => пространство имен не установлено",
|
|
75
|
-
"pt": "Correção de bug nas notificações para Bridge (novo dispositivo descoberto) => espaço de nomes não definido",
|
|
76
|
-
"nl": "Bugfix in meldingen naar Bridge (nieuw apparaat ontdekt) => namespace niet ingesteld",
|
|
77
|
-
"fr": "Correction de bug dans les notifications vers le pont (nouveau périphérique découvert) => espace de noms non défini",
|
|
78
|
-
"it": "Correzione di un bug nelle notifiche al Bridge (nuovo dispositivo scoperto) => namespace non impostato",
|
|
79
|
-
"es": "Corrección de error en las notificaciones al puente (nuevo dispositivo descubierto) => espacio de nombres no establecido",
|
|
80
|
-
"pl": "Poprawiono błąd w powiadomieniach do Bridge (nowe urządzenie zostało znalezione) => nie ustawiona przestrzeń nazw",
|
|
81
|
-
"uk": "Виправлено помилку у сповіщеннях до мосту (виявлено новий пристрій) => не встановлений простір імен",
|
|
82
|
-
"zh-cn": "修复了通知到桥接器的bug(发现新设备)=>命名空间未设置"
|
|
83
|
-
},
|
|
84
|
-
"1.16.4": {
|
|
85
|
-
"en": "Bridge import foreign states till Adapter is running\nBridge delete foreign states till Adapter is running",
|
|
86
|
-
"de": "Brücke importiert externe Zustände, solange der Adapter läuft.\nLösche Fremdzustände aus der Datenbank, solange der Adapter aktiv ist.",
|
|
87
|
-
"ru": "Импортируйте внешние состояния моста до запуска адаптера\nУдаление внешних состояний Bridge, пока работает адаптер.",
|
|
88
|
-
"pt": "Importar estados externos da ponte até que o adaptador esteja em execução\nExcluir estados estrangeiros da ponte até que o adaptador esteja em execução",
|
|
89
|
-
"nl": "Importeer externe toestanden van de brug totdat de adapter actief is\nBridge verwijdert externe statussen zolang de adapter actief is",
|
|
90
|
-
"fr": "Importer les états étrangers du pont tant que l'adaptateur est en cours d'exécution.\nSupprimer les états étrangers du pont tant que l'adaptateur est en cours d'exécution",
|
|
91
|
-
"it": "Importa gli stati esterni del bridge finché l'adattatore è in esecuzione\nEliminazione dello stato estero del bridge fino a quando l'adattatore è in esecuzione",
|
|
92
|
-
"es": "Importar estados extranjeros del puente hasta que el adaptador esté en funcionamiento.\nEliminar estados extranjeros del puente hasta que el adaptador esté en funcionamiento",
|
|
93
|
-
"pl": "Importuj stany mostu do momentu uruchomienia adaptera.\nUsunięto stany obce do momentu uruchomienia adaptera.",
|
|
94
|
-
"uk": "Міст імпортує зовнішні стани поки адаптер працює\nВидалення зовнішніх станів у мосту доки адаптер працює.",
|
|
95
|
-
"zh-cn": "桥接器在适配器运行之前导入外部状态\n桥删除外部状态直到适配器运行"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
|
@@ -402,6 +402,8 @@
|
|
|
402
402
|
"Bridgepassword"
|
|
403
403
|
],
|
|
404
404
|
"native": {
|
|
405
|
+
"TopicToSend": "lora",
|
|
406
|
+
"MessageToSend": "lora",
|
|
405
407
|
"ipUrl": "eu1.cloud.thethings.network",
|
|
406
408
|
"port": 8883,
|
|
407
409
|
"username": "",
|
package/lib/modules/bridge.js
CHANGED
|
@@ -1511,6 +1511,16 @@ class bridgeClass {
|
|
|
1511
1511
|
await this.publishDiscovery(id, this.DiscoveredIds[id]);
|
|
1512
1512
|
delete this.DiscoveredIds[id];
|
|
1513
1513
|
await this.adapter.setState('info.discoveredIds', JSON.stringify(this.DiscoveredIds), true);
|
|
1514
|
+
} else {
|
|
1515
|
+
if (this.DiscoveredIds[id].topic !== this.OldDiscoveredIds[id].topic) {
|
|
1516
|
+
this.adapter.log.debug(`The discovered topic: ${this.OldDiscoveredIds[id].topic} will be removed`);
|
|
1517
|
+
const safeCurrent = this.DiscoveredIds[id];
|
|
1518
|
+
this.DiscoveredIds[id] = this.OldDiscoveredIds[id];
|
|
1519
|
+
this.DiscoveredIds[id].payload = {};
|
|
1520
|
+
await this.publishDiscovery(id, this.DiscoveredIds[id]);
|
|
1521
|
+
this.DiscoveredIds[id] = safeCurrent;
|
|
1522
|
+
await this.publishDiscovery(id, this.DiscoveredIds[id]);
|
|
1523
|
+
}
|
|
1514
1524
|
}
|
|
1515
1525
|
}
|
|
1516
1526
|
}
|
|
@@ -1577,7 +1587,13 @@ class bridgeClass {
|
|
|
1577
1587
|
const bridgeElements = await this.adapter.getForeignObjectAsync(idBridgefunction);
|
|
1578
1588
|
if (bridgeElements) {
|
|
1579
1589
|
for (const member of bridgeElements.common.members) {
|
|
1580
|
-
|
|
1590
|
+
if (!member.startsWith(this.adapter.namespace)) {
|
|
1591
|
+
await this.discoverForeignRange(member);
|
|
1592
|
+
} else {
|
|
1593
|
+
this.adapter.log.warn(
|
|
1594
|
+
`The bridge enum is set within adapternamespace. please remove form id: ${member}`,
|
|
1595
|
+
);
|
|
1596
|
+
}
|
|
1581
1597
|
}
|
|
1582
1598
|
}
|
|
1583
1599
|
}
|
|
@@ -1661,6 +1677,9 @@ class bridgeClass {
|
|
|
1661
1677
|
} else {
|
|
1662
1678
|
parentName = parentChannel.common.name.de;
|
|
1663
1679
|
}
|
|
1680
|
+
if (parentName === '') {
|
|
1681
|
+
parentName = partentId;
|
|
1682
|
+
}
|
|
1664
1683
|
}
|
|
1665
1684
|
} else {
|
|
1666
1685
|
this.adapter.log.debug(`Parentdevice: ${JSON.stringify(parentDevice)}`);
|
|
@@ -1715,15 +1734,6 @@ class bridgeClass {
|
|
|
1715
1734
|
discoveryPayload,
|
|
1716
1735
|
discoveryPayload.state_topic,
|
|
1717
1736
|
);
|
|
1718
|
-
|
|
1719
|
-
/*if (!this.PublishedIds[id]) {
|
|
1720
|
-
this.PublishedIds[id] = { discovery: [] };
|
|
1721
|
-
}
|
|
1722
|
-
this.PublishedIds[id].discovery.push({
|
|
1723
|
-
topic: discoveryTopic,
|
|
1724
|
-
payload: structuredClone(discoveryPayload),
|
|
1725
|
-
});
|
|
1726
|
-
this.PublishedIds[id].state_topic = discoveryPayload.state_topic;*/
|
|
1727
1737
|
}
|
|
1728
1738
|
if (options.Bridgestate.subscribe) {
|
|
1729
1739
|
this.assignTopicStructure(
|
|
@@ -1736,15 +1746,6 @@ class bridgeClass {
|
|
|
1736
1746
|
discoveryPayload,
|
|
1737
1747
|
id,
|
|
1738
1748
|
);
|
|
1739
|
-
|
|
1740
|
-
/*if (!this.SubscribedTopics[discoveryPayload.command_topic]) {
|
|
1741
|
-
this.SubscribedTopics[discoveryPayload.command_topic] = { discovery: [] };
|
|
1742
|
-
}
|
|
1743
|
-
this.SubscribedTopics[discoveryPayload.command_topic].discovery.push({
|
|
1744
|
-
topic: discoveryTopic,
|
|
1745
|
-
payload: structuredClone(discoveryPayload),
|
|
1746
|
-
});
|
|
1747
|
-
this.SubscribedTopics[discoveryPayload.command_topic].id = id;*/
|
|
1748
1749
|
}
|
|
1749
1750
|
await this.publishDiscovery(id, {
|
|
1750
1751
|
topic: discoveryTopic,
|
package/main.js
CHANGED
|
@@ -441,7 +441,13 @@ class Lorawan extends utils.Adapter {
|
|
|
441
441
|
const members = obj.common.members;
|
|
442
442
|
for (const member of members) {
|
|
443
443
|
if (!this.bridge.ForeignBridgeMembers[member]) {
|
|
444
|
-
|
|
444
|
+
if (!member.startsWith(this.namespace)) {
|
|
445
|
+
await this.bridge?.discoverForeignRange(member);
|
|
446
|
+
} else {
|
|
447
|
+
this.log.warn(
|
|
448
|
+
`The bridge enum is set within adapternamespace. please remove form id: ${member}`,
|
|
449
|
+
);
|
|
450
|
+
}
|
|
445
451
|
return;
|
|
446
452
|
}
|
|
447
453
|
}
|
|
@@ -1025,7 +1031,7 @@ class Lorawan extends utils.Adapter {
|
|
|
1025
1031
|
}
|
|
1026
1032
|
result += element.DeviceIdentifier;
|
|
1027
1033
|
}
|
|
1028
|
-
result = `${this.
|
|
1034
|
+
result = `${this.bridge?.bridgeMqttClient.BridgePrefix}${result}/state`;
|
|
1029
1035
|
// Send response
|
|
1030
1036
|
if (obj.callback) {
|
|
1031
1037
|
this.sendTo(obj.from, obj.command, result, obj.callback);
|
|
@@ -1053,7 +1059,7 @@ class Lorawan extends utils.Adapter {
|
|
|
1053
1059
|
}
|
|
1054
1060
|
result += this.messagehandler?.directoryhandler.HABridge.Dummy[element.DeviceIdentifier];
|
|
1055
1061
|
}
|
|
1056
|
-
result = `${this.
|
|
1062
|
+
result = `${this.bridge?.bridgeMqttClient.BridgePrefix}${result}/state`;
|
|
1057
1063
|
// Send response
|
|
1058
1064
|
if (obj.callback) {
|
|
1059
1065
|
this.sendTo(obj.from, obj.command, result, obj.callback);
|
|
@@ -1256,7 +1262,6 @@ class Lorawan extends utils.Adapter {
|
|
|
1256
1262
|
}
|
|
1257
1263
|
} else if (obj.command === 'getBridgeConnection') {
|
|
1258
1264
|
try {
|
|
1259
|
-
this.log.error(typeof obj.message.Bridgessl);
|
|
1260
1265
|
let connection = false;
|
|
1261
1266
|
const mqttprefix = obj.message.Bridgessl ? 'mqtts://' : 'mqtt://';
|
|
1262
1267
|
const testclient = mqtt.connect(`${mqttprefix}${obj.message.BridgeipUrl}`, {
|
|
@@ -1284,6 +1289,14 @@ class Lorawan extends utils.Adapter {
|
|
|
1284
1289
|
} catch (error) {
|
|
1285
1290
|
this.log.error(error);
|
|
1286
1291
|
}
|
|
1292
|
+
} else if (obj.command === 'sendMQTTMessage') {
|
|
1293
|
+
try {
|
|
1294
|
+
this.log.error(typeof obj.message.Topic);
|
|
1295
|
+
this.log.error(typeof obj.message.Message);
|
|
1296
|
+
this.sendTo(obj.from, obj.command, { result: 'OK' }, obj.callback);
|
|
1297
|
+
} catch (error) {
|
|
1298
|
+
this.log.error(error);
|
|
1299
|
+
}
|
|
1287
1300
|
} else {
|
|
1288
1301
|
const result = { error: true, message: 'No message matched', received: obj.message };
|
|
1289
1302
|
if (obj.callback) {
|