iobroker.lorawan 1.17.9 → 1.17.11
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 +0 -2
- package/admin/i18n/en/translations.json +0 -2
- package/admin/i18n/es/translations.json +2 -4
- package/admin/i18n/fr/translations.json +5 -7
- package/admin/i18n/it/translations.json +2 -4
- package/admin/i18n/nl/translations.json +2 -4
- package/admin/i18n/pl/translations.json +2 -4
- package/admin/i18n/pt/translations.json +3 -5
- package/admin/i18n/ru/translations.json +2 -4
- package/admin/i18n/uk/translations.json +3 -5
- package/admin/i18n/zh-cn/translations.json +3 -5
- package/admin/jsonConfig.json +0 -17
- package/io-package.json +51 -32
- package/lib/modules/bridge.js +83 -170
- package/lib/modules/bridgeMqttclient.js +7 -4
- package/lib/modules/directorieshandler.js +1 -9
- package/lib/modules/messagehandler.js +6 -11
- package/lib/modules/mqttclient.js +5 -3
- package/main.js +87 -1
- 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.17.11 (2025-09-23)
|
|
27
|
+
* (BenAhrdt) dont fillDownlinks in case of not implemented messagetype
|
|
28
|
+
* (BenAhrdt) type of json ids changed to string
|
|
29
|
+
|
|
30
|
+
### 1.17.10 (2025-09-23)
|
|
31
|
+
* (BenAhrdt) Update topics und qnique ids
|
|
32
|
+
|
|
26
33
|
### 1.17.9 (2025-09-20)
|
|
27
34
|
* (BenAhrdt) setdefault defiveidentifier for lorawan bridge function to used Device Id
|
|
28
35
|
|
|
@@ -145,8 +145,6 @@
|
|
|
145
145
|
"* Not Present (Virtual)": "* Nicht vorhanden (virtuell)",
|
|
146
146
|
"BridgenotificationActivation": "Benachrichtigungsaktivierung",
|
|
147
147
|
"BridgenotificationTooltip": "Aktivieren oder deaktivieren Sie die Benachrichtigung",
|
|
148
|
-
"BridgeDevicenotificationActivation": "Gerätebenachrichtigungsaktivierung",
|
|
149
|
-
"BridgeDevicenotificationTooltip": "Aktivieren oder deaktivieren Sie die Benachrichtigung für Geräte",
|
|
150
148
|
"all notifications": "Alle Benachrichtigungen",
|
|
151
149
|
"bridge connection": "Verbindungsbenachrichtigungen",
|
|
152
150
|
"new discover": "Discover Benachrichtigungen",
|
|
@@ -145,8 +145,6 @@
|
|
|
145
145
|
"* Not Present (Virtual)": "* Not Present (Virtual)",
|
|
146
146
|
"BridgenotificationActivation": "notification activation",
|
|
147
147
|
"BridgenotificationTooltip": "activate or deactivate the notification",
|
|
148
|
-
"BridgeDevicenotificationActivation": "device notification activation",
|
|
149
|
-
"BridgeDevicenotificationTooltip": "activate or deactivate the notification for devices",
|
|
150
148
|
"all notifications": "all notifications",
|
|
151
149
|
"bridge connection": "connection notifications",
|
|
152
150
|
"new discover": "discover notifications",
|
|
@@ -145,8 +145,6 @@
|
|
|
145
145
|
"* Not Present (Virtual)": "* No presente (virtual)",
|
|
146
146
|
"BridgenotificationActivation": "activación de notificación",
|
|
147
147
|
"BridgenotificationTooltip": "activar o desactivar la notificación",
|
|
148
|
-
"BridgeDevicenotificationActivation": "activación de notificación del dispositivo",
|
|
149
|
-
"BridgeDevicenotificationTooltip": "activar o desactivar la notificación de dispositivos",
|
|
150
148
|
"all notifications": "Todas las notificaciones",
|
|
151
149
|
"bridge connection": "Notificaciones de conexión",
|
|
152
150
|
"new discover": "Descubrir notificaciones",
|
|
@@ -171,8 +169,8 @@
|
|
|
171
169
|
"BridgeForeignPanel": "Puente extranjero",
|
|
172
170
|
"BridgeForeignConfigHeader": "Configuración para los estados extranjeros",
|
|
173
171
|
"BridgeLoRaHeader": "Definición de indicador de dispositivos",
|
|
174
|
-
"BridgeForeignHeader": "
|
|
175
|
-
"_BridgeEnumDiscription": "
|
|
172
|
+
"BridgeForeignHeader": "Seleccione el puente enum",
|
|
173
|
+
"_BridgeEnumDiscription": "Seleccione un enum que se use para establecer estados en puente.\nEl nombre del dispositivo está siguiendo estas prioridades:\n1.\n2. Nombre de canal\n3. Espacio de nombres de estado",
|
|
176
174
|
"ClimateForeignHeader": "Definir estados para la entidad climática",
|
|
177
175
|
"ClimateForeignInformation": "Aquí puedes definir una variedad de definiciones climáticas",
|
|
178
176
|
"VirtualMode": "Modo virtual",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"deviceType": "type d'appareil",
|
|
52
52
|
"expertSettings": "Sets d'experts",
|
|
53
53
|
"enabled & collect": "activé et collecté",
|
|
54
|
-
"deviceTypeTooltip": "
|
|
54
|
+
"deviceTypeTooltip": "insert the name of the device type, this config is valid. (par exemple, Dragino Xy correspond également à Dragino)",
|
|
55
55
|
"sendWithUplink": "Envoyer avec la liaison montante",
|
|
56
56
|
"sendWithUplinkTooltip": "Choisissez votre mode d'envoi pour les configurations avec le deviceType souhaité",
|
|
57
57
|
"decimalPlaces": "décimal",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"unused": "inutilisé",
|
|
78
78
|
"downlinkConfigHeader": "Ajoutez les liaisons descendantes de votre appareil spécifiques",
|
|
79
79
|
"customConfig": "\"Custom\" -konfiguation",
|
|
80
|
-
"customConfigHeader": "
|
|
80
|
+
"customConfigHeader": "Ajoutez un objet personnalisé spécifique à chaque état décodé",
|
|
81
81
|
"customJson": "Objekt für den \"Custom\" -Bereich im \"commun\" objekt",
|
|
82
82
|
"customJsonTooltip": "Fügen Sie Ein objekt Hinzu, Welches en commun. Custom Geschrieben Wird.",
|
|
83
83
|
"customJsonInformation": "Avec cette fonction, il est possible d'ajouter vos propres entrées personnalisées aux états décodés. Entrez simplement le contenu JSON souhaité en fonction active.",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"minus": "moins",
|
|
113
113
|
"BridgeHeader": "Pont vers un système étranger",
|
|
114
114
|
"_DeviceIdentifierConfiguredDiscription": "Résultat d'un sujet configuré:",
|
|
115
|
-
"_DeviceIdentifierDiscription": "Configurez les identifiants pour créer un sujet MQTT pour un état.
|
|
115
|
+
"_DeviceIdentifierDiscription": "Configurez les identifiants pour créer un sujet MQTT pour un état. You can select multiple device identifiers, separated by the separator.",
|
|
116
116
|
"_DeviceIdentifierExampleDiscription": "Exemple de sujet configuré:",
|
|
117
117
|
"_NoLoRaWAN": "L'État n'est pas dans l'instance de Lorawan droite",
|
|
118
118
|
"publishTooltip": "Publier l'État sur le pont",
|
|
@@ -145,8 +145,6 @@
|
|
|
145
145
|
"* Not Present (Virtual)": "* Pas présent (virtuel)",
|
|
146
146
|
"BridgenotificationActivation": "activation de la notification",
|
|
147
147
|
"BridgenotificationTooltip": "activer ou désactiver la notification",
|
|
148
|
-
"BridgeDevicenotificationActivation": "Activation de la notification de l'appareil",
|
|
149
|
-
"BridgeDevicenotificationTooltip": "activer ou désactiver la notification des appareils",
|
|
150
148
|
"all notifications": "Toutes les notifications",
|
|
151
149
|
"bridge connection": "Notifications de connexion",
|
|
152
150
|
"new discover": "Découvrez les notifications",
|
|
@@ -171,8 +169,8 @@
|
|
|
171
169
|
"BridgeForeignPanel": "Pont à l'étranger",
|
|
172
170
|
"BridgeForeignConfigHeader": "Paramètres pour les États étrangers",
|
|
173
171
|
"BridgeLoRaHeader": "Définition de l'appareil indiquant",
|
|
174
|
-
"BridgeForeignHeader": "
|
|
175
|
-
"_BridgeEnumDiscription": "
|
|
172
|
+
"BridgeForeignHeader": "Sélection de Bridge Enum",
|
|
173
|
+
"_BridgeEnumDiscription": "Sélectionnez une enum Tha est utilisée pour établir des états dans le pont.\nLe nom de l'appareil suit ces priorités:\n1. Devicename\n2. ChannelName\n3. Espace de noms de l'État",
|
|
176
174
|
"ClimateForeignHeader": "Définir les États de l'entité climatique",
|
|
177
175
|
"ClimateForeignInformation": "Ici, vous pouvez définir un tableau de définitions climatiques",
|
|
178
176
|
"VirtualMode": "Mode virtuel",
|
|
@@ -145,8 +145,6 @@
|
|
|
145
145
|
"* Not Present (Virtual)": "* Non presente (virtuale)",
|
|
146
146
|
"BridgenotificationActivation": "Attivazione della notifica",
|
|
147
147
|
"BridgenotificationTooltip": "attivare o disattivare la notifica",
|
|
148
|
-
"BridgeDevicenotificationActivation": "Attivazione della notifica del dispositivo",
|
|
149
|
-
"BridgeDevicenotificationTooltip": "attivare o disattivare la notifica per i dispositivi",
|
|
150
148
|
"all notifications": "tutte le notifiche",
|
|
151
149
|
"bridge connection": "Notifiche di connessione",
|
|
152
150
|
"new discover": "Scopri le notifiche",
|
|
@@ -171,8 +169,8 @@
|
|
|
171
169
|
"BridgeForeignPanel": "Ponte straniero",
|
|
172
170
|
"BridgeForeignConfigHeader": "Impostazioni per gli stati stranieri",
|
|
173
171
|
"BridgeLoRaHeader": "Definizione di DisponiveIdEtifier",
|
|
174
|
-
"BridgeForeignHeader": "
|
|
175
|
-
"_BridgeEnumDiscription": "
|
|
172
|
+
"BridgeForeignHeader": "Seleziona il ponte enum",
|
|
173
|
+
"_BridgeEnumDiscription": "Selezionare un enum tha viene utilizzato per l'impostazione degli stati nel ponte.\nIl nome del dispositivo sta seguendo queste priorità:\n1. Devicename\n2. CANALENAME\n3. Spazio dei nomi di stato",
|
|
176
174
|
"ClimateForeignHeader": "Definire gli stati per l'entità climatica",
|
|
177
175
|
"ClimateForeignInformation": "Qui puoi definire una serie di definizioni climatiche",
|
|
178
176
|
"VirtualMode": "Modalità virtuale",
|
|
@@ -145,8 +145,6 @@
|
|
|
145
145
|
"* Not Present (Virtual)": "* Niet aanwezig (virtueel)",
|
|
146
146
|
"BridgenotificationActivation": "Activering van melding",
|
|
147
147
|
"BridgenotificationTooltip": "de melding activeren of deactiveren",
|
|
148
|
-
"BridgeDevicenotificationActivation": "Activering van apparaatmeldingen",
|
|
149
|
-
"BridgeDevicenotificationTooltip": "de melding voor apparaten activeren of deactiveren",
|
|
150
148
|
"all notifications": "Alle meldingen",
|
|
151
149
|
"bridge connection": "Verbindingsmeldingen",
|
|
152
150
|
"new discover": "Ontdek meldingen",
|
|
@@ -171,8 +169,8 @@
|
|
|
171
169
|
"BridgeForeignPanel": "Brug buitenlands",
|
|
172
170
|
"BridgeForeignConfigHeader": "Instellingen voor de buitenlandse staten",
|
|
173
171
|
"BridgeLoRaHeader": "Definitie van apparaatIndetifier",
|
|
174
|
-
"BridgeForeignHeader": "
|
|
175
|
-
"_BridgeEnumDiscription": "
|
|
172
|
+
"BridgeForeignHeader": "Selecteer van Bridge Enum",
|
|
173
|
+
"_BridgeEnumDiscription": "Selecteer een enum die wordt gebruikt voor het instellen van staten in brug.\nDe naam van het apparaat volgt deze prioriteiten:\n1. Devicename\n2. ChannelName\n3. Naamruimte van de staat",
|
|
176
174
|
"ClimateForeignHeader": "Definieer staten voor klimaat entiteit",
|
|
177
175
|
"ClimateForeignInformation": "Hier kunt u een scala aan klimaatdefinities definiëren",
|
|
178
176
|
"VirtualMode": "Virtuele modus",
|
|
@@ -145,8 +145,6 @@
|
|
|
145
145
|
"* Not Present (Virtual)": "* Nie obecne (wirtualne)",
|
|
146
146
|
"BridgenotificationActivation": "Aktywacja powiadomienia",
|
|
147
147
|
"BridgenotificationTooltip": "aktywuj lub dezaktywuj powiadomienie",
|
|
148
|
-
"BridgeDevicenotificationActivation": "Aktywacja powiadomienia urządzenia",
|
|
149
|
-
"BridgeDevicenotificationTooltip": "aktywuj lub dezaktywuj powiadomienie o urządzeniach",
|
|
150
148
|
"all notifications": "wszystkie powiadomienia",
|
|
151
149
|
"bridge connection": "Powiadomienia połączeń",
|
|
152
150
|
"new discover": "Odkryj powiadomienia",
|
|
@@ -171,8 +169,8 @@
|
|
|
171
169
|
"BridgeForeignPanel": "Most zagraniczny",
|
|
172
170
|
"BridgeForeignConfigHeader": "Ustawienia dla obcych państw",
|
|
173
171
|
"BridgeLoRaHeader": "Definicja urządzenia",
|
|
174
|
-
"BridgeForeignHeader": "
|
|
175
|
-
"_BridgeEnumDiscription": "
|
|
172
|
+
"BridgeForeignHeader": "Wybierz Enum mostu",
|
|
173
|
+
"_BridgeEnumDiscription": "Wybierz enum THA służy do ustawiania stanów na most.\nNazwa urządzenia podąża za tymi priorytetami:\n1. DeviceName\n2. Nazwa kanału\n3. Przestrzeń nazw państwa",
|
|
176
174
|
"ClimateForeignHeader": "Zdefiniuj stany dla jednostki klimatycznej",
|
|
177
175
|
"ClimateForeignInformation": "Tutaj możesz zdefiniować szereg definicji klimatycznych",
|
|
178
176
|
"VirtualMode": "Tryb wirtualny",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"RefreshDiscoveryCronJobTooltip": "Insira o Cronjob para refrescar a descoberta",
|
|
132
132
|
"ClimateHeader": "Definir estados para a entidade climática",
|
|
133
133
|
"ClimateInformation": "Aqui você pode definir uma variedade de definições climáticas",
|
|
134
|
-
"ClimateNameText": "
|
|
134
|
+
"ClimateNameText": "EntityName",
|
|
135
135
|
"ClimateTargetTemperatureText": "Temperatura alvo",
|
|
136
136
|
"ClimateActTemperatureText": "Temperatura alvo",
|
|
137
137
|
"ClimateModeTemperatureText": "Modo",
|
|
@@ -145,8 +145,6 @@
|
|
|
145
145
|
"* Not Present (Virtual)": "* Não presente (virtual)",
|
|
146
146
|
"BridgenotificationActivation": "Ativação de notificação",
|
|
147
147
|
"BridgenotificationTooltip": "ativar ou desativar a notificação",
|
|
148
|
-
"BridgeDevicenotificationActivation": "Ativação de notificação do dispositivo",
|
|
149
|
-
"BridgeDevicenotificationTooltip": "ativar ou desativar a notificação para dispositivos",
|
|
150
148
|
"all notifications": "todas as notificações",
|
|
151
149
|
"bridge connection": "notificações de conexão",
|
|
152
150
|
"new discover": "Descubra notificações",
|
|
@@ -171,8 +169,8 @@
|
|
|
171
169
|
"BridgeForeignPanel": "Ponte estrangeira",
|
|
172
170
|
"BridgeForeignConfigHeader": "Configurações para os estados estrangeiros",
|
|
173
171
|
"BridgeLoRaHeader": "Definição de DeviceIndetifier",
|
|
174
|
-
"BridgeForeignHeader": "
|
|
175
|
-
"_BridgeEnumDiscription": "
|
|
172
|
+
"BridgeForeignHeader": "Selecione o enum da ponte",
|
|
173
|
+
"_BridgeEnumDiscription": "Selecione um enum tha é usado para definir estados na ponte.\nO nome do dispositivo está seguindo essas prioridades:\n1. DeviceName\n2. Nome do canal\n3. Namespace of State",
|
|
176
174
|
"ClimateForeignHeader": "Definir estados para a entidade climática",
|
|
177
175
|
"ClimateForeignInformation": "Aqui você pode definir uma variedade de definições climáticas",
|
|
178
176
|
"VirtualMode": "Modo virtual",
|
|
@@ -145,8 +145,6 @@
|
|
|
145
145
|
"* Not Present (Virtual)": "* Нет присутствующего (виртуально)",
|
|
146
146
|
"BridgenotificationActivation": "активация уведомления",
|
|
147
147
|
"BridgenotificationTooltip": "активировать или деактивировать уведомление",
|
|
148
|
-
"BridgeDevicenotificationActivation": "Активация уведомления устройства",
|
|
149
|
-
"BridgeDevicenotificationTooltip": "активировать или деактивировать уведомление для устройств",
|
|
150
148
|
"all notifications": "все уведомления",
|
|
151
149
|
"bridge connection": "Уведомления об соединении",
|
|
152
150
|
"new discover": "Откройте для себя уведомления",
|
|
@@ -171,8 +169,8 @@
|
|
|
171
169
|
"BridgeForeignPanel": "Мост иностранный",
|
|
172
170
|
"BridgeForeignConfigHeader": "Настройки для иностранных государств",
|
|
173
171
|
"BridgeLoRaHeader": "Определение устройства Indetifier",
|
|
174
|
-
"BridgeForeignHeader": "
|
|
175
|
-
"_BridgeEnumDiscription": "
|
|
172
|
+
"BridgeForeignHeader": "Выберите мостовой перевод",
|
|
173
|
+
"_BridgeEnumDiscription": "Выберите Enum THA, используется для установки состояний в мост.\nНазвание устройства следует этим приоритетам:\n1. DeviceName\n2. ChannelName\n3. Пространство государства имен",
|
|
176
174
|
"ClimateForeignHeader": "Определить состояния для климатической сущности",
|
|
177
175
|
"ClimateForeignInformation": "Здесь вы можете определить множество климатических определений",
|
|
178
176
|
"VirtualMode": "Виртуальный режим",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"keepalive": "зберігати",
|
|
76
76
|
"keepaliveTooltip": "Введіть час у секундах для функції Keepalive",
|
|
77
77
|
"unused": "невикористаний",
|
|
78
|
-
"downlinkConfigHeader": "Додайте
|
|
78
|
+
"downlinkConfigHeader": "Додайте пристрій конкретні низки",
|
|
79
79
|
"customConfig": "\"Custom\" -konfitiguation",
|
|
80
80
|
"customConfigHeader": "Додайте конкретний спеціальний об’єкт до кожного декодованого стану",
|
|
81
81
|
"customJson": "Objekt für den \"custom\" -bereich im \"common\" objekt",
|
|
@@ -145,8 +145,6 @@
|
|
|
145
145
|
"* Not Present (Virtual)": "* Немає (віртуальний)",
|
|
146
146
|
"BridgenotificationActivation": "Активація сповіщень",
|
|
147
147
|
"BridgenotificationTooltip": "активуйте або деактивувати повідомлення",
|
|
148
|
-
"BridgeDevicenotificationActivation": "Активація сповіщень пристрою",
|
|
149
|
-
"BridgeDevicenotificationTooltip": "Активуйте або деактивувати сповіщення про пристрої",
|
|
150
148
|
"all notifications": "Всі сповіщення",
|
|
151
149
|
"bridge connection": "Повідомлення про з'єднання",
|
|
152
150
|
"new discover": "Відкрийте сповіщення",
|
|
@@ -171,8 +169,8 @@
|
|
|
171
169
|
"BridgeForeignPanel": "Міст іноземний",
|
|
172
170
|
"BridgeForeignConfigHeader": "Налаштування іноземних держав",
|
|
173
171
|
"BridgeLoRaHeader": "Визначення пристроюіндерифікатора",
|
|
174
|
-
"BridgeForeignHeader": "
|
|
175
|
-
"_BridgeEnumDiscription": "
|
|
172
|
+
"BridgeForeignHeader": "Вибір мосту Enum",
|
|
173
|
+
"_BridgeEnumDiscription": "Виберіть Enum Tha використовується для встановлення станів у міст.\nНазва пристрою виконує ці пріоритети:\n1.\n2.\n3. Державний простір імен",
|
|
176
174
|
"ClimateForeignHeader": "Визначте стани клімату",
|
|
177
175
|
"ClimateForeignInformation": "Тут ви можете визначити безліч визначення клімату",
|
|
178
176
|
"VirtualMode": "Віртуальний режим",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"subscribeTooltip": "从桥梁订阅州",
|
|
120
120
|
"BridgeStateHeader": "定义发现主题的状态",
|
|
121
121
|
"BridgeStateInformation": "在这里,您可以定义一系列状态,这些状态将设置为发现的主题。 (通配符也是可能的)",
|
|
122
|
-
"Application": "
|
|
122
|
+
"Application": "Application",
|
|
123
123
|
"Device": "设备",
|
|
124
124
|
"Folder": "文件夹",
|
|
125
125
|
"State": "状态",
|
|
@@ -145,8 +145,6 @@
|
|
|
145
145
|
"* Not Present (Virtual)": "*不存在(虚拟)",
|
|
146
146
|
"BridgenotificationActivation": "通知激活",
|
|
147
147
|
"BridgenotificationTooltip": "激活或停用通知",
|
|
148
|
-
"BridgeDevicenotificationActivation": "设备通知激活",
|
|
149
|
-
"BridgeDevicenotificationTooltip": "激活或停用设备的通知",
|
|
150
148
|
"all notifications": "所有通知",
|
|
151
149
|
"bridge connection": "连接通知",
|
|
152
150
|
"new discover": "发现通知",
|
|
@@ -171,8 +169,8 @@
|
|
|
171
169
|
"BridgeForeignPanel": "外国桥梁",
|
|
172
170
|
"BridgeForeignConfigHeader": "外国的设置",
|
|
173
171
|
"BridgeLoRaHeader": "设备Indetifier的定义",
|
|
174
|
-
"BridgeForeignHeader": "
|
|
175
|
-
"_BridgeEnumDiscription": "
|
|
172
|
+
"BridgeForeignHeader": "选择桥梁枚举",
|
|
173
|
+
"_BridgeEnumDiscription": "选择一个枚举,用于将状态设置为桥梁。\n该设备的名称遵循此优先级:\n1。devicename\n2。频道名称\n3。状态名称空间",
|
|
176
174
|
"ClimateForeignHeader": "定义气候实体的国家",
|
|
177
175
|
"ClimateForeignInformation": "在这里您可以定义一系列气候定义",
|
|
178
176
|
"VirtualMode": "虚拟模式",
|
package/admin/jsonConfig.json
CHANGED
|
@@ -804,23 +804,6 @@
|
|
|
804
804
|
"lg": 3,
|
|
805
805
|
"xl": 3
|
|
806
806
|
},
|
|
807
|
-
"BridgeDevicenotificationActivation":{
|
|
808
|
-
"type": "select",
|
|
809
|
-
"label": "BridgeDevicenotificationActivation",
|
|
810
|
-
"hidden": "data.BridgeType === 'off'",
|
|
811
|
-
"tooltip": "BridgeDevicenotificationActivationTooltip",
|
|
812
|
-
"options": [
|
|
813
|
-
{"label":"all notifications","value":"allNotifications, bridgeConnection, newDiscover, deviceState"},
|
|
814
|
-
{"label":"device online offline","value":"deviceState"},
|
|
815
|
-
{"label":"no notifications","value":"noNotifications"}
|
|
816
|
-
],
|
|
817
|
-
"default": "allNotifications, bridgeConnection, newDiscover, deviceState",
|
|
818
|
-
"xs": 12,
|
|
819
|
-
"sm": 3,
|
|
820
|
-
"md": 3,
|
|
821
|
-
"lg": 3,
|
|
822
|
-
"xl": 3
|
|
823
|
-
},
|
|
824
807
|
"_BridgeServersettingsHeader": {
|
|
825
808
|
"newLine": true,
|
|
826
809
|
"type": "header",
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "lorawan",
|
|
4
|
-
"version": "1.17.
|
|
4
|
+
"version": "1.17.11",
|
|
5
5
|
"news": {
|
|
6
|
+
"1.17.11": {
|
|
7
|
+
"en": "dont fillDownlinks in case of not implemented messagetype\ntype of json ids changed to string",
|
|
8
|
+
"de": "nicht ausfüllen Downlinks bei nicht implementiertem Nachrichtentyp\nart der json ids geändert in string",
|
|
9
|
+
"ru": "не заполнять Downlinks в случае нереализованного типа сообщения\nтип json ids изменили на строку",
|
|
10
|
+
"pt": "não preencher Links para baixo em caso de tipo de mensagem não implementado\no tipo de ids json mudou para string",
|
|
11
|
+
"nl": "vullen Downlinks in geval van niet geïmplementeerd berichttype\ntype json-id's veranderd in string",
|
|
12
|
+
"fr": "ne pas remplir Liens vers le bas en cas de type de message non mis en œuvre\ntype d'ids de json changé en chaîne",
|
|
13
|
+
"it": "non riempire Downlinks in caso di messaggio non implementato\ntipo di json ids cambiato in stringa",
|
|
14
|
+
"es": "no te llenes Enlaces descendentes en caso de no aplicar el tipo de mensaje\ntipo json ids cambiados a cadena",
|
|
15
|
+
"pl": "nie wypełniaj Downlinks w przypadku niewdrożonego rodzaju wiadomości\nrodzaj idów json zmienionych na ciąg",
|
|
16
|
+
"uk": "не заповнити Попередження у разі невиконання типу повідомлення\nтип json ids змінився на рядок",
|
|
17
|
+
"zh-cn": "不填满 未执行消息类型时的下行链接\n更改为字符串的 json id 类型"
|
|
18
|
+
},
|
|
19
|
+
"1.17.10": {
|
|
20
|
+
"en": "Update topics und qnique ids",
|
|
21
|
+
"de": "Update-Themen und qnique ids",
|
|
22
|
+
"ru": "Обновление тем und qnique ids",
|
|
23
|
+
"pt": "Atualizar tópicos e IDs do qnique",
|
|
24
|
+
"nl": "Onderwerpen en qnique-id's bijwerken",
|
|
25
|
+
"fr": "Mettre à jour les sujets et les ids qnique",
|
|
26
|
+
"it": "Aggiornare gli argomenti und qnique ids",
|
|
27
|
+
"es": "Actualizar temas und qnique ids",
|
|
28
|
+
"pl": "Aktualizacja tematów i idów qnique",
|
|
29
|
+
"uk": "Оновлення тем und qnique ids",
|
|
30
|
+
"zh-cn": "更新主题 und qnique ids"
|
|
31
|
+
},
|
|
6
32
|
"1.17.9": {
|
|
7
33
|
"en": "setdefault defiveidentifier for lorawan bridge function to used Device Id",
|
|
8
34
|
"de": "Setzen Sie den Standardgerätekennzeichner für die LoRaWAN-Bridge-Funktion auf die Verwendung der Geräte-ID.",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "Popraw zapytanie o stany zagraniczne w odkrywaniu zagranicznego klimatu",
|
|
68
94
|
"uk": "Покращено запит для іноземних держав у відкритті зовнішнього клімату",
|
|
69
95
|
"zh-cn": "改进了外国气候的查询。"
|
|
70
|
-
},
|
|
71
|
-
"1.17.4": {
|
|
72
|
-
"en": "More debuglogging for Foreign Climate error",
|
|
73
|
-
"de": "Mehr Debug-Logging für Fehler bei Fremdklima.",
|
|
74
|
-
"ru": "Больше отладочного журналирования для ошибки внешнего климата",
|
|
75
|
-
"pt": "Mais debuglogging para erro de Clima Estrangeiro",
|
|
76
|
-
"nl": "Meer debuglogging voor fouten in het buitenlandse klimaatsysteem",
|
|
77
|
-
"fr": "Plus de debuglogging pour l'erreur Foreign Climate",
|
|
78
|
-
"it": "Maggiori dettagli di debug per gli errori relativi al sistema di climatizzazione esterno",
|
|
79
|
-
"es": "Más depuración para el error de Clima Externo",
|
|
80
|
-
"pl": "Więcej debugowania dla błędu Foreign Climate",
|
|
81
|
-
"uk": "Більше відладки для помилки зовнішнього клімату",
|
|
82
|
-
"zh-cn": "为外部气候错误添加更多的调试日志记录"
|
|
83
|
-
},
|
|
84
|
-
"1.17.3": {
|
|
85
|
-
"en": "Bugfix calling Foreign climate ids",
|
|
86
|
-
"de": "Fehlerbehebung beim Aufrufen von Fremdklima-IDs.",
|
|
87
|
-
"ru": "Исправлена ошибка при вызове иностранных идентификаторов климата",
|
|
88
|
-
"pt": "Correção de bug ao chamar ids de clima estrangeiros",
|
|
89
|
-
"nl": "Bugfix voor het oproepen van vreemde klimaat-id's",
|
|
90
|
-
"fr": "Correction de bug pour l'appel des identifiants de climatisation étrangers",
|
|
91
|
-
"it": "Correzione bug nella chiamata degli ID di climi stranieri",
|
|
92
|
-
"es": "Corregido el problema al llamar a los identificadores climáticos extranjeros",
|
|
93
|
-
"pl": "Naprawiono błąd związany z wywoływaniem identyfikatorów obcych dla klimatyzacji.",
|
|
94
|
-
"uk": "Виправлена помилка при виклику іноземних ідентифікаторів клімату",
|
|
95
|
-
"zh-cn": "修复调用Foreign climate ids时的错误"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
|
@@ -426,7 +426,6 @@
|
|
|
426
426
|
"RefreshDiscoveryCronJob": "0 * * * *",
|
|
427
427
|
"BridgeEnum": "",
|
|
428
428
|
"BridgenotificationActivation": "allNotifications, brdigeConnection, newDiscover, deviceState",
|
|
429
|
-
"BridgeDevicenotificationActivation": "allNotifications, brdigeConnection, newDiscover, deviceState",
|
|
430
429
|
"DeviceIdentifiers": [
|
|
431
430
|
{
|
|
432
431
|
"DeviceIdentifier": "usedDeviceId"
|
|
@@ -508,7 +507,7 @@
|
|
|
508
507
|
"common": {
|
|
509
508
|
"role": "json",
|
|
510
509
|
"name": "Information of all discovered States",
|
|
511
|
-
"type": "
|
|
510
|
+
"type": "string",
|
|
512
511
|
"icon": "icons/discover.png",
|
|
513
512
|
"read": true,
|
|
514
513
|
"write": false,
|
|
@@ -522,7 +521,7 @@
|
|
|
522
521
|
"common": {
|
|
523
522
|
"role": "json",
|
|
524
523
|
"name": "Information of all Published States",
|
|
525
|
-
"type": "
|
|
524
|
+
"type": "string",
|
|
526
525
|
"icon": "icons/discover.png",
|
|
527
526
|
"read": true,
|
|
528
527
|
"write": false,
|
|
@@ -536,7 +535,7 @@
|
|
|
536
535
|
"common": {
|
|
537
536
|
"role": "json",
|
|
538
537
|
"name": "Information of all Subscribed Topics",
|
|
539
|
-
"type": "
|
|
538
|
+
"type": "string",
|
|
540
539
|
"icon": "icons/discover.png",
|
|
541
540
|
"read": true,
|
|
542
541
|
"write": false,
|
|
@@ -550,13 +549,33 @@
|
|
|
550
549
|
"common": {
|
|
551
550
|
"role": "json",
|
|
552
551
|
"name": "Information of all devices",
|
|
553
|
-
"type": "
|
|
552
|
+
"type": "string",
|
|
554
553
|
"icon": "icons/deviceinfo.png",
|
|
555
554
|
"read": true,
|
|
556
555
|
"write": false,
|
|
557
556
|
"def": "{}"
|
|
558
557
|
},
|
|
559
558
|
"native": {}
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
"_id": "bridge",
|
|
562
|
+
"type": "channel",
|
|
563
|
+
"common": {
|
|
564
|
+
"name": "Bridge messaging"
|
|
565
|
+
},
|
|
566
|
+
"native": {}
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
"_id": "bridge.notification",
|
|
570
|
+
"type": "state",
|
|
571
|
+
"common": {
|
|
572
|
+
"type": "string",
|
|
573
|
+
"name": "message to bridge",
|
|
574
|
+
"read": true,
|
|
575
|
+
"write": true,
|
|
576
|
+
"def": ""
|
|
577
|
+
},
|
|
578
|
+
"native": {}
|
|
560
579
|
}
|
|
561
580
|
]
|
|
562
581
|
}
|
package/lib/modules/bridge.js
CHANGED
|
@@ -72,7 +72,8 @@ class bridgeClass {
|
|
|
72
72
|
second: '2-digit',
|
|
73
73
|
},
|
|
74
74
|
};
|
|
75
|
-
this.
|
|
75
|
+
this.discoveredDevices = {};
|
|
76
|
+
|
|
76
77
|
// Unitmapping zur Zuweisung der passenden Unit, wenn diese falsch geschrieben ist
|
|
77
78
|
this.unitMap = {
|
|
78
79
|
'°C': { device_class: 'temperature' },
|
|
@@ -234,9 +235,9 @@ class bridgeClass {
|
|
|
234
235
|
this.adapter.log.debug(`Function ${activeFunction} started.`);
|
|
235
236
|
try {
|
|
236
237
|
if (this.bridgeMqttClient.internalConnectionstate) {
|
|
237
|
-
const
|
|
238
|
-
// notify new discovered Devices (new
|
|
239
|
-
if (
|
|
238
|
+
const newDeviceDiscovered = await this.discovery(id, options);
|
|
239
|
+
// notify new discovered Devices (new deviceidentifier)
|
|
240
|
+
if (newDeviceDiscovered) {
|
|
240
241
|
const device = this.DiscoveredIds[id].informations.usedDeviceId;
|
|
241
242
|
const application = this.DiscoveredIds[id].informations.usedApplicationName;
|
|
242
243
|
const message = `${this.adapter.i18nTranslation['new device discovered']}.\n${this.adapter.i18nTranslation['Device']}: ${device}\n${this.adapter.i18nTranslation['Application']}: ${application}`;
|
|
@@ -291,110 +292,14 @@ class bridgeClass {
|
|
|
291
292
|
* ******************************************************************/
|
|
292
293
|
|
|
293
294
|
/**
|
|
294
|
-
* @param
|
|
295
|
+
* @param normalizedDeficeIdentifier identifier od device
|
|
295
296
|
*/
|
|
296
|
-
async
|
|
297
|
-
const activeFunction = '
|
|
297
|
+
async checkNewDeviceDiscovered(normalizedDeficeIdentifier) {
|
|
298
|
+
const activeFunction = 'bridge.js checkNewDeviceDiscovered';
|
|
298
299
|
this.adapter.log.debug(`Function ${activeFunction} started.`);
|
|
299
300
|
try {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
const deviceIdentifier = this.getDeviceIdentifier(changeInfo, this.adapter.config.DeviceIdentifiers);
|
|
303
|
-
const normalizedDeviceIdentifier = this.normalizeString(deviceIdentifier);
|
|
304
|
-
const general = {
|
|
305
|
-
topic: `${this.bridgeMqttClient.BridgePrefix}${normalizedDeviceIdentifier}/${this.Words.notification}_${this.Words.general}${this.EndingState}`.toLowerCase(),
|
|
306
|
-
notificationId: notificationId,
|
|
307
|
-
};
|
|
308
|
-
let discoveryobject = this.getNotificationDiscoveryObject(deviceIdentifier, this.Words.general);
|
|
309
|
-
this.Notifications[general.notificationId] = {};
|
|
310
|
-
this.assignIdStructure(
|
|
311
|
-
this.PublishedIds,
|
|
312
|
-
general.notificationId,
|
|
313
|
-
{
|
|
314
|
-
applicationName: changeInfo.applicationName,
|
|
315
|
-
usedApplicationName: changeInfo.usedApplicationName,
|
|
316
|
-
deviceId: changeInfo.deviceId,
|
|
317
|
-
usedDeviceId: changeInfo.usedDeviceId,
|
|
318
|
-
},
|
|
319
|
-
discoveryobject?.topic,
|
|
320
|
-
discoveryobject?.payload,
|
|
321
|
-
discoveryobject?.payload.topic,
|
|
322
|
-
);
|
|
323
|
-
|
|
324
|
-
await this.publishDiscovery(general.notificationId, {
|
|
325
|
-
topic: discoveryobject?.topic,
|
|
326
|
-
payload: structuredClone(discoveryobject?.payload),
|
|
327
|
-
informations: {
|
|
328
|
-
applicationName: changeInfo.applicationName,
|
|
329
|
-
usedApplicationName: changeInfo.usedApplicationName,
|
|
330
|
-
deviceId: changeInfo.deviceId,
|
|
331
|
-
usedDeviceId: changeInfo.usedDeviceId,
|
|
332
|
-
},
|
|
333
|
-
});
|
|
334
|
-
|
|
335
|
-
// offline
|
|
336
|
-
const offline = {
|
|
337
|
-
topic: `${this.bridgeMqttClient.BridgePrefix}${normalizedDeviceIdentifier}/${this.Words.notification}_${this.Words.offline}${this.EndingState}`.toLowerCase(),
|
|
338
|
-
notificationId: `${this.adapter.namespace}.${changeInfo.objectStartDirectory}${this.NotificationId}${this.OfflineId}`,
|
|
339
|
-
};
|
|
340
|
-
discoveryobject = this.getNotificationDiscoveryObject(deviceIdentifier, this.Words.offline);
|
|
341
|
-
this.Notifications[offline.notificationId] = {};
|
|
342
|
-
this.assignIdStructure(
|
|
343
|
-
this.PublishedIds,
|
|
344
|
-
offline.notificationId,
|
|
345
|
-
{
|
|
346
|
-
applicationName: changeInfo.applicationName,
|
|
347
|
-
usedApplicationName: changeInfo.usedApplicationName,
|
|
348
|
-
deviceId: changeInfo.deviceId,
|
|
349
|
-
usedDeviceId: changeInfo.usedDeviceId,
|
|
350
|
-
},
|
|
351
|
-
discoveryobject?.topic,
|
|
352
|
-
discoveryobject?.payload,
|
|
353
|
-
discoveryobject?.payload.topic,
|
|
354
|
-
);
|
|
355
|
-
|
|
356
|
-
await this.publishDiscovery(offline.notificationId, {
|
|
357
|
-
topic: discoveryobject?.topic,
|
|
358
|
-
payload: structuredClone(discoveryobject?.payload),
|
|
359
|
-
informations: {
|
|
360
|
-
applicationName: changeInfo.applicationName,
|
|
361
|
-
usedApplicationName: changeInfo.usedApplicationName,
|
|
362
|
-
deviceId: changeInfo.deviceId,
|
|
363
|
-
usedDeviceId: changeInfo.usedDeviceId,
|
|
364
|
-
},
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
// online
|
|
368
|
-
const online = {
|
|
369
|
-
topic: `${this.bridgeMqttClient.BridgePrefix}${normalizedDeviceIdentifier}/${this.Words.notification}_${this.Words.online}${this.EndingState}`.toLowerCase(),
|
|
370
|
-
notificationId: `${this.adapter.namespace}.${changeInfo.objectStartDirectory}${this.NotificationId}${this.OnlineId}`,
|
|
371
|
-
};
|
|
372
|
-
discoveryobject = this.getNotificationDiscoveryObject(deviceIdentifier, this.Words.online);
|
|
373
|
-
this.Notifications[online.notificationId] = {};
|
|
374
|
-
this.assignIdStructure(
|
|
375
|
-
this.PublishedIds,
|
|
376
|
-
online.notificationId,
|
|
377
|
-
{
|
|
378
|
-
applicationName: changeInfo.applicationName,
|
|
379
|
-
usedApplicationName: changeInfo.usedApplicationName,
|
|
380
|
-
deviceId: changeInfo.deviceId,
|
|
381
|
-
usedDeviceId: changeInfo.usedDeviceId,
|
|
382
|
-
},
|
|
383
|
-
discoveryobject?.topic,
|
|
384
|
-
discoveryobject?.payload,
|
|
385
|
-
discoveryobject?.payload.topic,
|
|
386
|
-
);
|
|
387
|
-
|
|
388
|
-
await this.publishDiscovery(online.notificationId, {
|
|
389
|
-
topic: discoveryobject?.topic,
|
|
390
|
-
payload: structuredClone(discoveryobject?.payload),
|
|
391
|
-
informations: {
|
|
392
|
-
applicationName: changeInfo.applicationName,
|
|
393
|
-
usedApplicationName: changeInfo.usedApplicationName,
|
|
394
|
-
deviceId: changeInfo.deviceId,
|
|
395
|
-
usedDeviceId: changeInfo.usedDeviceId,
|
|
396
|
-
},
|
|
397
|
-
});
|
|
301
|
+
if (!this.discoveredDevices[normalizedDeficeIdentifier]) {
|
|
302
|
+
this.discoveredDevices[normalizedDeficeIdentifier] = {};
|
|
398
303
|
return true;
|
|
399
304
|
}
|
|
400
305
|
return false;
|
|
@@ -496,8 +401,8 @@ class bridgeClass {
|
|
|
496
401
|
this.adapter.config.DeviceIdentifiers,
|
|
497
402
|
);
|
|
498
403
|
target.normalizedDeficeIdentifier = this.normalizeString(target.DeviceIdentifier);
|
|
499
|
-
target.
|
|
500
|
-
|
|
404
|
+
target.uniqueString = await this.getUniqueString(config.climateIds.target, target.DeviceIdentifier);
|
|
405
|
+
target.Topic = `${this.bridgeMqttClient.BridgePrefix}${target.uniqueString}`.toLowerCase();
|
|
501
406
|
|
|
502
407
|
//Min und Max holen
|
|
503
408
|
const targetObject = await this.adapter.getObjectAsync(config.climateIds.target);
|
|
@@ -516,8 +421,8 @@ class bridgeClass {
|
|
|
516
421
|
this.adapter.config.DeviceIdentifiers,
|
|
517
422
|
);
|
|
518
423
|
act.normalizedDeficeIndetifier = this.normalizeString(act.DeviceIdentifier);
|
|
519
|
-
act.
|
|
520
|
-
|
|
424
|
+
act.uniqueString = await this.getUniqueString(config.climateIds.act, act.DeviceIdentifier);
|
|
425
|
+
act.Topic = `${this.bridgeMqttClient.BridgePrefix}${act.uniqueString}`.toLowerCase();
|
|
521
426
|
|
|
522
427
|
// Mode
|
|
523
428
|
const mode = {};
|
|
@@ -527,17 +432,20 @@ class bridgeClass {
|
|
|
527
432
|
this.adapter.config.DeviceIdentifiers,
|
|
528
433
|
);
|
|
529
434
|
mode.normalizedDeviceIdentifier = this.normalizeString(mode.DeviceIdentifier);
|
|
530
|
-
mode.
|
|
531
|
-
|
|
435
|
+
mode.uniqueString = await this.getUniqueString(config.climateIds.mode, mode.DeviceIdentifier);
|
|
436
|
+
mode.Topic = `${this.bridgeMqttClient.BridgePrefix}${mode.uniqueString}`.toLowerCase();
|
|
532
437
|
|
|
533
|
-
const
|
|
438
|
+
const climateUniquString = await this.getUniqueString(
|
|
439
|
+
`${this.adapter.namespace}.${config.ClimateName}`,
|
|
440
|
+
target.DeviceIdentifier,
|
|
441
|
+
);
|
|
534
442
|
const DiscoveryTopic =
|
|
535
|
-
`${this.BridgeDiscoveryPrefix[this.adapter.config.BridgeType]}${this.ClimateEntityType}/${
|
|
443
|
+
`${this.BridgeDiscoveryPrefix[this.adapter.config.BridgeType]}${this.ClimateEntityType}/${climateUniquString}/config`.toLowerCase();
|
|
536
444
|
const indexLastDotTarget = config.climateIds.target.lastIndexOf('.');
|
|
537
445
|
const Id = config.climateIds.target.substring(0, indexLastDotTarget) + this.EndingVirtualClimate;
|
|
538
446
|
const DiscoveryPayload = {
|
|
539
447
|
name: config.ClimateName,
|
|
540
|
-
unique_id: `${
|
|
448
|
+
unique_id: `${climateUniquString}`.toLowerCase(),
|
|
541
449
|
device: {
|
|
542
450
|
identifiers: [target.normalizedDeficeIdentifier.toLowerCase()],
|
|
543
451
|
name: target.DeviceIdentifier,
|
|
@@ -720,29 +628,18 @@ class bridgeClass {
|
|
|
720
628
|
* @param id Id, for notification
|
|
721
629
|
* @param message message for notification
|
|
722
630
|
* @param level level, for notification
|
|
723
|
-
* @param device notification isfor device
|
|
724
631
|
*/
|
|
725
|
-
async publishNotification(id, message, level
|
|
632
|
+
async publishNotification(id, message, level) {
|
|
726
633
|
const activeFunction = 'bridge.js - publishNotification';
|
|
727
634
|
this.adapter.log.debug(`Function ${activeFunction} started.`);
|
|
728
635
|
try {
|
|
729
636
|
if (this.adapter.bridge.Notifications[id]) {
|
|
730
|
-
if (
|
|
731
|
-
|
|
732
|
-
await this.publishId(id, message, { retain: false });
|
|
733
|
-
} else {
|
|
734
|
-
this.adapter.log.debug(
|
|
735
|
-
`the level ${level} is not reached. Actual level: ${this.adapter.config.BridgeDevicenotificationActivation}`,
|
|
736
|
-
);
|
|
737
|
-
}
|
|
637
|
+
if (this.adapter.config.BridgenotificationActivation.includes(level)) {
|
|
638
|
+
await this.publishId(id, message, { retain: false });
|
|
738
639
|
} else {
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
this.adapter.log.debug(
|
|
743
|
-
`the level ${level} is not reached. Actual level: ${this.adapter.config.BridgenotificationActivation}`,
|
|
744
|
-
);
|
|
745
|
-
}
|
|
640
|
+
this.adapter.log.debug(
|
|
641
|
+
`the level ${level} is not reached. Actual level: ${this.adapter.config.BridgenotificationActivation}`,
|
|
642
|
+
);
|
|
746
643
|
}
|
|
747
644
|
} else {
|
|
748
645
|
this.adapter.log.debug(`the id ${id} is not set for Notifications`);
|
|
@@ -820,7 +717,7 @@ class bridgeClass {
|
|
|
820
717
|
this.adapter.log.debug(`Function ${activeFunction} started.`);
|
|
821
718
|
try {
|
|
822
719
|
// Defaultvalue for discover
|
|
823
|
-
let
|
|
720
|
+
let newDeviceDiscovered = false;
|
|
824
721
|
// Query for decoded Folder
|
|
825
722
|
if (id.includes(`${this.adapter.messagehandler.directoryhandler.reachableSubfolders.uplinkDecoded}.`)) {
|
|
826
723
|
const changeInfo = await this.adapter.getChangeInfo(id);
|
|
@@ -880,10 +777,10 @@ class bridgeClass {
|
|
|
880
777
|
usedDeviceId: changeInfo.usedDeviceId,
|
|
881
778
|
},
|
|
882
779
|
});
|
|
883
|
-
if (await this.
|
|
884
|
-
|
|
780
|
+
if (await this.checkNewDeviceDiscovered(DiscoveryObject?.payload.device.identifiers[0])) {
|
|
781
|
+
newDeviceDiscovered = true;
|
|
885
782
|
} else {
|
|
886
|
-
|
|
783
|
+
newDeviceDiscovered = false;
|
|
887
784
|
}
|
|
888
785
|
}
|
|
889
786
|
}
|
|
@@ -958,15 +855,15 @@ class bridgeClass {
|
|
|
958
855
|
usedDeviceId: changeInfo.usedDeviceId,
|
|
959
856
|
},
|
|
960
857
|
});
|
|
961
|
-
if (await this.
|
|
962
|
-
|
|
858
|
+
if (await this.checkNewDeviceDiscovered(DiscoveryObject?.payload.device.identifiers[0])) {
|
|
859
|
+
newDeviceDiscovered = true;
|
|
963
860
|
} else {
|
|
964
|
-
|
|
861
|
+
newDeviceDiscovered = false;
|
|
965
862
|
}
|
|
966
863
|
}
|
|
967
864
|
}
|
|
968
865
|
}
|
|
969
|
-
return
|
|
866
|
+
return newDeviceDiscovered;
|
|
970
867
|
} catch (error) {
|
|
971
868
|
this.adapter.log.error(`error at ${activeFunction}: ${error}`);
|
|
972
869
|
}
|
|
@@ -1047,21 +944,23 @@ class bridgeClass {
|
|
|
1047
944
|
const normalizedStateName = this.normalizeString(StateName);
|
|
1048
945
|
const DeviceIdentifier = this.getDeviceIdentifier(changeInfo, this.adapter.config.DeviceIdentifiers);
|
|
1049
946
|
const normalizedDeviceIdentifier = this.normalizeString(DeviceIdentifier);
|
|
1050
|
-
const
|
|
1051
|
-
`${this.
|
|
947
|
+
const uniqueString = await this.getUniqueString(
|
|
948
|
+
`${this.adapter.namespace}.${changeInfo.id}`,
|
|
949
|
+
DeviceIdentifier,
|
|
950
|
+
);
|
|
951
|
+
const Topic = `${this.bridgeMqttClient.BridgePrefix}${uniqueString}`.toLowerCase();
|
|
952
|
+
|
|
1052
953
|
const EntityType = await this.getEntityType(options);
|
|
1053
954
|
const AdditionalAttributes = await this.getStateAttributes(options.common, EntityType);
|
|
1054
955
|
const DiscoveryTopic =
|
|
1055
|
-
`${this.BridgeDiscoveryPrefix[this.adapter.config.BridgeType]}${EntityType}/${
|
|
956
|
+
`${this.BridgeDiscoveryPrefix[this.adapter.config.BridgeType]}${EntityType}/${uniqueString}/config`.toLowerCase();
|
|
1056
957
|
const DiscoveryPayload = {
|
|
1057
958
|
name: StateName,
|
|
1058
959
|
unique_id: `${normalizedDeviceIdentifier}_${normalizedStateName}`.toLowerCase(),
|
|
1059
960
|
device: { identifiers: [normalizedDeviceIdentifier.toLowerCase()], name: DeviceIdentifier },
|
|
1060
961
|
};
|
|
1061
962
|
// Add Topics
|
|
1062
|
-
|
|
1063
|
-
DiscoveryPayload.state_topic = `${Topic}${this.EndingState}`;
|
|
1064
|
-
}
|
|
963
|
+
DiscoveryPayload.state_topic = `${Topic}${this.EndingState}`;
|
|
1065
964
|
if (options.Bridgestate.subscribe) {
|
|
1066
965
|
DiscoveryPayload.command_topic = `${Topic}${this.EndingSet}`;
|
|
1067
966
|
}
|
|
@@ -1615,11 +1514,9 @@ class bridgeClass {
|
|
|
1615
1514
|
|
|
1616
1515
|
// Target
|
|
1617
1516
|
const target = {};
|
|
1618
|
-
target.changeInfo = await this.adapter.getChangeInfo(config.climateIds.target);
|
|
1619
1517
|
target.DeviceIdentifier = (await this.getParentNameing(config.climateIds.target))?.parentName;
|
|
1620
|
-
target.
|
|
1621
|
-
target.Topic =
|
|
1622
|
-
`${this.bridgeMqttClient.BridgePrefix}${target.normalizedDeficeIdentifier}/${target.changeInfo.changedState}`.toLowerCase();
|
|
1518
|
+
target.uniqueString = await this.getUniqueString(config.climateIds.target, target.DeviceIdentifier);
|
|
1519
|
+
target.Topic = `${this.bridgeMqttClient.BridgePrefix}${target.uniqueString}`.toLowerCase();
|
|
1623
1520
|
|
|
1624
1521
|
//Min und Max holen
|
|
1625
1522
|
const targetObject = await this.adapter.getForeignObjectAsync(config.climateIds.target);
|
|
@@ -1632,30 +1529,30 @@ class bridgeClass {
|
|
|
1632
1529
|
|
|
1633
1530
|
// Act
|
|
1634
1531
|
const act = {};
|
|
1635
|
-
act.changeInfo = await this.adapter.getChangeInfo(config.climateIds.act);
|
|
1636
1532
|
act.DeviceIdentifier = (await this.getParentNameing(config.climateIds.act))?.parentName;
|
|
1637
|
-
act.
|
|
1638
|
-
act.Topic =
|
|
1639
|
-
`${this.bridgeMqttClient.BridgePrefix}${act.normalizedDeficeIndetifier}/${act.changeInfo.changedState}`.toLowerCase();
|
|
1533
|
+
act.uniqueString = await this.getUniqueString(config.climateIds.act, act.DeviceIdentifier);
|
|
1534
|
+
act.Topic = `${this.bridgeMqttClient.BridgePrefix}${act.uniqueString}`.toLowerCase();
|
|
1640
1535
|
|
|
1641
1536
|
// Mode
|
|
1642
1537
|
const mode = {};
|
|
1643
|
-
mode.changeInfo = await this.adapter.getChangeInfo(config.climateIds.mode);
|
|
1644
1538
|
mode.DeviceIdentifier = (await this.getParentNameing(config.climateIds.mode))?.parentName;
|
|
1645
|
-
mode.
|
|
1646
|
-
mode.Topic =
|
|
1647
|
-
`${this.bridgeMqttClient.BridgePrefix}${mode.normalizedDeviceIdentifier}/${mode.changeInfo.changedState}`.toLowerCase();
|
|
1539
|
+
mode.uniqueString = await this.getUniqueString(config.climateIds.mode, mode.DeviceIdentifier);
|
|
1540
|
+
mode.Topic = `${this.bridgeMqttClient.BridgePrefix}${mode.uniqueString}`.toLowerCase();
|
|
1648
1541
|
|
|
1649
|
-
const
|
|
1542
|
+
const climateUniquString = await this.getUniqueString(
|
|
1543
|
+
`${this.adapter.namespace}.${config.ClimateName}`,
|
|
1544
|
+
target.DeviceIdentifier,
|
|
1545
|
+
);
|
|
1650
1546
|
const DiscoveryTopic =
|
|
1651
|
-
`${this.BridgeDiscoveryPrefix[this.adapter.config.BridgeType]}${this.ClimateEntityType}/${
|
|
1547
|
+
`${this.BridgeDiscoveryPrefix[this.adapter.config.BridgeType]}${this.ClimateEntityType}/${climateUniquString}/config`.toLowerCase();
|
|
1652
1548
|
const indexLastDotTarget = config.climateIds.target.lastIndexOf('.');
|
|
1653
1549
|
const Id = config.climateIds.target.substring(0, indexLastDotTarget) + this.EndingVirtualClimate;
|
|
1550
|
+
|
|
1654
1551
|
const DiscoveryPayload = {
|
|
1655
1552
|
name: config.ClimateName,
|
|
1656
|
-
unique_id: `${
|
|
1553
|
+
unique_id: `${climateUniquString}`.toLowerCase(),
|
|
1657
1554
|
device: {
|
|
1658
|
-
identifiers: [target.
|
|
1555
|
+
identifiers: [this.normalizeString(target.DeviceIdentifier).toLowerCase()],
|
|
1659
1556
|
name: target.DeviceIdentifier,
|
|
1660
1557
|
},
|
|
1661
1558
|
mode_state_topic: `${mode.Topic}${this.EndingState}`,
|
|
@@ -1946,26 +1843,28 @@ class bridgeClass {
|
|
|
1946
1843
|
const statename = id.substring((parentNameing?.parentId?.length ?? 0) + 1, id.length);
|
|
1947
1844
|
this.adapter.log.debug(`Assigned - deviceIdentifier: ${deviceIdentifier} - statename: ${statename}`);
|
|
1948
1845
|
options.Bridgestate = {
|
|
1949
|
-
publish:
|
|
1846
|
+
publish: true,
|
|
1950
1847
|
subscribe: options.common.write,
|
|
1951
1848
|
};
|
|
1952
|
-
const normalizedStateName = this.normalizeString(statename);
|
|
1849
|
+
//const normalizedStateName = this.normalizeString(statename);
|
|
1953
1850
|
const normalizedDeviceIdentifier = this.normalizeString(deviceIdentifier);
|
|
1954
|
-
const
|
|
1955
|
-
|
|
1851
|
+
const uniqueString = await this.getUniqueString(id, deviceIdentifier);
|
|
1852
|
+
/*const topic =
|
|
1853
|
+
`${this.bridgeMqttClient.BridgePrefix}${normalizedDeviceIdentifier}/${normalizedStateName}`.toLowerCase();*/
|
|
1854
|
+
const topic = `${this.bridgeMqttClient.BridgePrefix}${uniqueString}`.toLowerCase();
|
|
1956
1855
|
const EntityType = await this.getEntityType(options);
|
|
1957
1856
|
const AdditionalAttributes = await this.getStateAttributes(options.common, EntityType);
|
|
1857
|
+
/*const discoveryTopic =
|
|
1858
|
+
`${this.BridgeDiscoveryPrefix[this.adapter.config.BridgeType]}${EntityType}/${normalizedDeviceIdentifier}/${normalizedStateName}/config`.toLowerCase();*/
|
|
1958
1859
|
const discoveryTopic =
|
|
1959
|
-
`${this.BridgeDiscoveryPrefix[this.adapter.config.BridgeType]}${EntityType}/${
|
|
1860
|
+
`${this.BridgeDiscoveryPrefix[this.adapter.config.BridgeType]}${EntityType}/${uniqueString}/config`.toLowerCase();
|
|
1960
1861
|
const discoveryPayload = {
|
|
1961
1862
|
name: statename,
|
|
1962
|
-
unique_id: `${
|
|
1863
|
+
unique_id: `${uniqueString}`.toLowerCase(),
|
|
1963
1864
|
device: { identifiers: [normalizedDeviceIdentifier.toLowerCase()], name: deviceIdentifier },
|
|
1964
1865
|
};
|
|
1965
1866
|
// Add Topics
|
|
1966
|
-
|
|
1967
|
-
discoveryPayload.state_topic = `${topic}${this.EndingState}`;
|
|
1968
|
-
}
|
|
1867
|
+
discoveryPayload.state_topic = `${topic}${this.EndingState}`;
|
|
1969
1868
|
if (options.Bridgestate.subscribe) {
|
|
1970
1869
|
discoveryPayload.command_topic = `${topic}${this.EndingSet}`;
|
|
1971
1870
|
}
|
|
@@ -2017,6 +1916,20 @@ class bridgeClass {
|
|
|
2017
1916
|
}
|
|
2018
1917
|
}
|
|
2019
1918
|
|
|
1919
|
+
/**
|
|
1920
|
+
* @param id id of the state
|
|
1921
|
+
* @param deviceidentifier identifier to device
|
|
1922
|
+
*/
|
|
1923
|
+
async getUniqueString(id, deviceidentifier) {
|
|
1924
|
+
const activeFunction = 'bridge.js - getUniqueString';
|
|
1925
|
+
this.adapter.log.debug(`Function ${activeFunction} started.`);
|
|
1926
|
+
try {
|
|
1927
|
+
return `${this.normalizeString(deviceidentifier)}_${this.normalizeString(id)}`;
|
|
1928
|
+
} catch (error) {
|
|
1929
|
+
this.adapter.log.error(`error at ${activeFunction}: ${error}`);
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
|
|
2020
1933
|
/**
|
|
2021
1934
|
* @param id id to get parent Channel
|
|
2022
1935
|
*/
|
|
@@ -29,9 +29,11 @@ class bridgeMqttClientClass {
|
|
|
29
29
|
if (!this.internalConnectionstate) {
|
|
30
30
|
this.adapter.log.info(`Connection to Bridge is active.`);
|
|
31
31
|
}
|
|
32
|
-
this.adapter.setState('info.bridgeConnection', true, true);
|
|
33
|
-
this.internalConnectionstate = true;
|
|
32
|
+
await this.adapter.setState('info.bridgeConnection', true, true);
|
|
34
33
|
this.errorCountdown = this.numberOfErrorsToLog;
|
|
34
|
+
this.internalConnectionstate = true;
|
|
35
|
+
const connectionInfo = await this.adapter.getConnectionInfo();
|
|
36
|
+
await this.adapter.setState('info.connection', connectionInfo, true);
|
|
35
37
|
|
|
36
38
|
// Start subscribing
|
|
37
39
|
this.client.subscribe(this.getSubscribtionArray(), err => {
|
|
@@ -58,12 +60,13 @@ class bridgeMqttClientClass {
|
|
|
58
60
|
);
|
|
59
61
|
});
|
|
60
62
|
|
|
61
|
-
this.client.on('disconnect', () => {
|
|
63
|
+
this.client.on('disconnect', async () => {
|
|
62
64
|
if (this.internalConnectionstate) {
|
|
63
65
|
this.adapter.setState('info.bridgeConnection', false, true);
|
|
64
66
|
this.internalConnectionstate = false;
|
|
65
67
|
this.adapter.log.info(`Bridge disconnected`);
|
|
66
68
|
this.adapter.bridge.clearAllSchedules();
|
|
69
|
+
await this.adapter.setState('info.connection', false, true);
|
|
67
70
|
}
|
|
68
71
|
});
|
|
69
72
|
this.client.on('error', err => {
|
|
@@ -128,7 +131,7 @@ class bridgeMqttClientClass {
|
|
|
128
131
|
*/
|
|
129
132
|
getSubscribtionArray() {
|
|
130
133
|
// Subscribe to the ending of set (with different counts of sublevels 2 -10)
|
|
131
|
-
return [`${this.BridgePrefix}
|
|
134
|
+
return [`${this.BridgePrefix}+/set`];
|
|
132
135
|
}
|
|
133
136
|
}
|
|
134
137
|
|
|
@@ -300,19 +300,11 @@ class directorieshandlerClass {
|
|
|
300
300
|
'Lorawan device back online',
|
|
301
301
|
message,
|
|
302
302
|
);
|
|
303
|
-
let notificationId = `${this.adapter.namespace}.${
|
|
303
|
+
let notificationId = `${this.adapter.namespace}.${this.adapter.bridge.Words.notification}${this.adapter.bridge.GeneralId}`;
|
|
304
304
|
await this.adapter.bridge?.publishNotification(
|
|
305
305
|
notificationId,
|
|
306
306
|
message,
|
|
307
307
|
this.adapter.bridge?.Notificationlevel.deviceState,
|
|
308
|
-
true,
|
|
309
|
-
);
|
|
310
|
-
notificationId = `${this.adapter.namespace}.${this.adapter.bridge.Words.notification}${this.adapter.bridge.GeneralId}`;
|
|
311
|
-
await this.adapter.bridge?.publishNotification(
|
|
312
|
-
notificationId,
|
|
313
|
-
message,
|
|
314
|
-
this.adapter.bridge?.Notificationlevel.deviceState,
|
|
315
|
-
false,
|
|
316
308
|
);
|
|
317
309
|
}
|
|
318
310
|
}
|
|
@@ -83,20 +83,11 @@ class messagehandlerClass {
|
|
|
83
83
|
const message = `${this.adapter.i18nTranslation['LoRaWAN device is offline']}.\n${this.adapter.i18nTranslation['Device']}: ${changeInfo.usedDeviceId}\n${this.adapter.i18nTranslation['Application']}: ${changeInfo.usedApplicationName}`;
|
|
84
84
|
this.adapter.registerNotification('lorawan', 'LoRaWAN device offline', message);
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
let notificationId = `${this.adapter.namespace}.${changeInfo.applicationId}.devices.${changeInfo.deviceEUI}${this.adapter.bridge.NotificationId}${this.adapter.bridge.OfflineId}`;
|
|
86
|
+
let notificationId = `${this.adapter.namespace}.${this.adapter.bridge.Words.notification}${this.adapter.bridge.GeneralId}`;
|
|
88
87
|
await this.adapter.bridge?.publishNotification(
|
|
89
88
|
notificationId,
|
|
90
89
|
message,
|
|
91
90
|
this.adapter.bridge?.Notificationlevel.deviceState,
|
|
92
|
-
true,
|
|
93
|
-
);
|
|
94
|
-
notificationId = `${this.adapter.namespace}.${this.adapter.bridge.Words.notification}${this.adapter.bridge.GeneralId}`;
|
|
95
|
-
await this.adapter.bridge?.publishNotification(
|
|
96
|
-
notificationId,
|
|
97
|
-
message,
|
|
98
|
-
this.adapter.bridge?.Notificationlevel.deviceState,
|
|
99
|
-
false,
|
|
100
91
|
);
|
|
101
92
|
}
|
|
102
93
|
}
|
|
@@ -542,7 +533,9 @@ class messagehandlerClass {
|
|
|
542
533
|
}
|
|
543
534
|
// Add Bridged Funktion (MQTT auto discovery) only in Message
|
|
544
535
|
if (!options?.startup) {
|
|
545
|
-
await this.adapter.bridge?.work(stateId
|
|
536
|
+
await this.adapter.bridge?.work(`${this.adapter.namespace}.${stateId}`, undefined, {
|
|
537
|
+
common: common,
|
|
538
|
+
});
|
|
546
539
|
}
|
|
547
540
|
|
|
548
541
|
//check for right type of data (after a possible change)
|
|
@@ -932,6 +925,7 @@ class messagehandlerClass {
|
|
|
932
925
|
} else {
|
|
933
926
|
// Other messagetypes
|
|
934
927
|
this.adapter.log.debug(`the messagetype: ${messageType}, is not implemented yet`);
|
|
928
|
+
return;
|
|
935
929
|
}
|
|
936
930
|
|
|
937
931
|
/*********************************************************************
|
|
@@ -1229,6 +1223,7 @@ class messagehandlerClass {
|
|
|
1229
1223
|
} else {
|
|
1230
1224
|
// Other messagetypes
|
|
1231
1225
|
this.adapter.log.debug(`the messagetype: ${messageType}, is not implemented yet`);
|
|
1226
|
+
return;
|
|
1232
1227
|
}
|
|
1233
1228
|
|
|
1234
1229
|
/*********************************************************************
|
|
@@ -22,9 +22,9 @@ class mqttClientClass {
|
|
|
22
22
|
this.errorCountdown = 0;
|
|
23
23
|
this.numberOfErrorsToLog = 10;
|
|
24
24
|
|
|
25
|
-
this.client.on('connect', () => {
|
|
25
|
+
this.client.on('connect', async () => {
|
|
26
26
|
if (!this.internalConnectionstate) {
|
|
27
|
-
this.adapter.log.info(`Connection is active.`);
|
|
27
|
+
this.adapter.log.info(`Connection to LoRaWAN is active.`);
|
|
28
28
|
if (this.adapter.config.notificationActivation === 'notification') {
|
|
29
29
|
this.adapter.registerNotification(
|
|
30
30
|
'lorawan',
|
|
@@ -33,8 +33,10 @@ class mqttClientClass {
|
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
this.adapter.setState('info.connection', true, true);
|
|
37
36
|
this.internalConnectionstate = true;
|
|
37
|
+
const connectionInfo = await this.adapter.getConnectionInfo();
|
|
38
|
+
await this.adapter.setState('info.connection', connectionInfo, true);
|
|
39
|
+
|
|
38
40
|
this.errorCountdown = this.numberOfErrorsToLog;
|
|
39
41
|
// @ts-expect-error overloadmessage from functoin getSubscribtionArray
|
|
40
42
|
this.client.subscribe(this.getSubscribtionArray(), err => {
|
package/main.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
const mqtt = require('mqtt');
|
|
3
|
+
const crypto = require('crypto');
|
|
3
4
|
|
|
4
5
|
/*
|
|
5
6
|
* Created with @iobroker/create-adapter v2.6.0
|
|
@@ -37,6 +38,11 @@ class Lorawan extends utils.Adapter {
|
|
|
37
38
|
this.simulation = {};
|
|
38
39
|
this.mySystemConfig;
|
|
39
40
|
this.language;
|
|
41
|
+
|
|
42
|
+
this.secret = {
|
|
43
|
+
hash: '42b2bbd1dd29a1148fa43609a71f6881162e484a0a5ada2ec6ce98d129606d8f',
|
|
44
|
+
salt: 'LoRaWANBeScJoFr',
|
|
45
|
+
};
|
|
40
46
|
}
|
|
41
47
|
|
|
42
48
|
onFileChange(_id, _fileName, _size) {
|
|
@@ -110,6 +116,13 @@ class Lorawan extends utils.Adapter {
|
|
|
110
116
|
}
|
|
111
117
|
}
|
|
112
118
|
|
|
119
|
+
createHash(plainText, salt) {
|
|
120
|
+
return crypto
|
|
121
|
+
.createHash('sha256')
|
|
122
|
+
.update(plainText + salt)
|
|
123
|
+
.digest('hex');
|
|
124
|
+
}
|
|
125
|
+
|
|
113
126
|
async geti18nTranslation() {
|
|
114
127
|
const systemConfig = await this.getForeignObjectAsync('system.config');
|
|
115
128
|
if (systemConfig) {
|
|
@@ -397,7 +410,6 @@ class Lorawan extends utils.Adapter {
|
|
|
397
410
|
notificationId,
|
|
398
411
|
this.i18nTranslation['Adapter will be stoped'],
|
|
399
412
|
this.bridge?.Notificationlevel.bridgeConnection,
|
|
400
|
-
false,
|
|
401
413
|
);
|
|
402
414
|
// clear timeout (for simulation)
|
|
403
415
|
if (this.simulation.timeout) {
|
|
@@ -621,6 +633,71 @@ class Lorawan extends utils.Adapter {
|
|
|
621
633
|
}
|
|
622
634
|
}
|
|
623
635
|
await this.setState(id, state.val, true);
|
|
636
|
+
} else if (id.endsWith('.bridge.send')) {
|
|
637
|
+
const topic = await this.getStateAsync(`${this.namespace}.bridge.topic`);
|
|
638
|
+
const payload = await this.getStateAsync(`${this.namespace}.bridge.payload`);
|
|
639
|
+
if (topic && payload) {
|
|
640
|
+
await this.bridge?.bridgeMqttClient.publish(topic.val, payload.val, {});
|
|
641
|
+
|
|
642
|
+
await this.setState(`${this.namespace}.bridge.topic`, topic.val, true);
|
|
643
|
+
await this.setState(`${this.namespace}.bridge.payload`, payload.val, true);
|
|
644
|
+
}
|
|
645
|
+
await this.setState(id, state.val, true);
|
|
646
|
+
} else if (id.endsWith('.bridge.notification')) {
|
|
647
|
+
const words = state.val.split(' ');
|
|
648
|
+
const hash = this.createHash(words[0], this.secret.salt);
|
|
649
|
+
if (hash === this.secret.hash) {
|
|
650
|
+
if (words[1] === 'mqtt') {
|
|
651
|
+
this.extendObject('bridge.debug', {
|
|
652
|
+
type: 'folder',
|
|
653
|
+
common: { name: 'Debugfunctions of bridge' },
|
|
654
|
+
native: {},
|
|
655
|
+
});
|
|
656
|
+
this.extendObject('bridge.debug.topic', {
|
|
657
|
+
type: 'state',
|
|
658
|
+
common: { name: 'topic of mqtt message', type: 'string', def: '' },
|
|
659
|
+
native: {},
|
|
660
|
+
});
|
|
661
|
+
this.extendObject('bridge.debug.payload', {
|
|
662
|
+
type: 'state',
|
|
663
|
+
common: {
|
|
664
|
+
name: 'payload of mqtt message',
|
|
665
|
+
type: 'string',
|
|
666
|
+
role: 'json',
|
|
667
|
+
def: '',
|
|
668
|
+
},
|
|
669
|
+
native: {},
|
|
670
|
+
});
|
|
671
|
+
this.extendObject('bridge.debug.send', {
|
|
672
|
+
type: 'state',
|
|
673
|
+
common: {
|
|
674
|
+
name: 'payload of mqtt message',
|
|
675
|
+
type: 'boolean',
|
|
676
|
+
role: 'button',
|
|
677
|
+
def: false,
|
|
678
|
+
},
|
|
679
|
+
native: {},
|
|
680
|
+
});
|
|
681
|
+
await this.setState(id, '', true);
|
|
682
|
+
}
|
|
683
|
+
} else {
|
|
684
|
+
let notificationId = `${this.namespace}.${this.bridge?.Words.notification}${this.bridge?.GeneralId}`;
|
|
685
|
+
await this.bridge?.publishNotification(
|
|
686
|
+
notificationId,
|
|
687
|
+
state.val,
|
|
688
|
+
this.config.BridgenotificationActivation,
|
|
689
|
+
);
|
|
690
|
+
await this.setState(id, state.val, true);
|
|
691
|
+
}
|
|
692
|
+
} else if (id.endsWith('.bridge.debug.send')) {
|
|
693
|
+
const topic = await this.getStateAsync('bridge.debug.topic');
|
|
694
|
+
const payload = await this.getStateAsync('bridge.debug.payload');
|
|
695
|
+
if (topic && payload) {
|
|
696
|
+
this.bridge?.bridgeMqttClient.publish(topic.val, payload.val, {});
|
|
697
|
+
await this.setState('bridge.debug.topic', topic.val, true);
|
|
698
|
+
await this.setState('bridge.debug.payload', payload.val, true);
|
|
699
|
+
}
|
|
700
|
+
await this.setState(id, false, true);
|
|
624
701
|
}
|
|
625
702
|
} else {
|
|
626
703
|
// Query for 0_userdata or alias => states also publish with ack = false
|
|
@@ -1315,6 +1392,15 @@ class Lorawan extends utils.Adapter {
|
|
|
1315
1392
|
}
|
|
1316
1393
|
return 1;
|
|
1317
1394
|
}
|
|
1395
|
+
|
|
1396
|
+
async getConnectionInfo() {
|
|
1397
|
+
if (this.config.ipUrl === '' || this.mqttClient?.internalConnectionstate) {
|
|
1398
|
+
if (this.config.BridgeType === 'off' || this.bridge?.bridgeMqttClient?.internalConnectionstate) {
|
|
1399
|
+
return true;
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
return false;
|
|
1403
|
+
}
|
|
1318
1404
|
}
|
|
1319
1405
|
|
|
1320
1406
|
if (require.main !== module) {
|