iobroker.lorawan 1.18.39 → 1.18.41
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 +6 -0
- package/io-package.json +27 -27
- package/lib/modules/bridge.js +3 -3
- package/lib/modules/bridgeMqttclient.js +15 -0
- package/main.js +60 -2
- package/package.json +1 -1
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.18.41 (2025-12-01)
|
|
27
|
+
* (BenAhrdt) change sending the payload in case of light
|
|
28
|
+
|
|
29
|
+
### 1.18.40 (2025-12-01)
|
|
30
|
+
* (BenAhrdt) change hash
|
|
31
|
+
|
|
26
32
|
### 1.18.39 (2025-11-30)
|
|
27
33
|
* (BenAhrdt) build more roles for contactsensors, in case of role. (window, door, gate ...)
|
|
28
34
|
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "lorawan",
|
|
4
|
-
"version": "1.18.
|
|
4
|
+
"version": "1.18.41",
|
|
5
5
|
"news": {
|
|
6
|
+
"1.18.41": {
|
|
7
|
+
"en": "change sending the payload in case of light",
|
|
8
|
+
"de": "änderung des sendens der nutzlast bei licht",
|
|
9
|
+
"ru": "изменение отправки полезной нагрузки в случае света",
|
|
10
|
+
"pt": "alterar o envio da carga útil em caso de luz",
|
|
11
|
+
"nl": "verandering in het verzenden van de lading in geval van licht",
|
|
12
|
+
"fr": "changement d'envoi de la charge utile en cas de lumière",
|
|
13
|
+
"it": "cambiare inviando il carico utile in caso di luce",
|
|
14
|
+
"es": "cambio enviar la carga útil en caso de luz",
|
|
15
|
+
"pl": "zmiana wysyłania ładunku w przypadku światła",
|
|
16
|
+
"uk": "змінити відправлення корисного навантаження при світлі",
|
|
17
|
+
"zh-cn": "更改发送有效载荷的光线"
|
|
18
|
+
},
|
|
19
|
+
"1.18.40": {
|
|
20
|
+
"en": "change hash",
|
|
21
|
+
"de": "ändern hash",
|
|
22
|
+
"ru": "изменить хеш",
|
|
23
|
+
"pt": "mudar hash",
|
|
24
|
+
"nl": "hash veranderen",
|
|
25
|
+
"fr": "changement hash",
|
|
26
|
+
"it": "cambiamento hash",
|
|
27
|
+
"es": "cambio hash",
|
|
28
|
+
"pl": "zmień hasz",
|
|
29
|
+
"uk": "зміна хеш",
|
|
30
|
+
"zh-cn": "变化散列"
|
|
31
|
+
},
|
|
6
32
|
"1.18.39": {
|
|
7
33
|
"en": "build more roles for contactsensors, in case of role. (window, door, gate ...)",
|
|
8
34
|
"de": "bauen mehr rollen für kontaktsensoren, im falle der rolle. (fenster, tür, tor ...)",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "improwizacja kodu wewnętrznego dla lepszego czytania",
|
|
68
94
|
"uk": "внутрішня обробка коду для кращого читання",
|
|
69
95
|
"zh-cn": "内部代码即兴读取"
|
|
70
|
-
},
|
|
71
|
-
"1.18.34": {
|
|
72
|
-
"en": "translation changed",
|
|
73
|
-
"de": "übersetzung geändert",
|
|
74
|
-
"ru": "перевод изменился",
|
|
75
|
-
"pt": "tradução alterada",
|
|
76
|
-
"nl": "vertaling gewijzigd",
|
|
77
|
-
"fr": "traduction changée",
|
|
78
|
-
"it": "traduzione cambiata",
|
|
79
|
-
"es": "traducción modificada",
|
|
80
|
-
"pl": "zmienione tłumaczenie",
|
|
81
|
-
"uk": "зміни перекладу",
|
|
82
|
-
"zh-cn": "翻译更改"
|
|
83
|
-
},
|
|
84
|
-
"1.18.33": {
|
|
85
|
-
"en": "change state in Lock entity",
|
|
86
|
-
"de": "änderungszustand in Sperreinrichtung",
|
|
87
|
-
"ru": "изменение состояния Lock entity",
|
|
88
|
-
"pt": "mudar o estado na entidade Bloquear",
|
|
89
|
-
"nl": "veranderingstoestand in Lock-entiteit",
|
|
90
|
-
"fr": "changement d'état dans l'entité de verrouillage",
|
|
91
|
-
"it": "cambiamento stato in entità Lock",
|
|
92
|
-
"es": "estado de cambio en la entidad Lock",
|
|
93
|
-
"pl": "zmiana stanu w jednostce blokującej",
|
|
94
|
-
"uk": "змінити стан в суб'єкті блокування",
|
|
95
|
-
"zh-cn": "锁定实体中的变化状态"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
package/lib/modules/bridge.js
CHANGED
|
@@ -815,16 +815,16 @@ class bridgeClass {
|
|
|
815
815
|
val = {};
|
|
816
816
|
val.state = (await this.adapter.getForeignStateAsync(publish.LightIds.onOff)).val;
|
|
817
817
|
val.state = val.state === true ? 'ON' : 'OFF';
|
|
818
|
-
if (publish.LightIds.brightness) {
|
|
818
|
+
if (id === publish.LightIds.brightness) {
|
|
819
819
|
val.brightness = (await this.adapter.getForeignStateAsync(publish.LightIds.brightness)).val;
|
|
820
820
|
}
|
|
821
|
-
if (publish.LightIds.color) {
|
|
821
|
+
if (id === publish.LightIds.color) {
|
|
822
822
|
val.color_mode = 'rgb';
|
|
823
823
|
val.color = this.hexToRgb(
|
|
824
824
|
(await this.adapter.getForeignStateAsync(publish.LightIds.color)).val,
|
|
825
825
|
);
|
|
826
826
|
}
|
|
827
|
-
if (publish.LightIds.effects) {
|
|
827
|
+
if (id === publish.LightIds.effects) {
|
|
828
828
|
const effect = (await this.adapter.getForeignStateAsync(publish.LightIds.effects)).val;
|
|
829
829
|
val.effect = '';
|
|
830
830
|
if (publish.effects[effect]) {
|
|
@@ -97,7 +97,15 @@ class bridgeMqttClientClass {
|
|
|
97
97
|
this.adapter.log.debug(`incomming bridge topic: ${topic}`);
|
|
98
98
|
this.adapter.log.debug(`incomming bridge message: ${message}`);
|
|
99
99
|
|
|
100
|
+
// String zuweisen, wenn JSON.parse ein Fehler auswirft.
|
|
100
101
|
let payload = message.toString('utf8');
|
|
102
|
+
|
|
103
|
+
// Write into debug
|
|
104
|
+
if (await this.adapter.objectExists('bridge.debug.incommingTopic')) {
|
|
105
|
+
await this.adapter.setState('bridge.debug.incommingTopic', topic, true);
|
|
106
|
+
await this.adapter.setState('bridge.debug.incommingPayload', payload, true);
|
|
107
|
+
}
|
|
108
|
+
|
|
101
109
|
// Message Parsen => Wenn nicht pasebar, dann string weitergeben
|
|
102
110
|
try {
|
|
103
111
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -116,6 +124,13 @@ class bridgeMqttClientClass {
|
|
|
116
124
|
*/
|
|
117
125
|
async publish(topic, message, opt) {
|
|
118
126
|
this.adapter.log.debug(`Publishing bridge topic: ${topic} with message: ${message}.`);
|
|
127
|
+
|
|
128
|
+
// Write into debug
|
|
129
|
+
if (await this.adapter.objectExists('bridge.debug.outgoingTopic')) {
|
|
130
|
+
await this.adapter.setState('bridge.debug.outgoingTopic', topic, true);
|
|
131
|
+
await this.adapter.setState('bridge.debug.outgoingPayload', message, true);
|
|
132
|
+
}
|
|
133
|
+
|
|
119
134
|
await this.client.publishAsync(topic, message, opt);
|
|
120
135
|
}
|
|
121
136
|
|
package/main.js
CHANGED
|
@@ -45,7 +45,7 @@ class Lorawan extends utils.Adapter {
|
|
|
45
45
|
this.version;
|
|
46
46
|
|
|
47
47
|
this.secret = {
|
|
48
|
-
hash: '
|
|
48
|
+
hash: 'f3988f71e0d6248fbf690c414bcb46b0500c3a8b3ec9adb9c66be2774ec12291',
|
|
49
49
|
salt: 'LoRaWANBeScJoFr',
|
|
50
50
|
};
|
|
51
51
|
}
|
|
@@ -671,7 +671,13 @@ class Lorawan extends utils.Adapter {
|
|
|
671
671
|
});
|
|
672
672
|
this.extendObject('bridge.debug.topic', {
|
|
673
673
|
type: 'state',
|
|
674
|
-
common: {
|
|
674
|
+
common: {
|
|
675
|
+
name: 'topic of mqtt message',
|
|
676
|
+
type: 'string',
|
|
677
|
+
read: true,
|
|
678
|
+
write: true,
|
|
679
|
+
def: '',
|
|
680
|
+
},
|
|
675
681
|
native: {},
|
|
676
682
|
});
|
|
677
683
|
this.extendObject('bridge.debug.payload', {
|
|
@@ -680,6 +686,8 @@ class Lorawan extends utils.Adapter {
|
|
|
680
686
|
name: 'payload of mqtt message',
|
|
681
687
|
type: 'string',
|
|
682
688
|
role: 'json',
|
|
689
|
+
read: true,
|
|
690
|
+
write: true,
|
|
683
691
|
def: '',
|
|
684
692
|
},
|
|
685
693
|
native: {},
|
|
@@ -690,10 +698,60 @@ class Lorawan extends utils.Adapter {
|
|
|
690
698
|
name: 'payload of mqtt message',
|
|
691
699
|
type: 'boolean',
|
|
692
700
|
role: 'button',
|
|
701
|
+
read: false,
|
|
702
|
+
write: true,
|
|
693
703
|
def: false,
|
|
694
704
|
},
|
|
695
705
|
native: {},
|
|
696
706
|
});
|
|
707
|
+
// Incomming
|
|
708
|
+
this.extendObject('bridge.debug.incommingTopic', {
|
|
709
|
+
type: 'state',
|
|
710
|
+
common: {
|
|
711
|
+
name: 'topic of mqtt message',
|
|
712
|
+
type: 'string',
|
|
713
|
+
read: true,
|
|
714
|
+
write: false,
|
|
715
|
+
def: '',
|
|
716
|
+
},
|
|
717
|
+
native: {},
|
|
718
|
+
});
|
|
719
|
+
this.extendObject('bridge.debug.incommingPayload', {
|
|
720
|
+
type: 'state',
|
|
721
|
+
common: {
|
|
722
|
+
name: 'payload of mqtt message',
|
|
723
|
+
type: 'string',
|
|
724
|
+
role: 'json',
|
|
725
|
+
read: true,
|
|
726
|
+
write: false,
|
|
727
|
+
def: '',
|
|
728
|
+
},
|
|
729
|
+
native: {},
|
|
730
|
+
});
|
|
731
|
+
// Outgoing
|
|
732
|
+
this.extendObject('bridge.debug.outgoingTopic', {
|
|
733
|
+
type: 'state',
|
|
734
|
+
common: {
|
|
735
|
+
name: 'topic of mqtt message',
|
|
736
|
+
type: 'string',
|
|
737
|
+
read: true,
|
|
738
|
+
write: false,
|
|
739
|
+
def: '',
|
|
740
|
+
},
|
|
741
|
+
native: {},
|
|
742
|
+
});
|
|
743
|
+
this.extendObject('bridge.debug.outgoingPayload', {
|
|
744
|
+
type: 'state',
|
|
745
|
+
common: {
|
|
746
|
+
name: 'payload of mqtt message',
|
|
747
|
+
type: 'string',
|
|
748
|
+
role: 'json',
|
|
749
|
+
read: true,
|
|
750
|
+
write: false,
|
|
751
|
+
def: '',
|
|
752
|
+
},
|
|
753
|
+
native: {},
|
|
754
|
+
});
|
|
697
755
|
await this.setState(id, '', true);
|
|
698
756
|
}
|
|
699
757
|
} else {
|