iobroker.lorawan 0.3.4 → 0.3.5
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 +3 -0
- package/admin/jsonConfig.json +2 -0
- package/io-package.json +15 -15
- package/lib/modules/deviceProfiles/Dragino LT22222.json +56 -9
- package/lib/modules/deviceProfiles/Dragino.json +13 -2
- package/lib/modules/deviceProfiles/LBR-BSM-0404.json +55 -7
- package/lib/modules/deviceProfiles/Vicki.json +51 -8
- package/lib/modules/directorieshandler.js +0 -5
- package/lib/modules/downlinkConfighandler.js +39 -4
- package/lib/modules/messagehandler.js +22 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,6 +22,9 @@ For now there is documentation in English here: http://www.hafenmeister.com/Lora
|
|
|
22
22
|
Placeholder for the next version (at the beginning of the line):
|
|
23
23
|
### **WORK IN PROGRESS**
|
|
24
24
|
-->
|
|
25
|
+
### 0.3.5 (2024-02-21)
|
|
26
|
+
* (BenAhrdt) set tier to 2 and improove standard devices
|
|
27
|
+
|
|
25
28
|
### 0.3.4 (2024-02-20)
|
|
26
29
|
* (BenAhrdt) put some debug and silly logging to code
|
|
27
30
|
|
package/admin/jsonConfig.json
CHANGED
|
@@ -102,6 +102,7 @@
|
|
|
102
102
|
{
|
|
103
103
|
"newLine": true,
|
|
104
104
|
"type": "header",
|
|
105
|
+
"attr": "_header",
|
|
105
106
|
"text": "downlinkConfigMainHeader",
|
|
106
107
|
"size": 3
|
|
107
108
|
},
|
|
@@ -224,6 +225,7 @@
|
|
|
224
225
|
},
|
|
225
226
|
{
|
|
226
227
|
"type": "staticText",
|
|
228
|
+
"attr": "_statciText",
|
|
227
229
|
"label": "",
|
|
228
230
|
"hidden": "data.type === 'number'",
|
|
229
231
|
"sm":2
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "lorawan",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.5",
|
|
5
5
|
"news": {
|
|
6
|
+
"0.3.5": {
|
|
7
|
+
"en": "set tier to 2 and improove standard devices",
|
|
8
|
+
"de": "tier auf 2 und improovierte standardgeräte",
|
|
9
|
+
"ru": "установить уровень до 2 и импровизировать стандартные устройства",
|
|
10
|
+
"pt": "definir nível para 2 e improvisar dispositivos padrão",
|
|
11
|
+
"nl": "set tier to 2 and improove standaard devices",
|
|
12
|
+
"fr": "définir le niveau à 2 et improviser les appareils standard",
|
|
13
|
+
"it": "set tier a 2 e improove dispositivi standard",
|
|
14
|
+
"es": "set tier a 2 y improove dispositivos estándar",
|
|
15
|
+
"pl": "ustawić poziom dokładności na 2 i improove standardowe urządzenia",
|
|
16
|
+
"uk": "встановити ярус до 2 і непровисних стандартних пристроїв",
|
|
17
|
+
"zh-cn": "设置等级至 2 级, 并且不包含标准设备"
|
|
18
|
+
},
|
|
6
19
|
"0.3.4": {
|
|
7
20
|
"en": "put some debug and silly logging to code",
|
|
8
21
|
"de": "debug und silly logging auf code setzen",
|
|
@@ -80,19 +93,6 @@
|
|
|
80
93
|
"pl": "sprawdzają typy wartości wiadomości i wdrażają blokowane bloki",
|
|
81
94
|
"uk": "перевіряти типи значень обміну повідомленнями та реалізовувати більше блоків",
|
|
82
95
|
"zh-cn": "检查消息值的类型, 执行更多块"
|
|
83
|
-
},
|
|
84
|
-
"0.2.0": {
|
|
85
|
-
"en": "more functionality in messageing",
|
|
86
|
-
"de": "mehr funktionalität in der meldung",
|
|
87
|
-
"ru": "больше функциональности в сообщении",
|
|
88
|
-
"pt": "mais funcionalidade em mensagens",
|
|
89
|
-
"nl": "meer functionaliteit in berichtgeving",
|
|
90
|
-
"fr": "plus de fonctionnalité dans la messagerie",
|
|
91
|
-
"it": "più funzionalità nel messaggio",
|
|
92
|
-
"es": "más funcionalidad en el mensaje",
|
|
93
|
-
"pl": "większa funkcjonalność w zakresie rozwiązywania problemów",
|
|
94
|
-
"uk": "більше функцій в повідомленнях",
|
|
95
|
-
"zh-cn": "信件中更多的功能"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"title": "LoRaWAN",
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"extIcon": "https://raw.githubusercontent.com/BenAhrdt/ioBroker.lorawan/main/admin/lorawan.png",
|
|
137
137
|
"readme": "https://github.com/BenAhrdt/ioBroker.lorawan/blob/main/README.md",
|
|
138
138
|
"loglevel": "info",
|
|
139
|
-
"tier":
|
|
139
|
+
"tier": 2,
|
|
140
140
|
"mode": "daemon",
|
|
141
141
|
"type": "protocols",
|
|
142
142
|
"compact": true,
|
|
@@ -11,16 +11,23 @@
|
|
|
11
11
|
"port": 1,
|
|
12
12
|
"priority": "NORMAL",
|
|
13
13
|
"type": "boolean",
|
|
14
|
+
"awap": false,
|
|
14
15
|
"confirmed": true,
|
|
15
16
|
"front": "030111",
|
|
16
17
|
"end": "11",
|
|
17
18
|
"lengthInByte": 1,
|
|
18
19
|
"on": "030111",
|
|
19
20
|
"off": "030011",
|
|
21
|
+
"onClick": "030111",
|
|
20
22
|
"multiplyfaktor": "1",
|
|
21
23
|
"unit": "",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
+
"crc":"noCrc",
|
|
25
|
+
"limitMin": true,
|
|
26
|
+
"limitMinValue": 1,
|
|
27
|
+
"limitMaxValue": 0,
|
|
28
|
+
"limitMax": false,
|
|
29
|
+
"swap": false,
|
|
30
|
+
"decimalPlaces": "0"
|
|
24
31
|
},
|
|
25
32
|
{
|
|
26
33
|
"name": "Intervall",
|
|
@@ -38,7 +45,11 @@
|
|
|
38
45
|
"onClick": "030111",
|
|
39
46
|
"crc":"noCrc",
|
|
40
47
|
"limitMin": true,
|
|
41
|
-
"limitMinValue": 1
|
|
48
|
+
"limitMinValue": 1,
|
|
49
|
+
"limitMax": false,
|
|
50
|
+
"limitMaxValue": 0,
|
|
51
|
+
"swap": false,
|
|
52
|
+
"decimalPlaces": "0"
|
|
42
53
|
},
|
|
43
54
|
{
|
|
44
55
|
"name": "RO2_target",
|
|
@@ -54,7 +65,13 @@
|
|
|
54
65
|
"multiplyfaktor": "1",
|
|
55
66
|
"unit": "",
|
|
56
67
|
"onClick": "030111",
|
|
57
|
-
"crc":"noCrc"
|
|
68
|
+
"crc":"noCrc",
|
|
69
|
+
"limitMin": true,
|
|
70
|
+
"limitMinValue": 1,
|
|
71
|
+
"limitMax": false,
|
|
72
|
+
"limitMaxValue": 0,
|
|
73
|
+
"swap": false,
|
|
74
|
+
"decimalPlaces": "0"
|
|
58
75
|
},
|
|
59
76
|
{
|
|
60
77
|
"name": "RPC_Level",
|
|
@@ -70,7 +87,13 @@
|
|
|
70
87
|
"multiplyfaktor": "1",
|
|
71
88
|
"unit": "",
|
|
72
89
|
"onClick": "030111",
|
|
73
|
-
"crc":"noCrc"
|
|
90
|
+
"crc":"noCrc",
|
|
91
|
+
"limitMin": true,
|
|
92
|
+
"limitMinValue": 1,
|
|
93
|
+
"limitMax": false,
|
|
94
|
+
"limitMaxValue": 0,
|
|
95
|
+
"swap": false,
|
|
96
|
+
"decimalPlaces": "0"
|
|
74
97
|
},
|
|
75
98
|
{
|
|
76
99
|
"name": "DO1_target",
|
|
@@ -86,7 +109,13 @@
|
|
|
86
109
|
"multiplyfaktor": "1",
|
|
87
110
|
"unit": "",
|
|
88
111
|
"onClick": "030111",
|
|
89
|
-
"crc":"noCrc"
|
|
112
|
+
"crc":"noCrc",
|
|
113
|
+
"limitMin": true,
|
|
114
|
+
"limitMinValue": 1,
|
|
115
|
+
"limitMax": false,
|
|
116
|
+
"limitMaxValue": 0,
|
|
117
|
+
"swap": false,
|
|
118
|
+
"decimalPlaces": "0"
|
|
90
119
|
},
|
|
91
120
|
{
|
|
92
121
|
"name": "DO2_target",
|
|
@@ -102,7 +131,13 @@
|
|
|
102
131
|
"multiplyfaktor": "1",
|
|
103
132
|
"unit": "",
|
|
104
133
|
"onClick": "030111",
|
|
105
|
-
"crc":"noCrc"
|
|
134
|
+
"crc":"noCrc",
|
|
135
|
+
"limitMin": true,
|
|
136
|
+
"limitMinValue": 1,
|
|
137
|
+
"limitMax": false,
|
|
138
|
+
"limitMaxValue": 0,
|
|
139
|
+
"swap": false,
|
|
140
|
+
"decimalPlaces": "0"
|
|
106
141
|
},
|
|
107
142
|
{
|
|
108
143
|
"name": "DO1_L_FOR_2_SEC",
|
|
@@ -118,7 +153,13 @@
|
|
|
118
153
|
"multiplyfaktor": "1",
|
|
119
154
|
"unit": "",
|
|
120
155
|
"onClick": "030111",
|
|
121
|
-
"crc":"noCrc"
|
|
156
|
+
"crc":"noCrc",
|
|
157
|
+
"limitMin": true,
|
|
158
|
+
"limitMinValue": 1,
|
|
159
|
+
"limitMax": false,
|
|
160
|
+
"limitMaxValue": 0,
|
|
161
|
+
"swap": false,
|
|
162
|
+
"decimalPlaces": "0"
|
|
122
163
|
},
|
|
123
164
|
{
|
|
124
165
|
"name": "RO2_On_FOR_1_Min",
|
|
@@ -134,7 +175,13 @@
|
|
|
134
175
|
"multiplyfaktor": "1",
|
|
135
176
|
"unit": "",
|
|
136
177
|
"onClick": "030111",
|
|
137
|
-
"crc":"noCrc"
|
|
178
|
+
"crc":"noCrc",
|
|
179
|
+
"limitMin": true,
|
|
180
|
+
"limitMinValue": 1,
|
|
181
|
+
"limitMax": false,
|
|
182
|
+
"limitMaxValue": 0,
|
|
183
|
+
"swap": false,
|
|
184
|
+
"decimalPlaces": "0"
|
|
138
185
|
}
|
|
139
186
|
]
|
|
140
187
|
}
|
|
@@ -17,11 +17,16 @@
|
|
|
17
17
|
"lengthInByte": 3,
|
|
18
18
|
"on": "",
|
|
19
19
|
"off": "",
|
|
20
|
+
"onClick": "",
|
|
20
21
|
"multiplyfaktor": 60,
|
|
21
22
|
"unit": "min",
|
|
22
23
|
"crc":"noCrc",
|
|
23
24
|
"limitMin": true,
|
|
24
|
-
"limitMinValue": 1
|
|
25
|
+
"limitMinValue": 1,
|
|
26
|
+
"limitMax": false,
|
|
27
|
+
"limitMaxValue": 0,
|
|
28
|
+
"swap": false,
|
|
29
|
+
"decimalPlaces": "0"
|
|
25
30
|
},
|
|
26
31
|
{
|
|
27
32
|
"name": "Reboot",
|
|
@@ -35,9 +40,15 @@
|
|
|
35
40
|
"on": "",
|
|
36
41
|
"off": "",
|
|
37
42
|
"onClick": "04FF",
|
|
43
|
+
"limitMin": true,
|
|
44
|
+
"limitMinValue": 1,
|
|
45
|
+
"limitMax": false,
|
|
46
|
+
"limitMaxValue": 0,
|
|
47
|
+
"swap": false,
|
|
38
48
|
"multiplyfaktor": "1",
|
|
39
49
|
"unit": "",
|
|
40
|
-
"crc":"noCrc"
|
|
50
|
+
"crc": "noCrc",
|
|
51
|
+
"decimalPlaces": "0"
|
|
41
52
|
}
|
|
42
53
|
]
|
|
43
54
|
}
|
|
@@ -20,7 +20,14 @@
|
|
|
20
20
|
"onClick": "030111",
|
|
21
21
|
"multiplyfaktor": "1",
|
|
22
22
|
"unit": "",
|
|
23
|
-
"crc":"noCrc"
|
|
23
|
+
"crc":"noCrc",
|
|
24
|
+
"limitMin": true,
|
|
25
|
+
"limitMinValue": 1,
|
|
26
|
+
"limitMax": false,
|
|
27
|
+
"limitMaxValue": 0,
|
|
28
|
+
"swap": false,
|
|
29
|
+
"statciText4": null,
|
|
30
|
+
"decimalPlaces": "0"
|
|
24
31
|
},
|
|
25
32
|
{
|
|
26
33
|
"name": "Get config parameter",
|
|
@@ -36,7 +43,14 @@
|
|
|
36
43
|
"onClick": "g",
|
|
37
44
|
"multiplyfaktor": "1",
|
|
38
45
|
"unit": "",
|
|
39
|
-
"crc":"noCrc"
|
|
46
|
+
"crc":"noCrc",
|
|
47
|
+
"limitMin": true,
|
|
48
|
+
"limitMinValue": 1,
|
|
49
|
+
"limitMax": false,
|
|
50
|
+
"limitMaxValue": 0,
|
|
51
|
+
"swap": false,
|
|
52
|
+
"statciText4": null,
|
|
53
|
+
"decimalPlaces": "0"
|
|
40
54
|
},
|
|
41
55
|
{
|
|
42
56
|
"name": "Request firmware and version",
|
|
@@ -52,7 +66,14 @@
|
|
|
52
66
|
"onClick": "3F",
|
|
53
67
|
"multiplyfaktor": "1",
|
|
54
68
|
"unit": "",
|
|
55
|
-
"crc":"noCrc"
|
|
69
|
+
"crc":"noCrc",
|
|
70
|
+
"limitMin": true,
|
|
71
|
+
"limitMinValue": 1,
|
|
72
|
+
"limitMax": false,
|
|
73
|
+
"limitMaxValue": 0,
|
|
74
|
+
"swap": false,
|
|
75
|
+
"statciText4": null,
|
|
76
|
+
"decimalPlaces": "0"
|
|
56
77
|
},
|
|
57
78
|
{
|
|
58
79
|
"name": "BSM_Relais1",
|
|
@@ -68,7 +89,14 @@
|
|
|
68
89
|
"onClick": "030111",
|
|
69
90
|
"multiplyfaktor": "1",
|
|
70
91
|
"unit": "",
|
|
71
|
-
"crc":"noCrc"
|
|
92
|
+
"crc":"noCrc",
|
|
93
|
+
"limitMin": true,
|
|
94
|
+
"limitMinValue": 1,
|
|
95
|
+
"limitMax": false,
|
|
96
|
+
"limitMaxValue": 0,
|
|
97
|
+
"swap": false,
|
|
98
|
+
"statciText4": null,
|
|
99
|
+
"decimalPlaces": "0"
|
|
72
100
|
},
|
|
73
101
|
{
|
|
74
102
|
"name": "BSM_Relais2",
|
|
@@ -84,7 +112,14 @@
|
|
|
84
112
|
"onClick": "030111",
|
|
85
113
|
"multiplyfaktor": "1",
|
|
86
114
|
"unit": "",
|
|
87
|
-
"crc":"noCrc"
|
|
115
|
+
"crc":"noCrc",
|
|
116
|
+
"limitMin": true,
|
|
117
|
+
"limitMinValue": 1,
|
|
118
|
+
"limitMax": false,
|
|
119
|
+
"limitMaxValue": 0,
|
|
120
|
+
"swap": false,
|
|
121
|
+
"statciText4": null,
|
|
122
|
+
"decimalPlaces": "0"
|
|
88
123
|
},
|
|
89
124
|
{
|
|
90
125
|
"name": "BSM_Relais3",
|
|
@@ -100,7 +135,14 @@
|
|
|
100
135
|
"onClick": "030111",
|
|
101
136
|
"multiplyfaktor": "1",
|
|
102
137
|
"unit": "",
|
|
103
|
-
"crc":"noCrc"
|
|
138
|
+
"crc":"noCrc",
|
|
139
|
+
"limitMin": true,
|
|
140
|
+
"limitMinValue": 1,
|
|
141
|
+
"limitMax": false,
|
|
142
|
+
"limitMaxValue": 0,
|
|
143
|
+
"swap": false,
|
|
144
|
+
"statciText4": null,
|
|
145
|
+
"decimalPlaces": "0"
|
|
104
146
|
},
|
|
105
147
|
{
|
|
106
148
|
"name": "BSM_Relais4",
|
|
@@ -117,7 +159,13 @@
|
|
|
117
159
|
"multiplyfaktor": "1",
|
|
118
160
|
"unit": "",
|
|
119
161
|
"decimalPlaces": "1",
|
|
120
|
-
"crc":"noCrc"
|
|
162
|
+
"crc":"noCrc",
|
|
163
|
+
"limitMin": true,
|
|
164
|
+
"limitMinValue": 1,
|
|
165
|
+
"limitMax": false,
|
|
166
|
+
"limitMaxValue": 0,
|
|
167
|
+
"swap": false,
|
|
168
|
+
"statciText4": null
|
|
121
169
|
}
|
|
122
170
|
]
|
|
123
171
|
}
|
|
@@ -21,7 +21,12 @@
|
|
|
21
21
|
"multiplyfaktor": 10,
|
|
22
22
|
"unit": "Grad",
|
|
23
23
|
"decimalPlaces": 1,
|
|
24
|
-
"crc":"noCrc"
|
|
24
|
+
"crc":"noCrc",
|
|
25
|
+
"limitMin": true,
|
|
26
|
+
"limitMinValue": 1,
|
|
27
|
+
"limitMax": false,
|
|
28
|
+
"limitMaxValue": 0,
|
|
29
|
+
"swap": false
|
|
25
30
|
},
|
|
26
31
|
{
|
|
27
32
|
"name": "Vicki_Interval",
|
|
@@ -39,7 +44,11 @@
|
|
|
39
44
|
"unit": "Minuten",
|
|
40
45
|
"crc":"noCrc",
|
|
41
46
|
"limitMin": true,
|
|
42
|
-
"limitMinValue": 1
|
|
47
|
+
"limitMinValue": 1,
|
|
48
|
+
"limitMax": false,
|
|
49
|
+
"limitMaxValue": 0,
|
|
50
|
+
"swap": false,
|
|
51
|
+
"decimalPlaces": "0"
|
|
43
52
|
},
|
|
44
53
|
{
|
|
45
54
|
"name": "Vicki_Target_Temperature",
|
|
@@ -56,7 +65,12 @@
|
|
|
56
65
|
"multiplyfaktor": "1",
|
|
57
66
|
"unit": "Grad",
|
|
58
67
|
"decimalPlaces": 0,
|
|
59
|
-
"crc":"noCrc"
|
|
68
|
+
"crc":"noCrc",
|
|
69
|
+
"limitMin": true,
|
|
70
|
+
"limitMinValue": 1,
|
|
71
|
+
"limitMax": false,
|
|
72
|
+
"limitMaxValue": 0,
|
|
73
|
+
"swap": false
|
|
60
74
|
},
|
|
61
75
|
{
|
|
62
76
|
"name": "Vicki_Max_Temperature",
|
|
@@ -72,7 +86,13 @@
|
|
|
72
86
|
"onClick": "030111",
|
|
73
87
|
"multiplyfaktor": "1",
|
|
74
88
|
"unit": "Grad",
|
|
75
|
-
"crc":"noCrc"
|
|
89
|
+
"crc":"noCrc",
|
|
90
|
+
"limitMin": true,
|
|
91
|
+
"limitMinValue": 1,
|
|
92
|
+
"limitMax": false,
|
|
93
|
+
"limitMaxValue": 0,
|
|
94
|
+
"swap": false,
|
|
95
|
+
"decimalPlaces": "0"
|
|
76
96
|
},
|
|
77
97
|
{
|
|
78
98
|
"name": "Vicki_Get_Infos",
|
|
@@ -88,7 +108,13 @@
|
|
|
88
108
|
"onClick": "041215184634",
|
|
89
109
|
"multiplyfaktor": "1",
|
|
90
110
|
"unit": "",
|
|
91
|
-
"crc":"noCrc"
|
|
111
|
+
"crc":"noCrc",
|
|
112
|
+
"limitMin": true,
|
|
113
|
+
"limitMinValue": 1,
|
|
114
|
+
"limitMax": false,
|
|
115
|
+
"limitMaxValue": 0,
|
|
116
|
+
"swap": false,
|
|
117
|
+
"decimalPlaces": "0"
|
|
92
118
|
},
|
|
93
119
|
{
|
|
94
120
|
"name": "Vicki_Motor_Callibration",
|
|
@@ -104,7 +130,13 @@
|
|
|
104
130
|
"onClick": "03",
|
|
105
131
|
"multiplyfaktor": "1",
|
|
106
132
|
"unit": "",
|
|
107
|
-
"crc":"noCrc"
|
|
133
|
+
"crc":"noCrc",
|
|
134
|
+
"limitMin": true,
|
|
135
|
+
"limitMinValue": 1,
|
|
136
|
+
"limitMax": false,
|
|
137
|
+
"limitMaxValue": 0,
|
|
138
|
+
"swap": false,
|
|
139
|
+
"decimalPlaces": "0"
|
|
108
140
|
},
|
|
109
141
|
{
|
|
110
142
|
"name": "Vicki_Child_Lock",
|
|
@@ -120,7 +152,13 @@
|
|
|
120
152
|
"onClick": "030111",
|
|
121
153
|
"multiplyfaktor": "1",
|
|
122
154
|
"unit": "",
|
|
123
|
-
"crc":"noCrc"
|
|
155
|
+
"crc":"noCrc",
|
|
156
|
+
"limitMin": true,
|
|
157
|
+
"limitMinValue": 1,
|
|
158
|
+
"limitMax": false,
|
|
159
|
+
"limitMaxValue": 0,
|
|
160
|
+
"swap": false,
|
|
161
|
+
"decimalPlaces": "0"
|
|
124
162
|
},
|
|
125
163
|
{
|
|
126
164
|
"name": "Vicki_Mode_2",
|
|
@@ -137,7 +175,12 @@
|
|
|
137
175
|
"multiplyfaktor": "1",
|
|
138
176
|
"unit": "",
|
|
139
177
|
"decimalPlaces": "1",
|
|
140
|
-
"crc":"noCrc"
|
|
178
|
+
"crc":"noCrc",
|
|
179
|
+
"limitMin": true,
|
|
180
|
+
"limitMinValue": 1,
|
|
181
|
+
"limitMax": false,
|
|
182
|
+
"limitMaxValue": 0,
|
|
183
|
+
"swap": false
|
|
141
184
|
}
|
|
142
185
|
]
|
|
143
186
|
}
|
|
@@ -456,11 +456,6 @@ class directorieshandlerClass {
|
|
|
456
456
|
deviceEUI: topicElements[3],
|
|
457
457
|
messageType: topicElements[topicElements.length - 1]
|
|
458
458
|
};
|
|
459
|
-
// clean up application id
|
|
460
|
-
const indexOfOrigin = topicResolved.applicationId.indexOf("@");
|
|
461
|
-
if(indexOfOrigin !== -1){
|
|
462
|
-
topicResolved.applicationId = topicResolved.applicationId.substring(0,indexOfOrigin);
|
|
463
|
-
}
|
|
464
459
|
return topicResolved;
|
|
465
460
|
}
|
|
466
461
|
catch(error){
|
|
@@ -11,6 +11,29 @@ class downlinkConfighandlerClass {
|
|
|
11
11
|
this.internalDevices = {
|
|
12
12
|
baseDevice: "internalBaseDevice"
|
|
13
13
|
};
|
|
14
|
+
|
|
15
|
+
this.downlinkParameterAttributs = {
|
|
16
|
+
"name": "",
|
|
17
|
+
"port": 1,
|
|
18
|
+
"priority": "NORMAL",
|
|
19
|
+
"type": "number",
|
|
20
|
+
"confirmed": false,
|
|
21
|
+
"front": "",
|
|
22
|
+
"end": "",
|
|
23
|
+
"lengthInByte": 3,
|
|
24
|
+
"on": "",
|
|
25
|
+
"off": "",
|
|
26
|
+
"onClick": "",
|
|
27
|
+
"multiplyfaktor": 1,
|
|
28
|
+
"unit": "",
|
|
29
|
+
"crc": "noCrc",
|
|
30
|
+
"limitMin": false,
|
|
31
|
+
"limitMinValue": 0,
|
|
32
|
+
"limitMax": false,
|
|
33
|
+
"limitMaxValue": 0,
|
|
34
|
+
"swap": false,
|
|
35
|
+
"decimalPlaces": "0"
|
|
36
|
+
};
|
|
14
37
|
}
|
|
15
38
|
|
|
16
39
|
/*********************************************************************
|
|
@@ -38,7 +61,8 @@ class downlinkConfighandlerClass {
|
|
|
38
61
|
// generate the Config without own objects
|
|
39
62
|
const ownConfig = [];
|
|
40
63
|
for(const downlinkConfig of Object.values(this.activeDownlinkConfigs)){
|
|
41
|
-
ownConfig.push(structuredClone(downlinkConfig))
|
|
64
|
+
ownConfig.push(structuredClone(downlinkConfig));
|
|
65
|
+
// delete internal structure (to compare with config)
|
|
42
66
|
delete ownConfig[ownConfig.length - 1].downlinkState;
|
|
43
67
|
}
|
|
44
68
|
// Add internal base downlinks
|
|
@@ -66,10 +90,21 @@ class downlinkConfighandlerClass {
|
|
|
66
90
|
const activeFunction = "addDownlinkConfigByType";
|
|
67
91
|
try{
|
|
68
92
|
// override standard with userconfig
|
|
69
|
-
config[downlinkConfig.deviceType] =
|
|
93
|
+
config[downlinkConfig.deviceType] = structuredClone(downlinkConfig);
|
|
70
94
|
config[downlinkConfig.deviceType].downlinkState = {};
|
|
71
|
-
for
|
|
72
|
-
|
|
95
|
+
// generate downlinkstates for internal use
|
|
96
|
+
for(const downlinkParameter of Object.values(config[downlinkConfig.deviceType].downlinkParameter)){
|
|
97
|
+
// check name for forbidden chars
|
|
98
|
+
downlinkParameter.name = downlinkParameter.name.replace(this.adapter.FORBIDDEN_CHARS,"_");
|
|
99
|
+
// check the downlinkparameters for all needed attributes and generate them if undefined
|
|
100
|
+
for(const attribute in this.downlinkParameterAttributs){
|
|
101
|
+
if(downlinkConfig.deviceType !== this.internalDevices.baseDevice && downlinkParameter[attribute] === undefined){
|
|
102
|
+
this.adapter.log.warn(`attribute ${attribute} in parameter ${downlinkParameter.name} at devicetype ${downlinkConfig.deviceType} generated`);
|
|
103
|
+
downlinkParameter[attribute] = this.downlinkParameterAttributs[attribute];
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
// assign downlinkparamter to internal structure
|
|
107
|
+
config[downlinkConfig.deviceType].downlinkState[downlinkParameter.name] = downlinkParameter;
|
|
73
108
|
}
|
|
74
109
|
}
|
|
75
110
|
catch(error){
|
|
@@ -98,20 +98,29 @@ class messagehandlerClass {
|
|
|
98
98
|
else if(stateCommonType === "ascii"){
|
|
99
99
|
stateCommonType = "string";
|
|
100
100
|
}
|
|
101
|
-
// declare min / max
|
|
101
|
+
// declare def / min / max
|
|
102
102
|
let stateCommonMin = undefined;
|
|
103
|
+
let stateCommonDef = 0; //just numbers
|
|
103
104
|
let stateCommonMax = undefined;
|
|
104
|
-
if(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
105
|
+
if(stateCommonType === "number"){
|
|
106
|
+
if(downlinkParameter.limitMin){
|
|
107
|
+
stateCommonMin = downlinkParameter.limitMinValue;
|
|
108
|
+
if(stateCommonMin > stateCommonDef){
|
|
109
|
+
stateCommonDef = stateCommonMin;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
else if(stateCommonType === "number"){
|
|
113
|
+
stateCommonMin = -1000000;
|
|
114
|
+
}
|
|
115
|
+
if(downlinkParameter.limitMax){
|
|
116
|
+
stateCommonMax = downlinkParameter.limitMaxValue;
|
|
117
|
+
if(stateCommonMax > stateCommonDef){
|
|
118
|
+
stateCommonDef = stateCommonMax;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
else if(stateCommonType === "number"){
|
|
122
|
+
stateCommonMax = 1000000;
|
|
123
|
+
}
|
|
115
124
|
}
|
|
116
125
|
await this.adapter.extendObjectAsync(`${deviceStartdirectory}.${this.directoryhandler.reachableSubfolders.downlinkControl}.${downlinkParameter.name}`,{
|
|
117
126
|
type: "state",
|
|
@@ -124,7 +133,7 @@ class messagehandlerClass {
|
|
|
124
133
|
unit: downlinkParameter.unit? downlinkParameter.unit:"",
|
|
125
134
|
min: stateCommonMin,
|
|
126
135
|
max: stateCommonMax,
|
|
127
|
-
def: stateCommonType === "boolean"? false : stateCommonType === "number"?
|
|
136
|
+
def: stateCommonType === "boolean"? false : stateCommonType === "number"? stateCommonDef: "",
|
|
128
137
|
},
|
|
129
138
|
native: {},
|
|
130
139
|
});
|