iobroker.lorawan 1.18.34 → 1.18.36

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 CHANGED
@@ -23,6 +23,14 @@ 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.18.36 (2025-11-29)
27
+ * (BenAhrdt) fist possibillity to change unlatch on lock entity
28
+ * (BenAhrdt) Add version to discovery
29
+ * (BenAhrdt) Add via device to discovery
30
+
31
+ ### 1.18.35 (2025-11-28)
32
+ * (BenAhrdt) internal code improovment for better reading
33
+
26
34
  ### 1.18.34 (2025-11-28)
27
35
  * (BenAhrdt) translation changed
28
36
 
@@ -133,6 +133,8 @@
133
133
  "applicationId": "Applikations Id",
134
134
  "applicationName": "Applikationsname",
135
135
  "bridge connection": "Verbindungsbenachrichtigungen",
136
+ "commandForOpen": "Befehl zum Öffnen des Schlosses",
137
+ "commandForOpenTooltip": "Trage Sie den Befehl ein, der das Schloss öffnet",
136
138
  "confirmed": "bestätigt",
137
139
  "confirmedTooltip": "Wenn Sie den Download mit einer bestätigten Nachricht senden möchten, aktivieren Sie diese Option",
138
140
  "connection to bridge is activ": "Die Verbindung zur Bridge ist aktiv",
@@ -239,5 +239,7 @@
239
239
  "StateText": "State ID",
240
240
  "LockLockText": "Lock ID",
241
241
  "LockUnlockText": "Unlock ID",
242
- "LockOpenText": "Open ID"
242
+ "LockOpenText": "Open ID",
243
+ "commandForOpen": "command to open the lock",
244
+ "commandForOpenTooltip": "set the command, that opens the lock"
243
245
  }
@@ -133,6 +133,8 @@
133
133
  "applicationId": "ID de la aplicación",
134
134
  "applicationName": "Nombre de la aplicación",
135
135
  "bridge connection": "notificaciones de conexión",
136
+ "commandForOpen": "comando para abrir la cerradura",
137
+ "commandForOpenTooltip": "configurar el comando que abre la cerradura",
136
138
  "confirmed": "confirmado",
137
139
  "confirmedTooltip": "si desea enviar la descarga con mensaje confirmado habilite esta opción",
138
140
  "connection to bridge is activ": "la conexión al puente está activa",
@@ -133,6 +133,8 @@
133
133
  "applicationId": "Identifiant de l'application",
134
134
  "applicationName": "Nom de la demande",
135
135
  "bridge connection": "notifications de connexion",
136
+ "commandForOpen": "commande pour ouvrir la serrure",
137
+ "commandForOpenTooltip": "définir la commande qui ouvre le verrou",
136
138
  "confirmed": "confirmé",
137
139
  "confirmedTooltip": "si vous souhaitez envoyer le téléchargement avec un message confirmé, activez cette option",
138
140
  "connection to bridge is activ": "la connexion au pont est active",
@@ -133,6 +133,8 @@
133
133
  "applicationId": "ID applicazione",
134
134
  "applicationName": "Nome dell'applicazione",
135
135
  "bridge connection": "notifiche di connessione",
136
+ "commandForOpen": "comando per aprire la serratura",
137
+ "commandForOpenTooltip": "impostare il comando che apre la serratura",
136
138
  "confirmed": "confermato",
137
139
  "confirmedTooltip": "se desideri inviare il download con messaggio di conferma abilita questa opzione",
138
140
  "connection to bridge is activ": "la connessione al bridge è attiva",
@@ -133,6 +133,8 @@
133
133
  "applicationId": "Applicatie-ID",
134
134
  "applicationName": "Applicatienaam",
135
135
  "bridge connection": "verbindingsmeldingen",
136
+ "commandForOpen": "commando om het slot te openen",
137
+ "commandForOpenTooltip": "stel het commando in, waarmee het slot wordt geopend",
136
138
  "confirmed": "bevestigd",
137
139
  "confirmedTooltip": "Als u de download met een bevestigd bericht wilt verzenden, schakelt u deze optie in",
138
140
  "connection to bridge is activ": "verbinding met brug is actief",
@@ -133,6 +133,8 @@
133
133
  "applicationId": "Identyfikator aplikacji",
134
134
  "applicationName": "Nazwa aplikacji",
135
135
  "bridge connection": "powiadomienia o połączeniu",
136
+ "commandForOpen": "polecenie otwarcia zamka",
137
+ "commandForOpenTooltip": "ustaw komendę otwierającą zamek",
136
138
  "confirmed": "potwierdzony",
137
139
  "confirmedTooltip": "jeśli chcesz wysłać plik do pobrania z potwierdzeniem, włącz tę opcję",
138
140
  "connection to bridge is activ": "połączenie z mostem jest aktywne",
@@ -133,6 +133,8 @@
133
133
  "applicationId": "ID do aplicativo",
134
134
  "applicationName": "Nome do aplicativo",
135
135
  "bridge connection": "notificações de conexão",
136
+ "commandForOpen": "comando para abrir a fechadura",
137
+ "commandForOpenTooltip": "defina o comando que abre a fechadura",
136
138
  "confirmed": "confirmado",
137
139
  "confirmedTooltip": "se quiser enviar o download com mensagem confirmada habilite esta opção",
138
140
  "connection to bridge is activ": "a conexão com a ponte está ativa",
@@ -133,6 +133,8 @@
133
133
  "applicationId": "Идентификатор приложения",
134
134
  "applicationName": "Имя приложения",
135
135
  "bridge connection": "уведомления о подключении",
136
+ "commandForOpen": "команда открытия замка",
137
+ "commandForOpenTooltip": "задать команду, открывающую замок",
136
138
  "confirmed": "подтвержденный",
137
139
  "confirmedTooltip": "если вы хотите отправить загрузку с подтвержденным сообщением, включите эту опцию",
138
140
  "connection to bridge is activ": "соединение с мостом активно",
@@ -133,6 +133,8 @@
133
133
  "applicationId": "Ідентифікатор програми",
134
134
  "applicationName": "Назва програми",
135
135
  "bridge connection": "сповіщення про підключення",
136
+ "commandForOpen": "команда відкрити замок",
137
+ "commandForOpenTooltip": "встановити команду, яка відкриває замок",
136
138
  "confirmed": "підтверджено",
137
139
  "confirmedTooltip": "якщо ви хочете надіслати завантаження з підтвердженим повідомленням, увімкніть цю опцію",
138
140
  "connection to bridge is activ": "підключення до мосту активовано",
@@ -133,6 +133,8 @@
133
133
  "applicationId": "应用程序 ID",
134
134
  "applicationName": "应用名称",
135
135
  "bridge connection": "连接通知",
136
+ "commandForOpen": "打开锁的命令",
137
+ "commandForOpenTooltip": "设置打开锁的命令",
136
138
  "confirmed": "确认的",
137
139
  "confirmedTooltip": "如果您想发送带有确认消息的下载,请启用此选项",
138
140
  "connection to bridge is activ": "与网桥的连接已激活",
@@ -2263,6 +2263,25 @@
2263
2263
  "md": 4,
2264
2264
  "lg": 4,
2265
2265
  "xl": 4
2266
+ },
2267
+ {
2268
+ "newLine": true,
2269
+ "type": "autocomplete",
2270
+ "attr": "commandForOpen",
2271
+ "label": "commandForOpen",
2272
+ "options": [{"value": "unlatch", "label": "unlatch (Nuki)"},
2273
+ {"value": "open", "label": "open (Standard)"},
2274
+ {"value": "pull", "label": "pull (Something else)"}],
2275
+ "tooltip": "commandForOpenTooltip",
2276
+ "default": "unlatch",
2277
+ "validator": "if(data.commandForOpen === ''){return false;}else{return true;}",
2278
+ "validatorNoSaveOnError": true,
2279
+ "freeSolo": true,
2280
+ "xs": 12,
2281
+ "sm": 2,
2282
+ "md": 2,
2283
+ "lg": 2,
2284
+ "xl": 2
2266
2285
  }
2267
2286
  ]
2268
2287
  }
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "lorawan",
4
- "version": "1.18.34",
4
+ "version": "1.18.36",
5
5
  "news": {
6
+ "1.18.36": {
7
+ "en": "fist possibillity to change unlatch on lock entity\nAdd version to discovery\nAdd via device to discovery",
8
+ "de": "fist possibillity zu ändern unlatch auf schloss entity\nVersion zur Entdeckung hinzufügen\nÜber das Gerät zur Entdeckung hinzufügen",
9
+ "ru": "fist possibillity - изменить unlatch на lock entity\nДобавить версию к Discovery\nДобавить через устройство к открытию",
10
+ "pt": "possibilidade do punho para mudar a desacoplamento na entidade de bloqueio\nAdicionar versão à descoberta\nAdicionar via dispositivo à descoberta",
11
+ "nl": "fist mogelijkheid om unlatch te veranderen op slot entiteit\nVersie toevoegen aan ontdekking\nVoeg via apparaat toe aan ontdekking",
12
+ "fr": "possibillity du poing pour changer le déblocage sur l'entité de verrouillage\nAjouter une version à la découverte\nAjouter via périphérique à la découverte",
13
+ "it": "possibilità di cambiare unlatch su entità di blocco\nAggiungere la versione alla scoperta\nAggiungere tramite dispositivo alla scoperta",
14
+ "es": "fist possibillity to change unlatch on lock entity\nAñadir versión al descubrimiento\nAñadir vía dispositivo al descubrimiento",
15
+ "pl": "fist possibilty to change unlatch on lock entity\nDodaj wersję do odkrycia\nDodaj przez urządzenie do odkrycia",
16
+ "uk": "fist possibillity змінити unlatch на суб'єкті блокування\nДодати версію для відкриття\nДодати через пристрій для відкриття",
17
+ "zh-cn": "在锁实体上更改未匹配的拳头特性\n在发现中添加版本\n通过设备添加到发现"
18
+ },
19
+ "1.18.35": {
20
+ "en": "internal code improovment for better reading",
21
+ "de": "interner code improovement für besseres lesen",
22
+ "ru": "импровизация внутреннего кода для лучшего чтения",
23
+ "pt": "improvisação de código interno para melhor leitura",
24
+ "nl": "interne code improvisatie voor beter lezen",
25
+ "fr": "imprégnation du code interne pour une meilleure lecture",
26
+ "it": "codice interno improovment per una migliore lettura",
27
+ "es": "improvimento de código interno para una mejor lectura",
28
+ "pl": "improwizacja kodu wewnętrznego dla lepszego czytania",
29
+ "uk": "внутрішня обробка коду для кращого читання",
30
+ "zh-cn": "内部代码即兴读取"
31
+ },
6
32
  "1.18.34": {
7
33
  "en": "translation changed",
8
34
  "de": "übersetzung geändert",
@@ -67,32 +93,6 @@
67
93
  "pl": "ustawienie danych Wymiana na 2 entitie (FromIob & Tolob)",
68
94
  "uk": "налаштування даних Обмін до 2 entitie (З альбомуIob & ToIob)",
69
95
  "zh-cn": "设置数据 交换到2个内置( FromIob & ToIob)"
70
- },
71
- "1.18.29": {
72
- "en": "set ack = true, before push dataExchange",
73
- "de": "ack = true, bevor Sie Daten drücken Wechselkurs",
74
- "ru": "set ack = true, перед push-данными обмен",
75
- "pt": "definir ack = true, antes de empurrar dados Bolsa",
76
- "nl": "set ack = true, voor push data Beurs",
77
- "fr": "set ack = true, avant de pousser les données Échange",
78
- "it": "set ack = true, prima di spingere i dati Scambi",
79
- "es": "set ack = true, antes de presionar datos Cambio",
80
- "pl": "set ack = true, przed push data Giełda",
81
- "uk": "встановити ack = true, перш ніж натиснути дані Обмін",
82
- "zh-cn": "在按下数据前设置 ack = true 交换"
83
- },
84
- "1.18.28": {
85
- "en": "assign comment 'from bridge' to state, if the value is set by bridge",
86
- "de": "kommentar 'von der brücke' zum zustand zuordnen, wenn der wert von der brücke gesetzt wird",
87
- "ru": "присвоить комментарий «от моста» государству, если значение установлено мостом",
88
- "pt": "atribuir o comentário 'da ponte' ao estado, se o valor for definido pela ponte",
89
- "nl": "commentaar 'van brug' toewijzen aan status, als de waarde door brug wordt ingesteld",
90
- "fr": "assigner le commentaire 'from bridge' à l'état, si la valeur est définie par bridge",
91
- "it": "assegnare commento 'da ponte' a stato, se il valore è impostato da ponte",
92
- "es": "asignar comentario 'de puente' a estado, si el valor se establece por puente",
93
- "pl": "przypisz komentarz \"z mostu\" do stanu, jeśli wartość jest ustawiona przez most",
94
- "uk": "призначте коментар «з місту» до держави, якщо значення встановлене містом",
95
- "zh-cn": "如果值由桥来设定, 则将注释“ 从桥” 指定为状态"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -221,6 +221,8 @@ class bridgeClass {
221
221
  await this.publishId(this.SubscribedTopics[topic].id, message, {});
222
222
  return;
223
223
  }
224
+
225
+ // Light
224
226
  if (this.SubscribedTopics[topic].light) {
225
227
  if (message.state) {
226
228
  message.state = message.state === 'ON' ? true : false;
@@ -253,6 +255,8 @@ class bridgeClass {
253
255
  }
254
256
  return;
255
257
  }
258
+
259
+ // Cover
256
260
  if (this.SubscribedTopics[topic].cover) {
257
261
  if (this.SubscribedTopics[topic].messageAssign) {
258
262
  if (this.SubscribedTopics[topic].messageAssign[message]) {
@@ -265,6 +269,8 @@ class bridgeClass {
265
269
  }
266
270
  }
267
271
  }
272
+
273
+ // Lock
268
274
  if (this.SubscribedTopics[topic].lock) {
269
275
  if (this.SubscribedTopics[topic].messageAssign) {
270
276
  if (this.SubscribedTopics[topic].messageAssign[message]) {
@@ -280,6 +286,7 @@ class bridgeClass {
280
286
 
281
287
  // Check for namespace and write own, oder foreign state
282
288
  if (this.SubscribedTopics[topic].id.startsWith(this.adapter.namespace)) {
289
+ // Special DataExchange
283
290
  if (this.SubscribedTopics[topic].dataExchange) {
284
291
  if (typeof message === 'object') {
285
292
  message = JSON.stringify(message);
@@ -289,15 +296,19 @@ class bridgeClass {
289
296
  { val: message, c: 'from bridge' },
290
297
  true,
291
298
  );
299
+ // All Adapter internal States
292
300
  } else {
293
301
  await this.adapter.setState(this.SubscribedTopics[topic].id, {
294
302
  val: message,
295
303
  c: 'from bridge',
296
304
  });
297
305
  }
306
+ // Foreign States
298
307
  } else {
308
+ // Assignable Topics => id & val
299
309
  if (this.SubscribedTopics[topic].messageAssign) {
300
310
  await this.adapter.setForeignStateAsync(message.id, { val: message.val, c: 'from bridge' });
311
+ // Write in the desired id
301
312
  } else {
302
313
  await this.adapter.setForeignStateAsync(this.SubscribedTopics[topic].id, {
303
314
  val: message,
@@ -795,59 +806,49 @@ class bridgeClass {
795
806
  }
796
807
 
797
808
  // Iterate the state_topics
798
- for (const publishTopic in this.PublishedIds[id].publish) {
799
- if (this.PublishedIds[id].publish[publishTopic].light) {
809
+ for (const element in this.PublishedIds[id].publish) {
810
+ const topic = element;
811
+ const publish = this.PublishedIds[id].publish[element];
812
+
813
+ // Light
814
+ if (publish.light) {
800
815
  val = {};
801
- val.state = (
802
- await this.adapter.getForeignStateAsync(
803
- this.PublishedIds[id].publish[publishTopic].LightIds.onOff,
804
- )
805
- ).val;
816
+ val.state = (await this.adapter.getForeignStateAsync(publish.LightIds.onOff)).val;
806
817
  val.state = val.state === true ? 'ON' : 'OFF';
807
- if (this.PublishedIds[id].publish[publishTopic].LightIds.brightness) {
808
- val.brightness = (
809
- await this.adapter.getForeignStateAsync(
810
- this.PublishedIds[id].publish[publishTopic].LightIds.brightness,
811
- )
812
- ).val;
818
+ if (publish.LightIds.brightness) {
819
+ val.brightness = (await this.adapter.getForeignStateAsync(publish.LightIds.brightness)).val;
813
820
  }
814
- if (this.PublishedIds[id].publish[publishTopic].LightIds.color) {
821
+ if (publish.LightIds.color) {
815
822
  val.color_mode = 'rgb';
816
823
  val.color = this.hexToRgb(
817
- (
818
- await this.adapter.getForeignStateAsync(
819
- this.PublishedIds[id].publish[publishTopic].LightIds.color,
820
- )
821
- ).val,
824
+ (await this.adapter.getForeignStateAsync(publish.LightIds.color)).val,
822
825
  );
823
826
  }
824
- if (this.PublishedIds[id].publish[publishTopic].LightIds.effects) {
825
- const effect = (
826
- await this.adapter.getForeignStateAsync(
827
- this.PublishedIds[id].publish[publishTopic].LightIds.effects,
828
- )
829
- ).val;
827
+ if (publish.LightIds.effects) {
828
+ const effect = (await this.adapter.getForeignStateAsync(publish.LightIds.effects)).val;
830
829
  val.effect = '';
831
- if (this.PublishedIds[id].publish[publishTopic].effects[effect]) {
832
- val.effect = this.PublishedIds[id].publish[publishTopic].effects[effect];
830
+ if (publish.effects[effect]) {
831
+ val.effect = publish.effects[effect];
833
832
  }
834
833
  }
835
834
  }
836
835
 
837
- if (this.PublishedIds[id].publish[publishTopic].cover) {
838
- if (this.PublishedIds[id].publish[publishTopic].messageAssign) {
839
- if (this.PublishedIds[id].publish[publishTopic].messageAssign[val]) {
840
- val = this.PublishedIds[id].publish[publishTopic].messageAssign[val];
836
+ // Cover
837
+ if (publish.cover) {
838
+ if (publish.messageAssign) {
839
+ if (publish.messageAssign[val]) {
840
+ val = publish.messageAssign[val];
841
841
  } else {
842
842
  return;
843
843
  }
844
844
  }
845
845
  }
846
846
 
847
- if (this.PublishedIds[id].publish[publishTopic].lock) {
848
- if (this.PublishedIds[id].publish[publishTopic].messageAssign) {
849
- if (this.PublishedIds[id].publish[publishTopic].messageAssign[val]) {
850
- val = this.PublishedIds[id].publish[publishTopic].messageAssign[val];
847
+ // Lock
848
+ if (publish.lock) {
849
+ if (publish.messageAssign) {
850
+ if (publish.messageAssign[val]) {
851
+ val = publish.messageAssign[val];
851
852
  } else {
852
853
  return;
853
854
  }
@@ -855,23 +856,21 @@ class bridgeClass {
855
856
  }
856
857
 
857
858
  // safe old values (5 last values)
858
- if (this.PublishedIds[id].publish[publishTopic].values) {
859
- if (!this.PublishedIds[id].publish[publishTopic].oldValues) {
860
- this.PublishedIds[id].publish[publishTopic].oldValues = [];
859
+ if (publish.values) {
860
+ if (!publish.oldValues) {
861
+ publish.oldValues = [];
861
862
  }
862
- if (this.PublishedIds[id].publish[publishTopic].oldValues.length >= this.MaxValueCount) {
863
- this.PublishedIds[id].publish[publishTopic].oldValues.pop();
863
+ if (publish.oldValues.length >= this.MaxValueCount) {
864
+ publish.oldValues.pop();
864
865
  }
865
- this.PublishedIds[id].publish[publishTopic].oldValues.unshift(
866
- structuredClone(this.PublishedIds[id].publish[publishTopic].values),
867
- );
866
+ publish.oldValues.unshift(structuredClone(publish.values));
868
867
  }
869
- if (!this.PublishedIds[id].publish[publishTopic].values) {
870
- this.PublishedIds[id].publish[publishTopic].values = {};
868
+ if (!publish.values) {
869
+ publish.values = {};
871
870
  }
872
- this.PublishedIds[id].publish[publishTopic].values.val = val;
873
- this.PublishedIds[id].publish[publishTopic].values.ts = Date.now();
874
- this.PublishedIds[id].publish[publishTopic].values.time = new Date(Date.now()).toLocaleString(
871
+ publish.values.val = val;
872
+ publish.values.ts = Date.now();
873
+ publish.values.time = new Date(Date.now()).toLocaleString(
875
874
  this.Timeoutput.Argument,
876
875
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
877
876
  // @ts-expect-error
@@ -885,7 +884,7 @@ class bridgeClass {
885
884
  } else if (options.retain === undefined) {
886
885
  options.retain = true;
887
886
  }
888
- await this.bridgeMqttClient.publish(publishTopic, val, options);
887
+ await this.bridgeMqttClient.publish(topic, val, options);
889
888
  await this.adapter.setState('info.publishedIds', JSON.stringify(this.PublishedIds), true);
890
889
  }
891
890
 
@@ -1304,16 +1303,21 @@ class bridgeClass {
1304
1303
  if (typeof DiscoveryObject.payload !== 'string') {
1305
1304
  // Payload is not empty => discover
1306
1305
  const normalizedDeficeIdentifier = DiscoveryObject.payload.device.identifiers[0];
1306
+
1307
+ // add via Device in case, there is no attribute
1308
+ if (!DiscoveryObject.payload.device.via_device) {
1309
+ DiscoveryObject.payload.device.via_device = this.normalizeString(this.adapter.namespace);
1310
+ }
1311
+ // Add Version
1312
+ DiscoveryObject.payload.device.sw_version = this.adapter.version;
1313
+
1307
1314
  // New Device
1308
1315
  if (!this.discoveredDevices[normalizedDeficeIdentifier]) {
1309
1316
  this.discoveredDevices[normalizedDeficeIdentifier] = {};
1310
1317
  if (!this.oldDiscoveredDevices[normalizedDeficeIdentifier]) {
1311
1318
  // Only messegae with ne fiscovered dewvice, if not in old discovered devices
1312
1319
  returnValue.newDevice = DiscoveryObject;
1313
- let device =
1314
- DiscoveryObject.informations.usedDeviceId ??
1315
- DiscoveryObject.informations[0]?.usedDeviceId ??
1316
- 'unknown';
1320
+ let device = DiscoveryObject.payload.device.name;
1317
1321
  let message = `${this.adapter.i18nTranslation['new device discovered']}.\n${this.adapter.i18nTranslation['Device']}: ${device}`;
1318
1322
  if (DiscoveryObject.informations.usedApplicationName) {
1319
1323
  const application = DiscoveryObject.informations.usedApplicationName;
@@ -3055,7 +3059,7 @@ class bridgeClass {
3055
3059
  Lock.command = {};
3056
3060
  setAssign.LOCK = { id: config.LockIds.command, val: 'lock' };
3057
3061
  setAssign.UNLOCK = { id: config.LockIds.command, val: 'unlock' };
3058
- setAssign.OPEN = { id: config.LockIds.command, val: 'unlatch' };
3062
+ setAssign.OPEN = { id: config.LockIds.command, val: config.commandForOpen };
3059
3063
  Lock.command.DeviceIdentifier = (await this.getParentNameing(config.LockIds.command))?.parentName;
3060
3064
  }
3061
3065
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.lorawan",
3
- "version": "1.18.34",
3
+ "version": "1.18.36",
4
4
  "description": "converts the desired lora gateway data to a ioBroker structure",
5
5
  "author": {
6
6
  "name": "BenAhrdt",