iobroker.lorawan 1.20.5 → 1.20.7

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.20.7 (2026-01-25)
27
+ * (BenAhrdt) bugfix correct writing of indicators
28
+
29
+ ### 1.20.6 (2026-01-25)
30
+ * (BenAhrdt) updateing assignhandler und modifying indicators and informations
31
+
26
32
  ### 1.20.5 (2026-01-25)
27
33
  * (BenAhrdt) bugfixing updating object Store with not alowed id
28
34
 
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "lorawan",
4
- "version": "1.20.5",
4
+ "version": "1.20.7",
5
5
  "news": {
6
+ "1.20.7": {
7
+ "en": "bugfix correct writing of indicators",
8
+ "de": "bugfix korrektes schreiben von indikatoren",
9
+ "ru": "bugfix правильное написание индикаторов",
10
+ "pt": "errofix escrita correta de indicadores",
11
+ "nl": "foutfix correct schrijven van indicatoren",
12
+ "fr": "bugfix écriture correcte des indicateurs",
13
+ "it": "bugfix corretto scrittura di indicatori",
14
+ "es": "bugfix correcta escritura de indicadores",
15
+ "pl": "bugfix prawidłowe pisanie wskaźników",
16
+ "uk": "виправлення правильних показників",
17
+ "zh-cn": "错误修正正确的指标写法"
18
+ },
19
+ "1.20.6": {
20
+ "en": "updateing assignhandler und modifying indicators and informations",
21
+ "de": "aktualisierung von assignhandler und änderung von indikatoren und informationen",
22
+ "ru": "обновление цессионера и изменение показателей и информации",
23
+ "pt": "atualização de indicadores e informações de atribuição e modificação",
24
+ "nl": "actualisering van indicatoren en informatie",
25
+ "fr": "mettre à jour les indicateurs et les informations d'attribution et de modification",
26
+ "it": "aggiornamento assegnatore und modifica degli indicatori e delle informazioni",
27
+ "es": "actualización del cedente nod modificando indicadores e informaciones",
28
+ "pl": "aktualizowanie identyfikatorów i modyfikowanie wskaźników i informacji",
29
+ "uk": "оновлення вивіски унд модифікації індикаторів та інформації",
30
+ "zh-cn": "更新指定手控器未修改指标和信息"
31
+ },
6
32
  "1.20.5": {
7
33
  "en": "bugfixing updating object Store with not alowed id",
8
34
  "de": "bugfixing update object Store with not alowed id",
@@ -67,32 +93,6 @@
67
93
  "pl": "menedżer urządzeń bugfix",
68
94
  "uk": "диспетчер пристроїв",
69
95
  "zh-cn": "错误修正设备管理器"
70
- },
71
- "1.20.0": {
72
- "en": "add first Steps of device Manager",
73
- "de": "erste Schritte des Gerätemanagers hinzufügen",
74
- "ru": "добавить первые шаги диспетчера устройств",
75
- "pt": "adicionar os primeiros Passos do Gestor de Dispositivos",
76
- "nl": "eerste stappen van apparaatbeheer toevoegen",
77
- "fr": "ajouter les premières étapes du gestionnaire de périphérique",
78
- "it": "aggiungere i primi passi di Gestione dispositivi",
79
- "es": "añadir los primeros pasos del administrador del dispositivo",
80
- "pl": "dodaj pierwsze kroki menedżera urządzeń",
81
- "uk": "додати перші кроки диспетчера пристроїв",
82
- "zh-cn": "添加设备管理器的第一个步骤"
83
- },
84
- "1.19.34": {
85
- "en": "assign Percent & Liter in assignhandler",
86
- "de": "percent & Liter in assignhandler zuweisen",
87
- "ru": "производитель Percent & Liter",
88
- "pt": "atribuir a percentagem & Liter no atribuidor",
89
- "nl": "procent & Liter toewijzen aan attributen",
90
- "fr": "assigner Pourcentage & Liter dans l'attributhandler",
91
- "it": "assegnare Percent & Liter in assegnatore",
92
- "es": "asignar Percent \" Liter in assignhandler",
93
- "pl": "przypisz Procent i Liter w assignhandler",
94
- "uk": "призначте відсоток & Література в assignhandler",
95
- "zh-cn": "在指定手牌中指定百分数( L)"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -589,7 +589,7 @@
589
589
  "name": "internal logging types",
590
590
  "read": true,
591
591
  "write": true,
592
- "def": "{\"discovery\":false, \"assign\": false, \"messageTo\": false, \"listDevices\": false, \"getStatus\": false}"
592
+ "def": "{\"discovery\":false, \"assign\": false, \"messageTo\": false, \"listDevices\": false, \"getStatus\": false, \"deviceinformation\": false, \"downlinkconfig\": false,}"
593
593
  },
594
594
  "native": {}
595
595
  },
@@ -311,7 +311,7 @@ class assignhandlerClass {
311
311
  'uplink.decoded': {
312
312
  assignfunction: this.commonAssign,
313
313
  common: {
314
- role: 'sensor',
314
+ role: 'sensor.contact',
315
315
  },
316
316
  },
317
317
  },
@@ -321,7 +321,7 @@ class assignhandlerClass {
321
321
  'uplink.decoded': {
322
322
  assignfunction: this.commonAssign,
323
323
  common: {
324
- role: 'sensor.window',
324
+ role: 'sensor.contact',
325
325
  },
326
326
  },
327
327
  },
@@ -29,9 +29,9 @@ class LoRaWANDeviceManagement extends DeviceManagement {
29
29
  id: key,
30
30
  name: value.object.common.name,
31
31
  icon: await this.getIcon(value),
32
- manufacturer: value.checks
33
- ? value.checks.lastUplink
34
- ? new Date(value.checks.lastUplink.state.ts).toLocaleString('de-DE', {
32
+ manufacturer: value.informations
33
+ ? value.informations.lastUplink
34
+ ? new Date(value.informations.lastUplink.state.ts).toLocaleString('de-DE', {
35
35
  weekday: 'short', // Mo
36
36
  year: 'numeric', // 2026
37
37
  month: '2-digit', // 01
@@ -42,9 +42,9 @@ class LoRaWANDeviceManagement extends DeviceManagement {
42
42
  })
43
43
  : undefined
44
44
  : undefined,
45
- model: value.checks ? value.checks.devicetype.state.val : undefined, // - ${value.uplink.remaining.rxInfo[0].rssi.ts}`,
45
+ model: value.informations ? value.informations.devicetype.state.val : undefined, // - ${value.uplink.remaining.rxInfo[0].rssi.ts}`,
46
46
  status: await this.getStatus(value),
47
- hasDetails: undefined,
47
+ hasDetails: false,
48
48
  actions: [
49
49
  {
50
50
  id: 'rename',
@@ -87,11 +87,11 @@ class LoRaWANDeviceManagement extends DeviceManagement {
87
87
  status.connection = 'disconnected';
88
88
  } else {
89
89
  status.connection = 'connected';
90
- if (devicevalue.checks.rssi) {
91
- status.rssi = devicevalue.checks.rssi.state.val;
90
+ if (devicevalue.informations.rssi) {
91
+ status.rssi = devicevalue.informations.rssi.state.val;
92
92
  }
93
- if (devicevalue.checks.batteryPercent) {
94
- status.battery = devicevalue.checks.batteryPercent.state.val ?? undefined;
93
+ if (devicevalue.informations.batteryPercent) {
94
+ status.battery = devicevalue.informations.batteryPercent.state.val ?? undefined;
95
95
  }
96
96
  }
97
97
  return status;
@@ -102,16 +102,16 @@ class LoRaWANDeviceManagement extends DeviceManagement {
102
102
  * @param devicevalue values of device
103
103
  */
104
104
  async getIcon(devicevalue) {
105
- if (devicevalue.checks) {
106
- if (devicevalue.checks.isThermostat) {
105
+ if (devicevalue.indicators) {
106
+ if (devicevalue.indicators.isThermostat) {
107
107
  return 'thermostat';
108
- } else if (devicevalue.checks.isWindow) {
109
- return 'window';
110
- } else if (devicevalue.checks.isDoor) {
108
+ } else if (devicevalue.indicators.isDoor) {
111
109
  return 'door';
110
+ } else if (devicevalue.indicators.isWindow) {
111
+ return 'window';
112
112
  }
113
113
  }
114
- return `/adapter/${this.adapter.name}/icons/Node.png`; //${value.object.common.icon}`,
114
+ return 'node'; //`/adapter/${this.adapter.name}/icons/Node.png`; //${value.object.common.icon}`,
115
115
  }
116
116
 
117
117
  /**
@@ -155,7 +155,7 @@ class downlinkConfighandlerClass {
155
155
  );
156
156
  for (const element of Object.values(metadataOfFiles)) {
157
157
  const filepath = `${this.metafolders.downlink.knownProfiles}${element.file}`;
158
- //delete file from uploadfolder
158
+ //delete file from downloadfolder
159
159
  this.adapter.delFileAsync(this.adapter.namespace, filepath);
160
160
  }
161
161
 
@@ -193,7 +193,7 @@ class downlinkConfighandlerClass {
193
193
  );
194
194
  for (const element of Object.values(metadataOfFiles)) {
195
195
  const filepath = `${this.metafolders.downlink.current}${element.file}`;
196
- //delete file from uploadfolder
196
+ //delete file from downloadfolder
197
197
  this.adapter.delFileAsync(this.adapter.namespace, filepath);
198
198
  }
199
199
 
@@ -185,17 +185,24 @@ class messagehandlerClass {
185
185
  this.adapter.log.silly(`Function ${activeFunction} started.`);
186
186
  try {
187
187
  const adapterObjectsAtStart = await this.adapter.getAdapterObjectsAsync();
188
- this.adapter.log.debug(`Adapter objects at start: ${JSON.stringify(adapterObjectsAtStart)}`);
188
+ // Check for logging
189
+ this.adapter.log[this.adapter.logtypes.deviceinformation]?.(
190
+ `Adapter objects at start: ${JSON.stringify(adapterObjectsAtStart)}`,
191
+ );
189
192
  // Generate Infos of all devices and decoded folders
190
193
  const decodedData = {};
191
194
  for (const adapterObject of Object.values(adapterObjectsAtStart)) {
192
- this.adapter.log.debug(`Check ${adapterObject._id} for state.`);
195
+ // Check for logging
196
+ this.adapter.log[this.adapter.logtypes.deviceinformation]?.(`Check ${adapterObject._id} for state.`);
193
197
  if (adapterObject.type === 'state') {
194
198
  // To became just states no folders
195
199
  if (
196
200
  adapterObject._id.indexOf(`${this.directoryhandler.reachableSubfolders.uplinkDecoded}.`) !== -1
197
201
  ) {
198
- this.adapter.log.debug(`${adapterObject._id} will be added to deviceinformation.`);
202
+ // Check for logging
203
+ this.adapter.log[this.adapter.logtypes.deviceinformation]?.(
204
+ `${adapterObject._id} will be added to deviceinformation.`,
205
+ );
199
206
 
200
207
  const decodedState = await this.adapter.getStateAsync(adapterObject._id);
201
208
  const changeInfo = await this.adapter.getChangeInfo(adapterObject._id);
@@ -430,7 +437,8 @@ class messagehandlerClass {
430
437
  for (const downlinkParameter of Object.values(
431
438
  this.adapter.downlinkConfighandler.activeDownlinkConfigs[downlinkDevice].downlinkState,
432
439
  )) {
433
- this.adapter.log.silly(
440
+ // Check for logging
441
+ this.adapter.log[this.adapter.logtypes.fillWithDownlink]?.(
434
442
  `the downlinkparameter ${JSON.stringify(downlinkParameter)}, will be checked.`,
435
443
  );
436
444
  // check for forbidden states
@@ -511,7 +519,8 @@ class messagehandlerClass {
511
519
  */
512
520
  // Check for assign (new implemented function)
513
521
  if (this.assignhandler.assign[downlinkParameter.name] && !options?.dontAssign) {
514
- this.adapter.log.debug(
522
+ // Check for logging
523
+ this.adapter.log[this.adapter.logtypes.fillWithDownlink]?.(
515
524
  `the state with the id ${stateId} will be assigned by internal assign function`,
516
525
  );
517
526
  this.assignhandler.executeAssign(
@@ -19,20 +19,20 @@ class objectStoreClass {
19
19
 
20
20
  this.rolesToCheck = {
21
21
  'value.battery': {
22
- checkIndicator: 'isBatteryDevice',
23
- assignToDevice: { name: 'batteryPercent', subfolder: '.uplink.decoded' },
22
+ indicator: { name: 'isBatteryDevice', subfolder: '.uplink.decoded' },
23
+ assignToDeviceInformations: { name: 'batteryPercent', subfolder: '.uplink.decoded' },
24
24
  },
25
25
  'level.temperature': {
26
- checkIndicator: { name: 'isThermostat', subfolder: '.downlink.control' },
27
- },
28
- 'sensor.window': {
29
- checkIndicator: { name: 'isWindow', subfolder: '.uplink.decoded' },
26
+ indicator: { name: 'isThermostat', subfolder: '.downlink.control' },
30
27
  },
31
28
  'sensor.door': {
32
- checkIndicator: { name: 'isDoor', subfolder: '.uplink.decoded' },
29
+ indicator: { name: 'isDoor', subfolder: '.uplink.decoded' },
30
+ },
31
+ 'sensor.window': {
32
+ indicator: { name: 'isWindow', subfolder: '.uplink.decoded' },
33
33
  },
34
34
  };
35
- this.assignToDevice = {
35
+ this.assignToDeviceInformations = {
36
36
  rssi: true,
37
37
  devicetype: { name: 'devicetype', subfolder: '.configuration' },
38
38
  json: { name: 'lastUplink', subfolder: '.uplink.raw' },
@@ -105,39 +105,37 @@ class objectStoreClass {
105
105
  let assign = undefined;
106
106
  if (payload.object) {
107
107
  if (Object.hasOwn(this.rolesToCheck, payload.object.common.role)) {
108
- if (!deviceObject[deviceId].checks) {
109
- deviceObject[deviceId].checks = {};
108
+ if (!deviceObject[deviceId].indicators) {
109
+ deviceObject[deviceId].indicators = {};
110
110
  }
111
- if (this.rolesToCheck[payload.object.common.role].checkIndicator) {
112
- if (
113
- typeof this.rolesToCheck[payload.object.common.role].checkIndicator === 'string'
114
- ) {
115
- deviceObject[deviceId].checks[
116
- this.rolesToCheck[payload.object.common.role].checkIndicator
111
+ if (this.rolesToCheck[payload.object.common.role].indicator) {
112
+ if (typeof this.rolesToCheck[payload.object.common.role].indicator === 'string') {
113
+ deviceObject[deviceId].indicators[
114
+ this.rolesToCheck[payload.object.common.role].indicator
117
115
  ] = true;
118
116
  } else if (
119
- typeof this.rolesToCheck[payload.object.common.role].checkIndicator === 'object'
117
+ typeof this.rolesToCheck[payload.object.common.role].indicator === 'object'
120
118
  ) {
121
119
  let name = key;
122
120
  if (
123
- this.rolesToCheck[payload.object.common.role].checkIndicator.subfolder &&
121
+ this.rolesToCheck[payload.object.common.role].indicator.subfolder &&
124
122
  !idWithoutLast.endsWith(
125
- this.rolesToCheck[payload.object.common.role].checkIndicator.subfolder,
123
+ this.rolesToCheck[payload.object.common.role].indicator.subfolder,
126
124
  )
127
125
  ) {
128
126
  continue;
129
127
  }
130
- if (this.rolesToCheck[payload.object.common.role].checkIndicator.name) {
131
- name = this.rolesToCheck[payload.object.common.role].checkIndicator.name;
128
+ if (this.rolesToCheck[payload.object.common.role].indicator.name) {
129
+ name = this.rolesToCheck[payload.object.common.role].indicator.name;
132
130
  }
133
- deviceObject[deviceId].checks[name] = true;
131
+ deviceObject[deviceId].indicators[name] = true;
134
132
  }
135
- deviceObject[deviceId].checks[
136
- this.rolesToCheck[payload.object.common.role].checkIndicator
133
+ deviceObject[deviceId].indicators[
134
+ this.rolesToCheck[payload.object.common.role].indicator
137
135
  ] = true;
138
136
  }
139
- if (this.rolesToCheck[payload.object.common.role].assignToDevice) {
140
- assign = this.rolesToCheck[payload.object.common.role].assignToDevice;
137
+ if (this.rolesToCheck[payload.object.common.role].assignToDeviceInformations) {
138
+ assign = this.rolesToCheck[payload.object.common.role].assignToDeviceInformations;
141
139
  }
142
140
  }
143
141
  }
@@ -151,9 +149,9 @@ class objectStoreClass {
151
149
  }
152
150
  }
153
151
  // Assign to device
154
- if (Object.hasOwn(this.assignToDevice, key) || assign) {
155
- if (!deviceObject[deviceId].checks) {
156
- deviceObject[deviceId].checks = {};
152
+ if (Object.hasOwn(this.assignToDeviceInformations, key) || assign) {
153
+ if (!deviceObject[deviceId].indicators) {
154
+ deviceObject[deviceId].indicators = {};
157
155
  }
158
156
  let name = key;
159
157
  if (assign) {
@@ -167,24 +165,24 @@ class objectStoreClass {
167
165
  name = assign.name;
168
166
  }
169
167
  }
170
- } else if (typeof this.assignToDevice[key] === 'string') {
171
- name = this.assignToDevice[key];
172
- } else if (typeof this.assignToDevice[key] === 'object') {
168
+ } else if (typeof this.assignToDeviceInformations[key] === 'string') {
169
+ name = this.assignToDeviceInformations[key];
170
+ } else if (typeof this.assignToDeviceInformations[key] === 'object') {
173
171
  if (
174
- this.assignToDevice[key].subfolder &&
175
- !idWithoutLast.endsWith(this.assignToDevice[key].subfolder)
172
+ this.assignToDeviceInformations[key].subfolder &&
173
+ !idWithoutLast.endsWith(this.assignToDeviceInformations[key].subfolder)
176
174
  ) {
177
175
  continue;
178
176
  }
179
- if (this.assignToDevice[key].name) {
180
- name = this.assignToDevice[key].name;
177
+ if (this.assignToDeviceInformations[key].name) {
178
+ name = this.assignToDeviceInformations[key].name;
181
179
  }
182
180
  }
183
- if (!deviceObject[deviceId].checks) {
184
- deviceObject[deviceId].checks = {};
181
+ if (!deviceObject[deviceId].informations) {
182
+ deviceObject[deviceId].informations = {};
185
183
  }
186
- if (!deviceObject[deviceId].checks[name]) {
187
- deviceObject[deviceId].checks[name] = node[key];
184
+ if (!deviceObject[deviceId].informations[name]) {
185
+ deviceObject[deviceId].informations[name] = node[key];
188
186
  }
189
187
  }
190
188
  }
package/main.js CHANGED
@@ -127,8 +127,11 @@ class Lorawan extends utils.Adapter {
127
127
  await this.subscribeStatesAsync('*');
128
128
  await this.subscribeObjectsAsync('*');
129
129
  //this.subscribeObjectsAsync('*.downlink.control.*');
130
- this.log.debug(`the adapter starts with downlinkconfigs: ${JSON.stringify(this.config.downlinkConfig)}.`);
131
- this.log.debug(
130
+ // Check for logging
131
+ this.log[this.logtypes.downlinkconfig]?.(
132
+ `the adapter starts with downlinkconfigs: ${JSON.stringify(this.config.downlinkConfig)}.`,
133
+ );
134
+ this.log[this.logtypes.downlinkconfig]?.(
132
135
  `the active downlinkconfigs are: ${JSON.stringify(this.downlinkConfighandler.activeDownlinkConfigs)}`,
133
136
  );
134
137
  /*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.lorawan",
3
- "version": "1.20.5",
3
+ "version": "1.20.7",
4
4
  "description": "converts the desired lora gateway data to a ioBroker structure",
5
5
  "author": {
6
6
  "name": "BenAhrdt",