iobroker.lorawan 1.18.1 → 1.18.2

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.18.2 (2025-11-04)
27
+ * (BenAhrdt) Change Topicformat from device_state to device/state
28
+
26
29
  ### 1.18.1 (2025-11-03)
27
30
  * (BenAhrdt) Add Bridge Type Smarthome
28
31
  * (BenAhrdt) Bugfix subscribed Topics
package/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "lorawan",
4
- "version": "1.18.1",
4
+ "version": "1.18.2",
5
5
  "news": {
6
+ "1.18.2": {
7
+ "en": "Change Topicformat from device_state to device/state",
8
+ "de": "Topicformat von device_state zu device/state ändern",
9
+ "ru": "Изменить Тематический формат с device_state на device/state",
10
+ "pt": "Alterar o formato do tópico do dispositivo_ estado para o dispositivo/estado",
11
+ "nl": "Topicformat van device_state naar apparaat/staat wijzigen",
12
+ "fr": "Changer le format du sujet de device_state vers device/state",
13
+ "it": "Cambia formato di argomento da dispositivo_stato a dispositivo/stato",
14
+ "es": "Cambiar Topicformat de dispositivo_state a dispositivo/estado",
15
+ "pl": "Zmień format tematu z urządzenia _ state na urządzenie / stan",
16
+ "uk": "Зміна Themeformat від device_state до пристрою/state",
17
+ "zh-cn": "将主题格式从设备_状态更改为设备/状态"
18
+ },
6
19
  "1.18.1": {
7
20
  "en": "Add Bridge Type Smarthome\nBugfix subscribed Topics\nBugfix on case of objectid starts with '.'",
8
21
  "de": "Bridge Type Smarthome hinzufügen\nBugfix abonniert Themen\nBugfix auf Fall von objectid beginnt mit '. '",
@@ -80,19 +93,6 @@
80
93
  "pl": "przynieść state _ off temat do nawilżacza",
81
94
  "uk": "принести стан_вимкнути тему для зволоження",
82
95
  "zh-cn": "将状态切换为潮湿器"
83
- },
84
- "1.17.15": {
85
- "en": "notifi new discover in case of oldDiscoveredDevices\nbugfix debug logging",
86
- "de": "notifi neu entdecken bei oldDiscoveredDevices\nbugfix debug protokollierung",
87
- "ru": "уведомить новое открытие в случае старых обнаруженных устройств\nрегистрация отладчиков",
88
- "pt": "notifi nova descoberta no caso de dispositivos antigosdescoberta\nregistro de depuração de bugfix",
89
- "nl": "notifi nieuwe ontdekking in het geval van oudeDiscoverdDevices\nbugfix debug logging",
90
- "fr": "notifi nouveau découverte en cas d'ancienDiscoveredDevices\nbugfix debug loging",
91
- "it": "notifi nuova scoperta in caso di vecchiDiscoveredDevices\nbugfix debug logging",
92
- "es": "notifi new discover in case of oldDiscoveredDevices\nbugfix debug logging",
93
- "pl": "notifi nowe odkrycie w przypadku old DiscoveredDevices\nlogowanie debugfix",
94
- "uk": "неідентифікувати нове відкриття у разі виникнення застарілих\nзареєструватися",
95
- "zh-cn": "旧发现器的新发现\n调试日志"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -371,7 +371,7 @@ class bridgeClass {
371
371
  );
372
372
  target.normalizedDeficeIdentifier = this.normalizeString(target.DeviceIdentifier);
373
373
  target.uniqueString = await this.getUniqueString(config.climateIds.target, target.DeviceIdentifier);
374
- target.Topic = `${this.bridgeMqttClient.BridgePrefix}${target.uniqueString}`.toLowerCase();
374
+ target.Topic = `${this.bridgeMqttClient.BridgePrefix}${target.uniqueString?.path}`.toLowerCase();
375
375
 
376
376
  //Min und Max holen
377
377
  const targetObject = await this.adapter.getObjectAsync(config.climateIds.target);
@@ -391,7 +391,7 @@ class bridgeClass {
391
391
  );
392
392
  act.normalizedDeficeIndetifier = this.normalizeString(act.DeviceIdentifier);
393
393
  act.uniqueString = await this.getUniqueString(config.climateIds.act, act.DeviceIdentifier);
394
- act.Topic = `${this.bridgeMqttClient.BridgePrefix}${act.uniqueString}`.toLowerCase();
394
+ act.Topic = `${this.bridgeMqttClient.BridgePrefix}${act.uniqueString?.path}`.toLowerCase();
395
395
 
396
396
  // Mode
397
397
  const mode = {};
@@ -402,19 +402,19 @@ class bridgeClass {
402
402
  );
403
403
  mode.normalizedDeviceIdentifier = this.normalizeString(mode.DeviceIdentifier);
404
404
  mode.uniqueString = await this.getUniqueString(config.climateIds.mode, mode.DeviceIdentifier);
405
- mode.Topic = `${this.bridgeMqttClient.BridgePrefix}${mode.uniqueString}`.toLowerCase();
405
+ mode.Topic = `${this.bridgeMqttClient.BridgePrefix}${mode.uniqueString?.path}`.toLowerCase();
406
406
 
407
- const climateUniquString = await this.getUniqueString(
407
+ const climateUniqueString = await this.getUniqueString(
408
408
  `${this.adapter.namespace}.${config.ClimateName}`,
409
409
  target.DeviceIdentifier,
410
410
  );
411
411
  const DiscoveryTopic =
412
- `${this.BridgeDiscoveryPrefix[this.adapter.config.BridgeType]}${this.ClimateEntityType}/${climateUniquString}/config`.toLowerCase();
412
+ `${this.BridgeDiscoveryPrefix[this.adapter.config.BridgeType]}${this.ClimateEntityType}/${climateUniqueString?.path}/config`.toLowerCase();
413
413
  const indexLastDotTarget = config.climateIds.target.lastIndexOf('.');
414
414
  const Id = config.climateIds.target.substring(0, indexLastDotTarget) + this.EndingVirtualClimate;
415
415
  const DiscoveryPayload = {
416
416
  name: config.ClimateName,
417
- unique_id: `${climateUniquString}`.toLowerCase(),
417
+ unique_id: `${climateUniqueString?.flat}`.toLowerCase(),
418
418
  device: {
419
419
  identifiers: [target.normalizedDeficeIdentifier.toLowerCase()],
420
420
  name: target.DeviceIdentifier,
@@ -916,12 +916,12 @@ class bridgeClass {
916
916
  `${this.adapter.namespace}.${changeInfo.id}`,
917
917
  DeviceIdentifier,
918
918
  );
919
- const Topic = `${this.bridgeMqttClient.BridgePrefix}${uniqueString}`.toLowerCase();
919
+ const Topic = `${this.bridgeMqttClient.BridgePrefix}${uniqueString?.path}`.toLowerCase();
920
920
 
921
921
  const EntityType = await this.getEntityType(options);
922
922
  const AdditionalAttributes = await this.getStateAttributes(options.common, EntityType);
923
923
  const DiscoveryTopic =
924
- `${this.BridgeDiscoveryPrefix[this.adapter.config.BridgeType]}${EntityType}/${uniqueString}/config`.toLowerCase();
924
+ `${this.BridgeDiscoveryPrefix[this.adapter.config.BridgeType]}${EntityType}/${uniqueString?.path}/config`.toLowerCase();
925
925
  const DiscoveryPayload = {
926
926
  name: StateName,
927
927
  unique_id: `${normalizedDeviceIdentifier}_${normalizedStateName}`.toLowerCase(),
@@ -1573,7 +1573,7 @@ class bridgeClass {
1573
1573
  const target = {};
1574
1574
  target.DeviceIdentifier = (await this.getParentNameing(config.climateIds.target))?.parentName;
1575
1575
  target.uniqueString = await this.getUniqueString(config.climateIds.target, target.DeviceIdentifier);
1576
- target.Topic = `${this.bridgeMqttClient.BridgePrefix}${target.uniqueString}`.toLowerCase();
1576
+ target.Topic = `${this.bridgeMqttClient.BridgePrefix}${target.uniqueString?.path}`.toLowerCase();
1577
1577
 
1578
1578
  //Min und Max holen
1579
1579
  const targetObject = await this.adapter.getForeignObjectAsync(config.climateIds.target);
@@ -1588,26 +1588,26 @@ class bridgeClass {
1588
1588
  const act = {};
1589
1589
  act.DeviceIdentifier = (await this.getParentNameing(config.climateIds.act))?.parentName;
1590
1590
  act.uniqueString = await this.getUniqueString(config.climateIds.act, act.DeviceIdentifier);
1591
- act.Topic = `${this.bridgeMqttClient.BridgePrefix}${act.uniqueString}`.toLowerCase();
1591
+ act.Topic = `${this.bridgeMqttClient.BridgePrefix}${act.uniqueString?.path}`.toLowerCase();
1592
1592
 
1593
1593
  // Mode
1594
1594
  const mode = {};
1595
1595
  mode.DeviceIdentifier = (await this.getParentNameing(config.climateIds.mode))?.parentName;
1596
1596
  mode.uniqueString = await this.getUniqueString(config.climateIds.mode, mode.DeviceIdentifier);
1597
- mode.Topic = `${this.bridgeMqttClient.BridgePrefix}${mode.uniqueString}`.toLowerCase();
1597
+ mode.Topic = `${this.bridgeMqttClient.BridgePrefix}${mode.uniqueString?.path}`.toLowerCase();
1598
1598
 
1599
- const climateUniquString = await this.getUniqueString(
1599
+ const climateUniqueString = await this.getUniqueString(
1600
1600
  `${this.adapter.namespace}.${config.ClimateName}`,
1601
1601
  target.DeviceIdentifier,
1602
1602
  );
1603
1603
  const DiscoveryTopic =
1604
- `${this.BridgeDiscoveryPrefix[this.adapter.config.BridgeType]}${this.ClimateEntityType}/${climateUniquString}/config`.toLowerCase();
1604
+ `${this.BridgeDiscoveryPrefix[this.adapter.config.BridgeType]}${this.ClimateEntityType}/${climateUniqueString?.path}/config`.toLowerCase();
1605
1605
  const indexLastDotTarget = config.climateIds.target.lastIndexOf('.');
1606
1606
  const Id = config.climateIds.target.substring(0, indexLastDotTarget) + this.EndingVirtualClimate;
1607
1607
 
1608
1608
  const DiscoveryPayload = {
1609
1609
  name: config.ClimateName,
1610
- unique_id: `${climateUniquString}`.toLowerCase(),
1610
+ unique_id: `${climateUniqueString?.flat}`.toLowerCase(),
1611
1611
  device: {
1612
1612
  identifiers: [this.normalizeString(target.DeviceIdentifier).toLowerCase()],
1613
1613
  name: target.DeviceIdentifier,
@@ -1801,13 +1801,13 @@ class bridgeClass {
1801
1801
  const onOff = {};
1802
1802
  onOff.DeviceIdentifier = (await this.getParentNameing(config.HumidifierIds.onOff))?.parentName;
1803
1803
  onOff.uniqueString = await this.getUniqueString(config.HumidifierIds.onOff, onOff.DeviceIdentifier);
1804
- onOff.Topic = `${this.bridgeMqttClient.BridgePrefix}${onOff.uniqueString}`.toLowerCase();
1804
+ onOff.Topic = `${this.bridgeMqttClient.BridgePrefix}${onOff.uniqueString?.path}`.toLowerCase();
1805
1805
 
1806
1806
  // Target
1807
1807
  const target = {};
1808
1808
  target.DeviceIdentifier = (await this.getParentNameing(config.HumidifierIds.target))?.parentName;
1809
1809
  target.uniqueString = await this.getUniqueString(config.HumidifierIds.target, target.DeviceIdentifier);
1810
- target.Topic = `${this.bridgeMqttClient.BridgePrefix}${target.uniqueString}`.toLowerCase();
1810
+ target.Topic = `${this.bridgeMqttClient.BridgePrefix}${target.uniqueString?.path}`.toLowerCase();
1811
1811
 
1812
1812
  //Min und Max holen
1813
1813
  const targetObject = await this.adapter.getForeignObjectAsync(config.HumidifierIds.target);
@@ -1822,21 +1822,21 @@ class bridgeClass {
1822
1822
  const act = {};
1823
1823
  act.DeviceIdentifier = (await this.getParentNameing(config.HumidifierIds.act))?.parentName;
1824
1824
  act.uniqueString = await this.getUniqueString(config.HumidifierIds.act, act.DeviceIdentifier);
1825
- act.Topic = `${this.bridgeMqttClient.BridgePrefix}${act.uniqueString}`.toLowerCase();
1825
+ act.Topic = `${this.bridgeMqttClient.BridgePrefix}${act.uniqueString?.path}`.toLowerCase();
1826
1826
 
1827
- const humidifierUniquString = await this.getUniqueString(
1827
+ const humidifierUniqueString = await this.getUniqueString(
1828
1828
  `${this.adapter.namespace}.${config.HumidifierName}`,
1829
1829
  target.DeviceIdentifier,
1830
1830
  );
1831
1831
  const entityType = config.Humidifier ? this.HumidifierEntityType : this.DeHumidifierEntityType;
1832
1832
  const DiscoveryTopic =
1833
- `${this.BridgeDiscoveryPrefix[this.adapter.config.BridgeType]}${this.HumidifierEntityType}/${humidifierUniquString}/config`.toLowerCase();
1833
+ `${this.BridgeDiscoveryPrefix[this.adapter.config.BridgeType]}${this.HumidifierEntityType}/${humidifierUniqueString?.path}/config`.toLowerCase();
1834
1834
  const indexLastDotTarget = config.HumidifierIds.target.lastIndexOf('.');
1835
1835
  const Id = config.HumidifierIds.target.substring(0, indexLastDotTarget) + this.EndingVirtualHumidifier;
1836
1836
 
1837
1837
  const DiscoveryPayload = {
1838
1838
  name: config.HumidifierName,
1839
- unique_id: `${humidifierUniquString}`.toLowerCase(),
1839
+ unique_id: `${humidifierUniqueString?.flat}`.toLowerCase(),
1840
1840
  device: {
1841
1841
  identifiers: [this.normalizeString(target.DeviceIdentifier).toLowerCase()],
1842
1842
  name: target.DeviceIdentifier,
@@ -2138,16 +2138,16 @@ class bridgeClass {
2138
2138
  const uniqueString = await this.getUniqueString(id, deviceIdentifier);
2139
2139
  /*const topic =
2140
2140
  `${this.bridgeMqttClient.BridgePrefix}${normalizedDeviceIdentifier}/${normalizedStateName}`.toLowerCase();*/
2141
- const topic = `${this.bridgeMqttClient.BridgePrefix}${uniqueString}`.toLowerCase();
2141
+ const topic = `${this.bridgeMqttClient.BridgePrefix}${uniqueString?.path}`.toLowerCase();
2142
2142
  const EntityType = await this.getEntityType(options);
2143
2143
  const AdditionalAttributes = await this.getStateAttributes(options.common, EntityType);
2144
2144
  /*const discoveryTopic =
2145
2145
  `${this.BridgeDiscoveryPrefix[this.adapter.config.BridgeType]}${EntityType}/${normalizedDeviceIdentifier}/${normalizedStateName}/config`.toLowerCase();*/
2146
2146
  const discoveryTopic =
2147
- `${this.BridgeDiscoveryPrefix[this.adapter.config.BridgeType]}${EntityType}/${uniqueString}/config`.toLowerCase();
2147
+ `${this.BridgeDiscoveryPrefix[this.adapter.config.BridgeType]}${EntityType}/${uniqueString?.path}/config`.toLowerCase();
2148
2148
  const discoveryPayload = {
2149
2149
  name: statename,
2150
- unique_id: `${uniqueString}`.toLowerCase(),
2150
+ unique_id: `${uniqueString?.flat}`.toLowerCase(),
2151
2151
  device: { identifiers: [normalizedDeviceIdentifier.toLowerCase()], name: deviceIdentifier },
2152
2152
  };
2153
2153
  // Add Topics
@@ -2211,7 +2211,11 @@ class bridgeClass {
2211
2211
  const activeFunction = 'bridge.js - getUniqueString';
2212
2212
  this.adapter.log.debug(`Function ${activeFunction} started.`);
2213
2213
  try {
2214
- return `${this.normalizeString(deviceidentifier)}_${this.normalizeString(id)}`;
2214
+ const unique = {
2215
+ flat: `${this.normalizeString(deviceidentifier)}_${this.normalizeString(id)}`,
2216
+ path: `${this.normalizeString(deviceidentifier)}/${this.normalizeString(id)}`,
2217
+ };
2218
+ return unique;
2215
2219
  } catch (error) {
2216
2220
  this.adapter.log.error(`error at ${activeFunction}: ${error}`);
2217
2221
  }
@@ -131,7 +131,7 @@ class bridgeMqttClientClass {
131
131
  */
132
132
  getSubscribtionArray() {
133
133
  // Subscribe to the ending of set (with different counts of sublevels 2 -10)
134
- return [`${this.BridgePrefix}+/set`];
134
+ return [`${this.BridgePrefix}+/set`, `${this.BridgePrefix}+/+/set`];
135
135
  }
136
136
  }
137
137
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.lorawan",
3
- "version": "1.18.1",
3
+ "version": "1.18.2",
4
4
  "description": "converts the desired lora gateway data to a ioBroker structure",
5
5
  "author": {
6
6
  "name": "BenAhrdt",
@@ -32,10 +32,10 @@
32
32
  "node-schedule": "^2.1.1"
33
33
  },
34
34
  "devDependencies": {
35
- "@alcalzone/release-script": "^3.8.0",
36
- "@alcalzone/release-script-plugin-iobroker": "^3.7.2",
37
- "@alcalzone/release-script-plugin-license": "^3.7.0",
38
- "@alcalzone/release-script-plugin-manual-review": "^3.7.0",
35
+ "@alcalzone/release-script": "^5.0.0",
36
+ "@alcalzone/release-script-plugin-iobroker": "^4.0.0",
37
+ "@alcalzone/release-script-plugin-license": "^4.0.0",
38
+ "@alcalzone/release-script-plugin-manual-review": "^4.0.0",
39
39
  "@iobroker/adapter-dev": "^1.5.0",
40
40
  "@iobroker/eslint-config": "^2.2.0",
41
41
  "@iobroker/testing": "^5.1.1",