iobroker.lorawan 1.19.7 → 1.19.8

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,9 @@ 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.19.8 (2026-01-05)
27
+ * (BenAhrdt) implement Link to device
28
+
26
29
  ### 1.19.7 (2026-01-04)
27
30
  * (BenAhrdt) improve available logic
28
31
 
package/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "lorawan",
4
- "version": "1.19.7",
4
+ "version": "1.19.8",
5
5
  "news": {
6
+ "1.19.8": {
7
+ "en": "implement Link to device",
8
+ "de": "durchführung Link zum Gerät",
9
+ "ru": "осуществлять Ссылка на устройство",
10
+ "pt": "implementar Ligação ao dispositivo",
11
+ "nl": "implementeren Koppeling naar apparaat",
12
+ "fr": "mise en œuvre Lien vers le périphérique",
13
+ "it": "attuazione Link al dispositivo",
14
+ "es": "aplicación Enlace al dispositivo",
15
+ "pl": "wdrożenie Link do urządzenia",
16
+ "uk": "реалізація Посилання на пристрій",
17
+ "zh-cn": "执行 链接到设备"
18
+ },
6
19
  "1.19.7": {
7
20
  "en": "improve available logic",
8
21
  "de": "verbesserung der verfügbaren logik",
@@ -80,19 +93,6 @@
80
93
  "pl": "bugfix fishdownlink",
81
94
  "uk": "javascript licenses api веб-сайт",
82
95
  "zh-cn": "臭虫补全下行链路"
83
- },
84
- "1.19.1": {
85
- "en": "bugfix device and replace debug logs for silly",
86
- "de": "bugfix gerät und ersetzen debug protokolle für albern",
87
- "ru": "bugfix-устройство и замена отладочных журналов на глупые",
88
- "pt": "dispositivo de correção de bugs e registros de depuração de substituição para bobo",
89
- "nl": "bugfix-apparaat en debug-logs vervangen voor domheid",
90
- "fr": "bugfix périphérique et remplacer les journaux de débogage pour idiot",
91
- "it": "dispositivo bugfix e sostituire i log di debug per sciocco",
92
- "es": "dispositivo bugfix y reemplazar los registros de depuración para tontos",
93
- "pl": "bugfix urządzenia i zastąpić logi debug dla głupi",
94
- "uk": "пристрій для виправлення помилок і заміни журналів для silly",
95
- "zh-cn": "错误修正设备并替换愚昧的调试日志"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -25,6 +25,18 @@ class bridgeDeviceHandlerClass {
25
25
  },
26
26
  native: {},
27
27
  });
28
+ this.adapter.extendObject(`${this.basefolder}.bridgeBaseIp`, {
29
+ type: 'state',
30
+ common: {
31
+ name: 'Ip from Home Assistant',
32
+ type: 'string',
33
+ role: 'url.blank',
34
+ read: true,
35
+ write: true,
36
+ def: 'http://yourIP',
37
+ },
38
+ native: {},
39
+ });
28
40
  }
29
41
 
30
42
  // Generate Structure of incomming Data
@@ -44,18 +56,22 @@ class bridgeDeviceHandlerClass {
44
56
  if (message.entities) {
45
57
  const available = {};
46
58
  for (const entity of Object.values(message.entities)) {
59
+ // EntityInfo
47
60
  const entityInfo = this.generateStructure(entity);
48
61
  if (!entityInfo) {
49
62
  this.adapter.log.warn(`No EntityInfo found`);
50
63
  return;
51
64
  }
52
- const availableId = `${entityInfo.device.id}.available`;
65
+
66
+ // Device
53
67
  await this.adapter.extendObject(entityInfo.device.id, {
54
68
  type: 'device',
55
- common: { name: entity.device.name, statusStates: { onlineId: availableId } },
69
+ common: { name: entity.device.name, statusStates: { onlineId: entityInfo.device.availableId } },
56
70
  native: entity.device,
57
71
  });
58
- await this.adapter.extendObject(availableId, {
72
+
73
+ // Available
74
+ await this.adapter.extendObject(entityInfo.device.availableId, {
59
75
  type: 'state',
60
76
  common: {
61
77
  name: 'Device available',
@@ -68,25 +84,48 @@ class bridgeDeviceHandlerClass {
68
84
  native: {},
69
85
  });
70
86
  if (message.discovery) {
71
- if (available[availableId] === undefined) {
87
+ if (available[entityInfo.device.availableId] === undefined) {
72
88
  if (entity.domain !== 'button' && entity.domain !== 'event' && entity.domain !== 'scene') {
73
- available[availableId] = entity.available;
74
- await this.adapter.setState(availableId, available[availableId], true);
89
+ available[entityInfo.device.availableId] = entity.available;
90
+ await this.adapter.setState(
91
+ entityInfo.device.availableId,
92
+ available[entityInfo.device.availableId],
93
+ true,
94
+ );
75
95
  }
76
- } else if (available[availableId] === true) {
96
+ } else if (available[entityInfo.device.availableId] === true) {
77
97
  if (
78
98
  entity.domain !== 'button' &&
79
99
  entity.domain !== 'event' &&
80
100
  entity.domain !== 'scene' &&
81
101
  entity.available === false
82
102
  ) {
83
- available[availableId] = false;
84
- await this.adapter.setState(availableId, false, true);
103
+ available[entityInfo.device.availableId] = false;
104
+ await this.adapter.setState(entityInfo.device.availableId, false, true);
85
105
  }
86
106
  }
87
107
  } else {
88
- await this.adapter.setState(availableId, true, true);
108
+ await this.adapter.setState(entityInfo.device.availableId, true, true);
89
109
  }
110
+
111
+ // DeviceLink
112
+ const baseUrl = await this.adapter.getStateAsync(`${this.basefolder}.bridgeBaseIp`);
113
+ const url = `${baseUrl.val}:8123/config/devices/device/${entity.device.id}`;
114
+ await this.adapter.extendObject(entityInfo.device.devicelinkId, {
115
+ type: 'state',
116
+ common: {
117
+ name: 'Link to devicepage',
118
+ type: 'string',
119
+ role: 'url.blank',
120
+ read: true,
121
+ write: false,
122
+ def: url,
123
+ },
124
+ native: {},
125
+ });
126
+ await this.adapter.setState(entityInfo.device.devicelinkId, url, true);
127
+
128
+ // Channel
90
129
  const channel = entity.entity_id.substring(0, entity.entity_id.indexOf('.'));
91
130
  await this.adapter.extendObject(entityInfo.channel.id, {
92
131
  type: 'channel',
@@ -173,9 +212,14 @@ class bridgeDeviceHandlerClass {
173
212
  endkey: `${deviceId}.\u9999`,
174
213
  };
175
214
 
176
- const deviceStates = await this.adapter.getObjectViewAsync('system', 'state', deviceParams);
215
+ const deviceChannels = await this.adapter.getObjectViewAsync(
216
+ 'system',
217
+ 'channel',
218
+ deviceParams,
219
+ );
177
220
 
178
- if (deviceStates.rows.length === 0) {
221
+ // No Channel found
222
+ if (deviceChannels.rows.length === 0) {
179
223
  await this.adapter.delObjectAsync(deviceId, { recursive: true });
180
224
  this.adapter.log.debug(`Deleted empty device: ${deviceId}`);
181
225
  }
@@ -213,6 +257,8 @@ class bridgeDeviceHandlerClass {
213
257
  manufacturer: entity.device?.manufacturer || '',
214
258
  model: entity.device?.model || '',
215
259
  };
260
+ device.availableId = `${device.id}.available`;
261
+ device.devicelinkId = `${device.id}.devicelink`;
216
262
 
217
263
  const channel = {
218
264
  id: `${device.id}.${entity.domain}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.lorawan",
3
- "version": "1.19.7",
3
+ "version": "1.19.8",
4
4
  "description": "converts the desired lora gateway data to a ioBroker structure",
5
5
  "author": {
6
6
  "name": "BenAhrdt",