iobroker.lorawan 1.17.15 → 1.17.17

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,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.17 (2025-10-04)
27
+ * (BenAhrdt) serialize appending Data on NextSend
28
+ * (BenAhrdt) update assignhandler (SensorTemperature)
29
+
30
+ ### 1.17.16 (2025-09-25)
31
+ * (BenAhrdt) bring state_off topic to humidifier
32
+
26
33
  ### 1.17.15 (2025-09-25)
27
34
  * (BenAhrdt) notifi new discover in case of oldDiscoveredDevices
28
35
  * (BenAhrdt) bugfix debug logging
@@ -663,7 +670,7 @@ For now there is documentation in English here: https://wiki.hafenmeister.de
663
670
  ## License
664
671
  MIT License
665
672
 
666
- Copyright (c) 2025 BenAhrdt <bsahrdt@gmail.com>
673
+ Copyright (c) 2025 BenAhrdt <bsahrdt@gmail.com>
667
674
  Copyright (c) 2025 Joerg Froehner <LoraWan@hafenmeister.com>
668
675
 
669
676
  Permission is hereby granted, free of charge, to any person obtaining a copy
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "lorawan",
4
- "version": "1.17.15",
4
+ "version": "1.17.17",
5
5
  "news": {
6
+ "1.17.17": {
7
+ "en": "serialize appending Data on NextSend\nupdate assignhandler (SensorTemperature)",
8
+ "de": "serialisieren Appending Data auf NextSend\nupdate assignhandler (SensorTemperatur)",
9
+ "ru": "сериализировать добавленные данные в NextSend\nраспределитель обновлений (SensorTemperature)",
10
+ "pt": "serialize anexando dados no NextSend\natualizar assignhandler (SensorTemperature)",
11
+ "nl": "serialiseren toevoegen van gegevens op NextSend\nupdate awardhandler (SensorTemperatuur)",
12
+ "fr": "sérialiser l'ajout de données sur NextSend\nmettre à jour le gestionnaire d'attribution (SensorTemperature)",
13
+ "it": "serializzare i dati di appending su NextSend\naggiornamento assegnatore (SensorTemperature)",
14
+ "es": "serializar los datos pendientes en NextSend\n(SensorTemperature)",
15
+ "pl": "serializuj przypisywanie danych na nextSend\naktualizuj urządzenie sterujące (SensorTemperatura)",
16
+ "uk": "сертифікувати дані додатків на NextSend\nоновлення assignhandler (SensorTemperature)",
17
+ "zh-cn": "序列化下一端的数据\n更新指派手( 传感器)"
18
+ },
19
+ "1.17.16": {
20
+ "en": "bring state_off topic to humidifier",
21
+ "de": "state_off-thema zur befeuchtung bringen",
22
+ "ru": "скачать игру state_off для humidifier",
23
+ "pt": "trazer o tópico state_off para o umidificador",
24
+ "nl": "status_off onderwerp naar bevochtiger brengen",
25
+ "fr": "apporter le sujet état_off à l'humidificateur",
26
+ "it": "portare argomento state_off a umidificatore",
27
+ "es": "traer el tema state_off a humidificador",
28
+ "pl": "przynieść state _ off temat do nawilżacza",
29
+ "uk": "принести стан_вимкнути тему для зволоження",
30
+ "zh-cn": "将状态切换为潮湿器"
31
+ },
6
32
  "1.17.15": {
7
33
  "en": "notifi new discover in case of oldDiscoveredDevices\nbugfix debug logging",
8
34
  "de": "notifi neu entdecken bei oldDiscoveredDevices\nbugfix debug protokollierung",
@@ -67,32 +93,6 @@
67
93
  "pl": "nie wypełniaj Downlinks w przypadku niewdrożonego rodzaju wiadomości\nrodzaj idów json zmienionych na ciąg",
68
94
  "uk": "не заповнити Попередження у разі невиконання типу повідомлення\nтип json ids змінився на рядок",
69
95
  "zh-cn": "不填满 未执行消息类型时的下行链接\n更改为字符串的 json id 类型"
70
- },
71
- "1.17.10": {
72
- "en": "Update topics und qnique ids",
73
- "de": "Update-Themen und qnique ids",
74
- "ru": "Обновление тем und qnique ids",
75
- "pt": "Atualizar tópicos e IDs do qnique",
76
- "nl": "Onderwerpen en qnique-id's bijwerken",
77
- "fr": "Mettre à jour les sujets et les ids qnique",
78
- "it": "Aggiornare gli argomenti und qnique ids",
79
- "es": "Actualizar temas und qnique ids",
80
- "pl": "Aktualizacja tematów i idów qnique",
81
- "uk": "Оновлення тем und qnique ids",
82
- "zh-cn": "更新主题 und qnique ids"
83
- },
84
- "1.17.9": {
85
- "en": "setdefault defiveidentifier for lorawan bridge function to used Device Id",
86
- "de": "Setzen Sie den Standardgerätekennzeichner für die LoRaWAN-Bridge-Funktion auf die Verwendung der Geräte-ID.",
87
- "ru": "Установите идентификатор устройства по умолчанию для функции моста LoRaWAN, чтобы использовать идентификатор устройства.",
88
- "pt": "Defina o identificador padrão do dispositivo para a função de ponte LoRaWAN usando o ID do dispositivo.",
89
- "nl": "Stel standaard apparaatidentificatie in voor LoRaWAN Bridge-functie om het apparaat-ID te gebruiken",
90
- "fr": "Définir l'identifiant par défaut du périphérique pour la fonction de pont LoRaWAN pour utiliser l'identifiant du périphérique.",
91
- "it": "Impostare l'identificatore predefinito del dispositivo per la funzione del ponte LoRaWAN in modo da utilizzare l'ID del dispositivo.",
92
- "es": "Establecer el identificador predeterminado del dispositivo para la función de puente LoRaWAN para usar el ID del dispositivo",
93
- "pl": "Ustaw domyślny identyfikator urządzenia dla funkcji mostka LoRaWAN na użyty identyfikator urządzenia",
94
- "uk": "Встановлено значення за замовчуванням ідентифікатора пристрою для функції моста LoRaWAN на Device Id.",
95
- "zh-cn": "将LoRaWAN桥接功能的setdefault设备标识符设置为使用设备ID。"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -197,6 +197,16 @@ class assignhandlerClass {
197
197
  },
198
198
  },
199
199
  },
200
+ KeepAliveTime: {
201
+ approvedFolders: {
202
+ 'uplink.decoded': {
203
+ assignfunction: this.commonAssign,
204
+ common: {
205
+ unit: 'min',
206
+ },
207
+ },
208
+ },
209
+ },
200
210
  Light: {
201
211
  approvedFolders: {
202
212
  'uplink.decoded': {
@@ -374,6 +384,7 @@ class assignhandlerClass {
374
384
  assignfunction: this.commonAssign,
375
385
  common: {
376
386
  role: 'value.temperature',
387
+ unit: '°C',
377
388
  },
378
389
  },
379
390
  },
@@ -1844,6 +1844,7 @@ class bridgeClass {
1844
1844
  state_topic: `${onOff.Topic}${this.EndingState}`,
1845
1845
  command_topic: `${onOff.Topic}${this.EndingSet}`,
1846
1846
  state_on: 'true',
1847
+ state_off: 'false',
1847
1848
  payload_on: 'true',
1848
1849
  payload_off: 'false',
1849
1850
  min_humidity: target.min ? target.min : 0,
package/main.js CHANGED
@@ -34,6 +34,8 @@ class Lorawan extends utils.Adapter {
34
34
  chirpstack: 'chirpstack',
35
35
  };
36
36
 
37
+ this.NextSendLocks = new Map(); // key -> Promise-chain
38
+
37
39
  // Simulation variables
38
40
  this.simulation = {};
39
41
  this.mySystemConfig;
@@ -765,22 +767,55 @@ class Lorawan extends utils.Adapter {
765
767
  this.log.debug(`Function ${activeFunction} started.`);
766
768
  try {
767
769
  const idFolderNextSend = `${changeInfo.objectStartDirectory}.${this.messagehandler?.directoryhandler.reachableSubfolders.downlinkNextSend}`;
768
- if (
769
- changeInfo.bestMatchForDeviceType &&
770
- this.downlinkConfighandler?.activeDownlinkConfigs[changeInfo.bestMatchForDeviceType].sendWithUplink ===
771
- 'enabled & collect'
772
- ) {
773
- const nextSend = await this.getStateAsync(`${idFolderNextSend}.hex`);
774
- if (nextSend?.val !== '0') {
775
- payloadInHex = nextSend?.val + payloadInHex;
770
+ const stateId = `${idFolderNextSend}.hex`;
771
+
772
+ // Serialize (also simple write without append)
773
+ await this.withLock(this.NextSendLocks, stateId, async () => {
774
+ let toWrite = payloadInHex;
775
+ if (
776
+ changeInfo.bestMatchForDeviceType &&
777
+ this.downlinkConfighandler?.activeDownlinkConfigs?.[changeInfo.bestMatchForDeviceType]
778
+ .sendWithUplink === 'enabled & collect'
779
+ ) {
780
+ const nextSend = await this.getStateAsync(stateId);
781
+ if (nextSend?.val !== '0') {
782
+ toWrite = nextSend?.val + toWrite;
783
+ }
776
784
  }
777
- }
778
- await this.setState(`${idFolderNextSend}.hex`, payloadInHex, true);
785
+ await this.setState(stateId, toWrite, true);
786
+ });
779
787
  } catch (error) {
780
788
  this.log.error(`error at ${activeFunction}: ${error}`);
781
789
  }
782
790
  }
783
791
 
792
+ // Serialize functions
793
+ async withLock(locksMap, key, fn) {
794
+ const activeFunction = 'main.js - withLock';
795
+ this.log.debug(`Function ${activeFunction} started.`);
796
+ const prev = locksMap.get(key) || Promise.resolve();
797
+
798
+ // fn erst starten, wenn prev fertig ist (egal ob ok oder Fehler)
799
+ const next = prev.then(
800
+ () => Promise.resolve().then(fn),
801
+ () => Promise.resolve().then(fn),
802
+ );
803
+
804
+ // stored wartet auf next, fängt aber Fehler intern ab (Kette reißt nicht)
805
+ const stored = next.catch(() => {});
806
+ locksMap.set(key, stored);
807
+
808
+ try {
809
+ // Ergebnis/Fehler an Aufrufer weitergeben
810
+ return await next;
811
+ } finally {
812
+ // vorsichtig aufräumen: nur löschen, wenn kein neuer Job dazwischenkam
813
+ if (locksMap.get(key) === stored) {
814
+ locksMap.delete(key);
815
+ }
816
+ }
817
+ }
818
+
784
819
  async sendDownlink(topic, message, changeInfo) {
785
820
  const activeFunction = 'main.js - sendDownlink';
786
821
  this.log.debug(`Function ${activeFunction} started.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.lorawan",
3
- "version": "1.17.15",
3
+ "version": "1.17.17",
4
4
  "description": "converts the desired lora gateway data to a ioBroker structure",
5
5
  "author": {
6
6
  "name": "BenAhrdt",
@@ -28,7 +28,7 @@
28
28
  "@iobroker/adapter-core": "^3.3.2",
29
29
  "easy-crc": "^1.1.0",
30
30
  "lodash": "^4.17.21",
31
- "mqtt": "^5.14.0",
31
+ "mqtt": "^5.14.1",
32
32
  "node-schedule": "^2.1.1"
33
33
  },
34
34
  "devDependencies": {
@@ -36,13 +36,13 @@
36
36
  "@alcalzone/release-script-plugin-iobroker": "^3.7.2",
37
37
  "@alcalzone/release-script-plugin-license": "^3.7.0",
38
38
  "@alcalzone/release-script-plugin-manual-review": "^3.7.0",
39
- "@iobroker/adapter-dev": "^1.4.0",
40
- "@iobroker/eslint-config": "^2.1.0",
39
+ "@iobroker/adapter-dev": "^1.5.0",
40
+ "@iobroker/eslint-config": "^2.2.0",
41
41
  "@iobroker/testing": "^5.1.1",
42
42
  "@tsconfig/node20": "^20.1.6",
43
43
  "@types/lodash": "^4.17.20",
44
- "@types/node": "^24.3.0",
45
- "typescript": "~5.9.2"
44
+ "@types/node": "^24.6.1",
45
+ "typescript": "~5.9.3"
46
46
  },
47
47
  "main": "main.js",
48
48
  "files": [