You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -228,6 +242,39 @@ custom<small>Recommended if bytes or anything else will be received in response<
228
242
229
243
**Note**: You can specify multiple mapping objects inside the array.
230
244
245
+
Also, you can combine values from MQTT message in attributes, telemetry and serverSideRpc section, for example:
246
+
{% highlight json %}
247
+
{
248
+
{
249
+
"topicFilter": "/sensor/data",
250
+
"converter": {
251
+
"type": "json",
252
+
"deviceNameJsonExpression": "${serialNumber}",
253
+
"deviceTypeJsonExpression": "${sensorType}",
254
+
"timeout": 60000,
255
+
"attributes": [],
256
+
"timeseries": [
257
+
{
258
+
"type": "double",
259
+
"key": "temperature",
260
+
"value": "${temp}"
261
+
},
262
+
{
263
+
"type": "double",
264
+
"key": "humidity",
265
+
"value": "${hum}"
266
+
},
267
+
{
268
+
"type": "string",
269
+
"key": "combine",
270
+
"value": "${hum}:${temp}"
271
+
}
272
+
]
273
+
}
274
+
}
275
+
}
276
+
{% endhighlight %}
277
+
231
278
Mapping process subscribes to the MQTT topics using **topicFilter** parameter of the mapping object.
232
279
Each message that is published to this topic by other devices or applications is analyzed to extract device name, type and data (attributes and/or timeseries values).
233
280
By default, gateway uses Json converter, but it is possible to provide custom converter. See examples in the source code.
@@ -332,6 +379,7 @@ The "**attributeRequests**" configuration allows configuring the format of the c
332
379
333
380
|**Parameter**|**Default value**|**Description**|
334
381
|:-|:-|-
382
+
| retain |**false**| If set to true, the message will be set as the "last known good"/retained message for the topic |
335
383
| deviceNameFilter |**SmartMeter.\***| Regular expression device name filter, uses to determine, which function to execute. |
336
384
| attributeFilter |**uploadFrequency**| Regular expression attribute name filter, uses to determine, which function to execute. |
337
385
| topicExpression |**sensor/${deviceName}/${attributeKey}**| JSON-path expression uses for creating topic address to send a message. |
@@ -344,6 +392,7 @@ This section in configuration file looks like:
0 commit comments