iobroker.lorawan 1.18.27 → 1.18.29

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,12 @@ For now there is documentation in English here: https://wiki.hafenmeister.de
23
23
  Placeholder for the next version (at the beginning of the line):
24
24
  ### **WORK IN PROGRESS**
25
25
  -->
26
+ ### 1.18.29 (2025-11-27)
27
+ * (BenAhrdt) set ack = true, before push dataExchange
28
+
29
+ ### 1.18.28 (2025-11-27)
30
+ * (BenAhrdt) assign comment 'from bridge' to state, if the value is set by bridge
31
+
26
32
  ### 1.18.27 (2025-11-27)
27
33
  * (BenAhrdt) wright incomming dataexchange with ack = true
28
34
 
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "lorawan",
4
- "version": "1.18.27",
4
+ "version": "1.18.29",
5
5
  "news": {
6
+ "1.18.29": {
7
+ "en": "set ack = true, before push dataExchange",
8
+ "de": "ack = true, bevor Sie Daten drücken Wechselkurs",
9
+ "ru": "set ack = true, перед push-данными обмен",
10
+ "pt": "definir ack = true, antes de empurrar dados Bolsa",
11
+ "nl": "set ack = true, voor push data Beurs",
12
+ "fr": "set ack = true, avant de pousser les données Échange",
13
+ "it": "set ack = true, prima di spingere i dati Scambi",
14
+ "es": "set ack = true, antes de presionar datos Cambio",
15
+ "pl": "set ack = true, przed push data Giełda",
16
+ "uk": "встановити ack = true, перш ніж натиснути дані Обмін",
17
+ "zh-cn": "在按下数据前设置 ack = true 交换"
18
+ },
19
+ "1.18.28": {
20
+ "en": "assign comment 'from bridge' to state, if the value is set by bridge",
21
+ "de": "kommentar 'von der brücke' zum zustand zuordnen, wenn der wert von der brücke gesetzt wird",
22
+ "ru": "присвоить комментарий «от моста» государству, если значение установлено мостом",
23
+ "pt": "atribuir o comentário 'da ponte' ao estado, se o valor for definido pela ponte",
24
+ "nl": "commentaar 'van brug' toewijzen aan status, als de waarde door brug wordt ingesteld",
25
+ "fr": "assigner le commentaire 'from bridge' à l'état, si la valeur est définie par bridge",
26
+ "it": "assegnare commento 'da ponte' a stato, se il valore è impostato da ponte",
27
+ "es": "asignar comentario 'de puente' a estado, si el valor se establece por puente",
28
+ "pl": "przypisz komentarz \"z mostu\" do stanu, jeśli wartość jest ustawiona przez most",
29
+ "uk": "призначте коментар «з місту» до держави, якщо значення встановлене містом",
30
+ "zh-cn": "如果值由桥来设定, 则将注释“ 从桥” 指定为状态"
31
+ },
6
32
  "1.18.27": {
7
33
  "en": "wright incomming dataexchange with ack = true",
8
34
  "de": "wright incoming dataexchange mit ack = true",
@@ -67,32 +93,6 @@
67
93
  "pl": "Informuj wersję adaptera do mostka z połączeniem",
68
94
  "uk": "Повідомити версію адаптера до мосту з підключенням",
69
95
  "zh-cn": "将适配器版本通知连接桥"
70
- },
71
- "1.18.22": {
72
- "en": "Bugfix message to brige with discovered device",
73
- "de": "Bugfix-Nachricht zu brige mit entdecktem Gerät",
74
- "ru": "Сообщение Bugfix с обнаруженным устройством",
75
- "pt": "Mensagem de correção de erros para o brige com o dispositivo descoberto",
76
- "nl": "Bugfix-bericht naar Brugge met ontdekt apparaat",
77
- "fr": "Message de bogue pour bricker avec le périphérique découvert",
78
- "it": "Messaggio di Bugfix a brige con dispositivo scoperto",
79
- "es": "Mensaje de Bugfix para cerrar con dispositivo descubierto",
80
- "pl": "Komunikat Bugfix do przepłukiwania z odkrytym urządzeniem",
81
- "uk": "Повідомлень про помилку при відкритті пристрою",
82
- "zh-cn": "用已发现的设备绑定错误修正消息"
83
- },
84
- "1.18.21": {
85
- "en": "Bugfix reading value for light in puslish",
86
- "de": "Bugfix Lesewert für Licht in puslish",
87
- "ru": "Bugfix значение чтения для света в puslish",
88
- "pt": "Valor de leitura de erros para a luz em puslish",
89
- "nl": "Bugfix leeswaarde voor licht in het Nederlands",
90
- "fr": "Valeur de lecture Bugfix pour la lumière en puslish",
91
- "it": "Bugfix valore di lettura per la luce in inglese",
92
- "es": "Valor de lectura de Bugfix para luz en puslish",
93
- "pl": "Wartość odczytu bugfix dla światła w pussish",
94
- "uk": "Помилки для читання значення для світла в puslish",
95
- "zh-cn": "Puslish 中的光线错误修正读值"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -222,33 +222,39 @@ class bridgeClass {
222
222
  if (this.SubscribedTopics[topic].light) {
223
223
  if (message.state) {
224
224
  message.state = message.state === 'ON' ? true : false;
225
- await this.adapter.setForeignStateAsync(
226
- this.SubscribedTopics[topic].LightIds.onOff,
227
- message.state,
228
- );
225
+ await this.adapter.setForeignStateAsync(this.SubscribedTopics[topic].LightIds.onOff, {
226
+ val: message.state,
227
+ c: 'from bridge',
228
+ });
229
229
  }
230
230
  if (message.brightness) {
231
- await this.adapter.setForeignStateAsync(
232
- this.SubscribedTopics[topic].LightIds.brightness,
233
- message.brightness,
234
- );
231
+ await this.adapter.setForeignStateAsync(this.SubscribedTopics[topic].LightIds.brightness, {
232
+ val: message.brightness,
233
+ c: 'from bridge',
234
+ });
235
235
  }
236
236
  if (message.color) {
237
237
  const color = this.rgbToHex(message.color);
238
- await this.adapter.setForeignStateAsync(this.SubscribedTopics[topic].LightIds.color, color);
238
+ await this.adapter.setForeignStateAsync(this.SubscribedTopics[topic].LightIds.color, {
239
+ val: color,
240
+ c: 'from bridge',
241
+ });
239
242
  }
240
243
  if (message.effect) {
241
244
  const effect = this.SubscribedTopics[topic].effects[message.effect]
242
245
  ? this.SubscribedTopics[topic].effects[message.effect]
243
246
  : '';
244
- await this.adapter.setForeignStateAsync(this.SubscribedTopics[topic].LightIds.effects, effect);
247
+ await this.adapter.setForeignStateAsync(this.SubscribedTopics[topic].LightIds.effects, {
248
+ val: effect,
249
+ c: 'from bridge',
250
+ });
245
251
  }
246
252
  return;
247
253
  }
248
254
  if (this.SubscribedTopics[topic].cover) {
249
- if (this.SubscribedTopics[topic].message) {
250
- if (this.SubscribedTopics[topic].message[message]) {
251
- message = this.SubscribedTopics[topic].message[message];
255
+ if (this.SubscribedTopics[topic].messageAssign) {
256
+ if (this.SubscribedTopics[topic].messageAssign[message]) {
257
+ message = this.SubscribedTopics[topic].messageAssign[message];
252
258
  } else {
253
259
  this.adapter.log.warn(
254
260
  `Incomming Message: ${message} at topic: ${topic} can not be found in possible values.`,
@@ -264,18 +270,32 @@ class bridgeClass {
264
270
  if (typeof message === 'object') {
265
271
  message = JSON.stringify(message);
266
272
  }
267
- await this.adapter.setState(this.SubscribedTopics[topic].id, message, true);
273
+ await this.adapter.setState(
274
+ this.SubscribedTopics[topic].id,
275
+ { val: message, c: 'from bridge' },
276
+ true,
277
+ );
268
278
  } else {
269
- await this.adapter.setState(this.SubscribedTopics[topic].id, message);
279
+ await this.adapter.setState(this.SubscribedTopics[topic].id, {
280
+ val: message,
281
+ c: 'from bridge',
282
+ });
270
283
  }
271
284
  } else {
272
- if (this.SubscribedTopics[topic].message) {
273
- await this.adapter.setForeignStateAsync(message.id, message.val);
285
+ if (this.SubscribedTopics[topic].messageAssign) {
286
+ await this.adapter.setForeignStateAsync(message.id, { val: message.val, c: 'from bridge' });
274
287
  } else {
275
- await this.adapter.setForeignStateAsync(this.SubscribedTopics[topic].id, message);
288
+ await this.adapter.setForeignStateAsync(this.SubscribedTopics[topic].id, {
289
+ val: message,
290
+ c: 'from bridge',
291
+ });
276
292
  }
277
293
  }
278
- await this.adapter.setState('info.subscribedTopics', JSON.stringify(this.SubscribedTopics), true);
294
+ await this.adapter.setState(
295
+ 'info.subscribedTopics',
296
+ { val: JSON.stringify(this.SubscribedTopics), c: 'from bridge' },
297
+ true,
298
+ );
279
299
  } else {
280
300
  this.adapter.log.debug(`The received Topic ${topic} is not subscribed`);
281
301
  }
@@ -801,9 +821,9 @@ class bridgeClass {
801
821
  }
802
822
 
803
823
  if (this.PublishedIds[id].publish[publishTopic].cover) {
804
- if (this.PublishedIds[id].publish[publishTopic].message) {
805
- if (this.PublishedIds[id].publish[publishTopic].message[val]) {
806
- val = this.PublishedIds[id].publish[publishTopic].message[val];
824
+ if (this.PublishedIds[id].publish[publishTopic].messageAssign) {
825
+ if (this.PublishedIds[id].publish[publishTopic].messageAssign[val]) {
826
+ val = this.PublishedIds[id].publish[publishTopic].messageAssign[val];
807
827
  } else {
808
828
  val = '';
809
829
  }
@@ -2771,7 +2791,7 @@ class bridgeClass {
2771
2791
  DiscoveryTopic,
2772
2792
  DiscoveryPayload,
2773
2793
  Id,
2774
- { cover: true, command: true, message: setAssign },
2794
+ { cover: true, command: true, messageAssign: setAssign },
2775
2795
  );
2776
2796
 
2777
2797
  // Position
@@ -2801,7 +2821,7 @@ class bridgeClass {
2801
2821
  DiscoveryTopic,
2802
2822
  DiscoveryPayload,
2803
2823
  `${coverTopic}${this.EndingState}`,
2804
- { cover: true, message: { true: 'OPEN' } },
2824
+ { cover: true, messageAssign: { true: 'OPEN' } },
2805
2825
  );
2806
2826
  }
2807
2827
 
@@ -2816,7 +2836,7 @@ class bridgeClass {
2816
2836
  DiscoveryTopic,
2817
2837
  DiscoveryPayload,
2818
2838
  `${coverTopic}${this.EndingState}`,
2819
- { cover: true, message: { true: 'CLOSE' } },
2839
+ { cover: true, messageAssign: { true: 'CLOSE' } },
2820
2840
  );
2821
2841
  }
2822
2842
 
@@ -2831,7 +2851,7 @@ class bridgeClass {
2831
2851
  DiscoveryTopic,
2832
2852
  DiscoveryPayload,
2833
2853
  `${coverTopic}${this.EndingState}`,
2834
- { cover: true, message: { true: 'STOP' } },
2854
+ { cover: true, messageAssign: { true: 'STOP' } },
2835
2855
  );
2836
2856
  }
2837
2857
 
@@ -2878,7 +2898,7 @@ class bridgeClass {
2878
2898
  DiscoveryTopic,
2879
2899
  DiscoveryPayload,
2880
2900
  `${coverTopic}${this.EndingState}`,
2881
- { cover: true, message: { [openKey]: 'open', [closingKey]: 'closing' } },
2901
+ { cover: true, messageAssign: { [openKey]: 'open', [closingKey]: 'closing' } },
2882
2902
  );
2883
2903
  }
2884
2904
 
@@ -2897,7 +2917,7 @@ class bridgeClass {
2897
2917
  `${coverTopic}${this.EndingState}`,
2898
2918
  {
2899
2919
  cover: true,
2900
- message: { [closedKey]: 'closed', [openingKey]: 'opening' },
2920
+ messageAssign: { [closedKey]: 'closed', [openingKey]: 'opening' },
2901
2921
  },
2902
2922
  );
2903
2923
  }
package/main.js CHANGED
@@ -715,8 +715,10 @@ class Lorawan extends utils.Adapter {
715
715
  }
716
716
  await this.setState(id, false, true);
717
717
  } else if (id.endsWith('.bridge.dataExchange')) {
718
- await this.bridge?.publishId(id, state.val, {});
719
- await this.setState(id, state.val, true);
718
+ if (this.bridge) {
719
+ await this.setState(id, state.val, true);
720
+ await this.bridge.publishId(id, state.val, {});
721
+ }
720
722
  }
721
723
  } else {
722
724
  // Query for 0_userdata or alias => states also publish with ack = false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.lorawan",
3
- "version": "1.18.27",
3
+ "version": "1.18.29",
4
4
  "description": "converts the desired lora gateway data to a ioBroker structure",
5
5
  "author": {
6
6
  "name": "BenAhrdt",