iobroker.lorawan 1.19.4 → 1.19.6

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.19.6 (2026-01-04)
27
+ * (BenAhrdt) add available bit
28
+
29
+ ### 1.19.5 (2026-01-04)
30
+ * (BenAhrdt) change nameing and handling of device_class (result for roles)
31
+
26
32
  ### 1.19.4 (2026-01-04)
27
33
  * (BenAhrdt) change buildSafeStateId (domain)
28
34
 
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "lorawan",
4
- "version": "1.19.4",
4
+ "version": "1.19.6",
5
5
  "news": {
6
+ "1.19.6": {
7
+ "en": "add available bit",
8
+ "de": "hinzufügen von bit",
9
+ "ru": "добавить доступный бит",
10
+ "pt": "adicionar bit disponível",
11
+ "nl": "beschikbare bit toevoegen",
12
+ "fr": "ajouter le bit disponible",
13
+ "it": "aggiungere bit disponibile",
14
+ "es": "añadir bit disponible",
15
+ "pl": "dodaj dostępny bit",
16
+ "uk": "додати доступний біт",
17
+ "zh-cn": "添加可用位"
18
+ },
19
+ "1.19.5": {
20
+ "en": "change nameing and handling of device_class (result for roles)",
21
+ "de": "nameing und handling von device_class ändern (ergebnis für rollen)",
22
+ "ru": "изменение наименования и обработки device_class (результат для ролей)",
23
+ "pt": "mudar nome e manipulação de device_class (resultado para funções)",
24
+ "nl": "naam wijzigen en hanteren van device_class (resultaat voor rollen)",
25
+ "fr": "modifier le nom et la gestion de la classe de périphérique (résultats pour les rôles)",
26
+ "it": "cambiamento nome e gestione di device_class (risultato per ruoli)",
27
+ "es": "cambio de nombre y manejo de dispositivo_class (resultado para roles)",
28
+ "pl": "zmiana nazwy i obsługi urządzenia _ class (wynik dla ról)",
29
+ "uk": "зміна назв і обробки пристрою_class (здійснення ролі)",
30
+ "zh-cn": "更改设备名称和处理级别( 角色结果)"
31
+ },
6
32
  "1.19.4": {
7
33
  "en": "change buildSafeStateId (domain)",
8
34
  "de": "änderungen Sicherheit Id (domain)",
@@ -67,32 +93,6 @@
67
93
  "pl": "usuń Bridgetype Smarthome\ndodać firt możliwość generowania urządzeń z Bridge do Iob",
68
94
  "uk": "видалити Bridgetype Smarthome\nдо Iob",
69
95
  "zh-cn": "删除桥型 Smarthome\n从 Bridge 添加 firt 生成设备的可能性"
70
- },
71
- "1.18.63": {
72
- "en": "return to await calls in checkAll (bridge)",
73
- "de": "zurück zu warten Anrufe im Check Alle (Brücke)",
74
- "ru": "возвращение в ожидании звонков в чек Все (мост)",
75
- "pt": "retornar para aguardar chamadas em cheque Todos (ponte)",
76
- "nl": "terug te keren naar wachten gesprekken in check Alle (brug)",
77
- "fr": "retour à attendre les appels en contrôle Tous (pont)",
78
- "it": "ritorno in attesa chiamate in controllo Tutti (ponte)",
79
- "es": "volver a esperar llamadas en cheque Todo (puente)",
80
- "pl": "powrót czekać rozmowy w czeku Wszystkie (most)",
81
- "uk": "поверніть на чек дзвінків Всі (місто)",
82
- "zh-cn": "返回等待呼叫检查 全部(桥梁)"
83
- },
84
- "1.18.62": {
85
- "en": "Promise the foreign functions in Promise.all",
86
- "de": "Versprechen Sie die ausländischen Funktionen in Promise.all",
87
- "ru": "Обещайте иностранные функции в Promise.all",
88
- "pt": "Prometa as funções estrangeiras em Promise.all",
89
- "nl": "Beloof de buitenlandse functies in Promise.all",
90
- "fr": "Promets les fonctions étrangères dans Promise.all",
91
- "it": "Promettere le funzioni straniere in Promise.all",
92
- "es": "Prométeme las funciones extranjeras en Promesa.todos",
93
- "pl": "Obiecaj funkcje zagraniczne w Promise.all",
94
- "uk": "Використовуйте іноземні функції в Promise.all",
95
- "zh-cn": "在保证中保证外国职能"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -35,7 +35,7 @@ class bridgeDeviceHandlerClass {
35
35
  const activeFunction = 'bridgeDeviceHandler.js - generateDeviceStructure';
36
36
  this.adapter.log.silly(`Function ${activeFunction} started.`);
37
37
  try {
38
- const version = '1.0.0';
38
+ const version = '1.0.2';
39
39
  if (!message.version || message.version !== version) {
40
40
  this.adapter.log.warn(`You need to use version ${version} of the Home Assistant automation.`);
41
41
  return;
@@ -44,11 +44,26 @@ class bridgeDeviceHandlerClass {
44
44
  if (message.entities) {
45
45
  for (const entity of Object.values(message.entities)) {
46
46
  const entityInfo = this.generateStructure(entity);
47
+ const availableId = `${entityInfo?.device.id}.available`;
47
48
  await this.adapter.extendObject(entityInfo?.device.id, {
48
49
  type: 'device',
49
- common: { name: entity.device.name },
50
+ common: { name: entity.device.name, statusStates: { onlineId: availableId } },
50
51
  native: entity.device,
51
52
  });
53
+ await this.adapter.extendObject(availableId, {
54
+ type: 'state',
55
+ common: {
56
+ name: 'Device available',
57
+ type: 'boolean',
58
+ role: 'indicator.reachable',
59
+ read: true,
60
+ write: false,
61
+ def: true,
62
+ },
63
+ native: {},
64
+ });
65
+ const available = entity.available || entity.domain !== 'buton';
66
+ await this.adapter.setState(availableId, available, true);
52
67
  const channel = entity.entity_id.substring(0, entity.entity_id.indexOf('.'));
53
68
  await this.adapter.extendObject(entityInfo?.channel.id, {
54
69
  type: 'channel',
@@ -180,10 +195,13 @@ class bridgeDeviceHandlerClass {
180
195
  id: `${device.id}.${entity.domain}`,
181
196
  name: entity.domain,
182
197
  };
183
-
198
+ let clearStatename = entity.friendly_name;
199
+ if (clearStatename.startsWith(`${device.name} `)) {
200
+ clearStatename = clearStatename.substring(device.name.length + 1, clearStatename.length);
201
+ }
184
202
  const state = {
185
203
  id: `${channel.id}.${stateId}`,
186
- name: entity.friendly_name || stateId,
204
+ name: clearStatename || stateId,
187
205
  type: type,
188
206
  role: this.detectRole(entity, type),
189
207
  unit: entity.unit_of_measurement || undefined,
@@ -289,9 +307,6 @@ class bridgeDeviceHandlerClass {
289
307
  if (entity.domain === 'light') {
290
308
  return 'light';
291
309
  }
292
- if (entity.domain === 'binary_sensor') {
293
- return 'indicator';
294
- }
295
310
 
296
311
  if (entity.device_class) {
297
312
  const map = {
@@ -301,6 +316,10 @@ class bridgeDeviceHandlerClass {
301
316
  energy: 'value.energy',
302
317
  window: 'sensor.window',
303
318
  door: 'sensor.door',
319
+ battery: 'value.battery',
320
+ voltage: 'value.voltage',
321
+ illuminance: 'value.brightness',
322
+ occupancy: 'sensor.motion',
304
323
  };
305
324
  if (map[entity.device_class]) {
306
325
  return map[entity.device_class];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.lorawan",
3
- "version": "1.19.4",
3
+ "version": "1.19.6",
4
4
  "description": "converts the desired lora gateway data to a ioBroker structure",
5
5
  "author": {
6
6
  "name": "BenAhrdt",