iobroker.lorawan 1.22.24 → 1.22.26

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
@@ -24,6 +24,13 @@ For now there is documentation in English here: https://wiki.hafenmeister.de
24
24
  Placeholder for the next version (at the beginning of the line):
25
25
  ### **WORK IN PROGRESS**
26
26
  -->
27
+ ### 1.22.26 (2026-07-04)
28
+ - (BenAhrdt) Add ststes into Lock entity for ToIob devices
29
+
30
+ ### 1.22.25 (2026-06-25)
31
+ - (BenAhrdt) Change Assignhandler for case intensive Check
32
+ - (BenAhrdt) Add subAssign for a part of name
33
+
27
34
  ### 1.22.24 (2026-06-24)
28
35
  - (BenAhrdt) Add Absolute Humidity to device_class
29
36
 
@@ -33,12 +40,6 @@ For now there is documentation in English here: https://wiki.hafenmeister.de
33
40
  ### 1.22.22 (2026-06-16)
34
41
  - (BenAhrdt) Remove writing of the last 10 values at receive and public message
35
42
 
36
- ### 1.22.21 (2026-06-16)
37
- - (BenAhrdt) Changed setTimeout to this.adapter.setTimeout
38
-
39
- ### 1.22.20 (2026-06-16)
40
- - (BenAhrdt) Write publishIds and subscribedTopics delayed
41
-
42
43
  [Older changes can be found there](CHANGELOG_OLD.md)
43
44
 
44
45
  ## License
@@ -232,7 +232,7 @@
232
232
  "customJson": "Objekt für den \"Custom\"-Bereich im \"Common\" Objekt",
233
233
  "customJsonActiveTooltip": "With this function it is possible to add your own custom entries to the decoded states",
234
234
  "customJsonInformation": "With this function it is possible to add your own custom entries to the decoded states. Just input the desired json content in active function.",
235
- "customJsonTooltip": "Fügen Sie ein Objekt hinzu, welches in common.custom geschrieben wird.",
235
+ "customJsonTooltip": "Add a new Object, wich will be written into common.custom.",
236
236
  "decimalPlaces": "decimal places",
237
237
  "decimalPlacesTooltip": "select the desired numberof decimal places",
238
238
  "detectedRoles": "detected roles",
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "lorawan",
4
- "version": "1.22.24",
4
+ "version": "1.22.26",
5
5
  "news": {
6
+ "1.22.26": {
7
+ "en": "Add ststes into Lock entity for ToIob devices",
8
+ "de": "Fügen Sie Statusmeldungen zur Sperrentität für ToIob-Geräte hinzu.",
9
+ "ru": "Добавьте sttes в сущность Lock для устройств ToIob.",
10
+ "pt": "Adicionar estados à entidade Lock para dispositivos ToIob",
11
+ "nl": "Voeg statussen toe aan de Lock-entiteit voor ToIob-apparaten.",
12
+ "fr": "Ajouter des ststes à l'entité Verrou pour les périphériques ToIob",
13
+ "it": "Aggiungi stati all'entità Blocco per i dispositivi ToIob",
14
+ "es": "Agregar estados a la entidad Bloqueo para dispositivos ToIob",
15
+ "pl": "Dodaj stacje do encji blokady dla urządzeń ToIob",
16
+ "uk": "Додати станції до сутності блокування для пристроїв ToIob",
17
+ "zh-cn": "将状态添加到锁定实体中,用于 ToIob 设备"
18
+ },
19
+ "1.22.25": {
20
+ "en": "Change Assignhandler for case intensive Check\nAdd subAssign for a part of name",
21
+ "de": "Ändern Sie den Zuweisungshandler für die fallintensive Prüfung.\nFüge Unterzuweisung für einen Teil des Namens hinzu",
22
+ "ru": "Изменить обработчик назначений для проверки с интенсивным использованием регистров.\nДобавить подназначение для части имени",
23
+ "pt": "Alterar o Assignhandler para verificação que exige alta sensibilidade a maiúsculas e minúsculas.\nAdicionar subatribuição para uma parte do nome",
24
+ "nl": "Wijzig de Assignhandler voor case-intensieve controles.\nVoeg een subtoewijzing toe voor een deel van de naam.",
25
+ "fr": "Modifier le gestionnaire d'affectation pour la vérification intensive des cas\nAjouter une sous-affectation pour une partie du nom",
26
+ "it": "Cambia Assegnatore gestore per controllo intensivo dei casi\nAggiungi subAssegna per una parte del nome",
27
+ "es": "Modificar Assignhandler para comprobación intensiva de casos\nAgregar subAsignación para una parte del nombre",
28
+ "pl": "Zmień Assignhandler na kontrolę intensywnie wykorzystującą przypadek\nDodaj podprzypisanie dla części nazwy",
29
+ "uk": "Змінити обробник присвоєння для перевірки з інтенсивним виконанням регістрів\nДодати subAssign для частини імені",
30
+ "zh-cn": "更改案例密集型检查的分配处理程序\n为名称的一部分添加子分配"
31
+ },
6
32
  "1.22.24": {
7
33
  "en": "Add Absolute Humidity to device_class",
8
34
  "de": "Füge der Geräteklasse die absolute Luftfeuchtigkeit hinzu.",
@@ -67,32 +93,6 @@
67
93
  "pl": "Napisz publishIds i subskrybedTopics opóźnione",
68
94
  "uk": "Напишіть відгукПрихильники та підписки",
69
95
  "zh-cn": "写入 Publishing Ids 和订阅日期延迟"
70
- },
71
- "1.22.19": {
72
- "en": "Test durch fehlerhaften git commit",
73
- "de": "Test durch fehlerhaften git commit",
74
- "ru": "Тестирование durch fehlerhaften",
75
- "pt": "Teste durch fehlerhaften git commit",
76
- "nl": "Test durch fehlerhoften git commit",
77
- "fr": "Tester l'engagement de fehlerhaften git",
78
- "it": "Test durch fehlerhaften git commit",
79
- "es": "Test durch fehlerhaften git commit",
80
- "pl": "Test durch fehlerhaften git commit",
81
- "uk": "Тест дюх fehlerhaften git commit",
82
- "zh-cn": "测试 fehlerhaften git 执行"
83
- },
84
- "1.22.18": {
85
- "en": "Testversion, ohne info. schreiben",
86
- "de": "Testversion, ohne Info. schreiben",
87
- "ru": "Тестирование, ohne info. schreiben",
88
- "pt": "Testversion, ohne info. schreiben",
89
- "nl": "Testversie, ohne info. schreiben",
90
- "fr": "Testversion, ohne info. schreiben",
91
- "it": "Testversion, ohne info. schreiben",
92
- "es": "Testversion, ohne info. schreiben",
93
- "pl": "Testversion, ohne info. schreiben",
94
- "uk": "Тестування, ohne info. schreiben",
95
- "zh-cn": "Testversion, ohne info. schreiben (英语)"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -757,12 +757,62 @@ class assignhandlerClass {
757
757
  },
758
758
  },
759
759
  };
760
+
761
+ this.subAssign = {
762
+ Weight: {
763
+ approvedFolders: {
764
+ 'uplink.decoded': {
765
+ assignfunction: this.commonAssign,
766
+ common: {
767
+ role: 'value.weight',
768
+ unit: 'kg',
769
+ },
770
+ },
771
+ },
772
+ },
773
+ WeightGramm: {
774
+ approvedFolders: {
775
+ 'uplink.decoded': {
776
+ assignfunction: this.commonAssign,
777
+ common: {
778
+ role: 'value.weight',
779
+ unit: 'g',
780
+ },
781
+ },
782
+ },
783
+ },
784
+ };
760
785
  }
761
786
 
762
787
  /*********************************************************************
763
788
  * ********************* Execution of Assigns ***********************
764
789
  * ******************************************************************/
765
790
 
791
+ /**
792
+ * @param statename name of the state to find an assign for
793
+ */
794
+ getAssign(statename) {
795
+ if (Object.hasOwn(this.assign, statename)) {
796
+ return this.assign[statename];
797
+ }
798
+
799
+ const lowerStatename = statename.toLowerCase();
800
+ const assignKey = Object.keys(this.assign).find(key => key.toLowerCase() === lowerStatename);
801
+ return assignKey ? this.assign[assignKey] : this.getSubAssign(statename);
802
+ }
803
+
804
+ /**
805
+ * @param statename name of the state to find a sub assign for
806
+ */
807
+ getSubAssign(statename) {
808
+ const lowerStatename = statename.toLowerCase();
809
+ const subAssignKey = Object.keys(this.subAssign)
810
+ .filter(key => lowerStatename.includes(key.toLowerCase()))
811
+ .sort((a, b) => b.length - a.length)[0];
812
+
813
+ return subAssignKey ? this.subAssign[subAssignKey] : undefined;
814
+ }
815
+
766
816
  /**
767
817
  * @param id id wich is assignable
768
818
  * @param value value of the assignable id
@@ -449,8 +449,7 @@ class bridgeDeviceHandlerClass {
449
449
  type: 'string',
450
450
  role: this.detectRole(entity, type),
451
451
  read: true,
452
- write: true,
453
- states: entity.capabilities.commands.states ? entity.capabilities.commands.states : undefined,
452
+ write: false,
454
453
  val: entity.state,
455
454
  isAttribute: true,
456
455
  });
@@ -560,21 +559,38 @@ class bridgeDeviceHandlerClass {
560
559
  * **********************************************************************************************
561
560
  * *********************************************************************************************/
562
561
  } else if (entity.domain === 'lock') {
563
- const commands = {
564
- lock: 'lock',
565
- unlock: 'unlock',
566
- };
567
- if ((entity.attributes.supported_features & 1) !== 0) {
568
- commands.open = 'open';
562
+ if (!entity.capabilities.commands) {
563
+ const commands = {
564
+ states: {
565
+ 0: 'lock',
566
+ 1: 'unlock',
567
+ },
568
+ };
569
+ if ((entity.attributes.supported_features & 1) !== 0) {
570
+ commands.states[2] = 'open';
571
+ }
572
+ entity.capabilities.commands = commands;
569
573
  }
574
+
570
575
  state.push({
571
576
  id: `${channel.id}.command`,
572
577
  name: clearStatename || stateId,
573
- type: 'string',
578
+ type: 'number',
574
579
  role: this.detectRole(entity, type),
575
580
  read: true,
576
581
  write: true,
577
- states: commands,
582
+ states: entity.capabilities.commands.states ? entity.capabilities.commands.states : undefined,
583
+ val: null,
584
+ isAttribute: true,
585
+ });
586
+
587
+ state.push({
588
+ id: `${channel.id}.state`,
589
+ name: clearStatename || stateId,
590
+ type: 'string',
591
+ role: this.detectRole(entity, type),
592
+ read: true,
593
+ write: false,
578
594
  val: entity.state,
579
595
  isAttribute: true,
580
596
  });
@@ -866,7 +882,8 @@ class bridgeDeviceHandlerClass {
866
882
  // humidity
867
883
  if (id.endsWith('command')) {
868
884
  sendInfo.attribute = 'command';
869
- sendInfo.value = state.val;
885
+ const commands = idObject.native.entity.capabilities.commands.states;
886
+ sendInfo.value = commands[state.val];
870
887
  }
871
888
  }
872
889
  } else {
@@ -465,17 +465,15 @@ class directorieshandlerClass {
465
465
  }
466
466
 
467
467
  // Check for assign (new implemented function)
468
- if (this.assignhandler.assign[elementName] && !options?.dontAssign) {
468
+ const assignData = this.assignhandler.getAssign(elementName);
469
+ if (assignData && !options?.dontAssign) {
469
470
  // Check for logging
470
471
  this.adapter.log[this.adapter.logtypes.assignHandler]?.(
471
472
  `the state with the id ${objectId} will be assigned by internal assign function assignHandler`,
472
473
  );
473
- stateVal = this.assignhandler.executeAssign(
474
- objectId,
475
- stateVal,
476
- this.assignhandler.assign[elementName],
477
- { common: common },
478
- );
474
+ stateVal = this.assignhandler.executeAssign(objectId, stateVal, assignData, {
475
+ common: common,
476
+ });
479
477
  }
480
478
  common.read = common.role !== 'button';
481
479
  common.def =
@@ -518,17 +518,13 @@ class messagehandlerClass {
518
518
  }
519
519
  */
520
520
  // Check for assign (new implemented function)
521
- if (this.assignhandler.assign[downlinkParameter.name] && !options?.dontAssign) {
521
+ const assignData = this.assignhandler.getAssign(downlinkParameter.name);
522
+ if (assignData && !options?.dontAssign) {
522
523
  // Check for logging
523
524
  this.adapter.log[this.adapter.logtypes.fillWithDownlink]?.(
524
525
  `the state with the id ${stateId} will be assigned by internal assign function`,
525
526
  );
526
- this.assignhandler.executeAssign(
527
- stateId,
528
- false,
529
- this.assignhandler.assign[downlinkParameter.name],
530
- { common: common },
531
- );
527
+ this.assignhandler.executeAssign(stateId, false, assignData, { common: common });
532
528
  }
533
529
  // Query for base device and parameter push or replace
534
530
  if (downlinkDevice === this.adapter.downlinkConfighandler.internalDevices.baseDevice) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.lorawan",
3
- "version": "1.22.24",
3
+ "version": "1.22.26",
4
4
  "description": "converts the desired lora gateway data to a ioBroker structure",
5
5
  "author": {
6
6
  "name": "BenAhrdt",
@@ -25,7 +25,7 @@
25
25
  "node": ">= 22"
26
26
  },
27
27
  "dependencies": {
28
- "@iobroker/adapter-core": "^3.3.2",
28
+ "@iobroker/adapter-core": "^3.4.1",
29
29
  "@iobroker/dm-utils": "^3.0.19",
30
30
  "easy-crc": "^1.1.0",
31
31
  "lodash": "^4.18.1",