Templating output by mustache
This section provides an exhaustive mapping of the JSON sensor payload schema to Mustache template tags, followed by integration rules for SMS (Plain Text) and Email (HTML) notification channels.
Let’s take this stored data output as an example: :
{
"metadata": {
"source": "urn:lo:nsid:lora:4883C7DF3001114B",
"encoding": "siconia_temperature_humidity_pressure",
"group": {
"path": "/",
"id": "root"
},
"device": {
"location": {
"provider": "static",
"lon": 2.545599,
"lat": 48.82198
}
},
"network": {
"lora": {
"rssi": -110,
"esp": -111.76,
"ack": false,
"fcnt": 27517,
"devEUI": "20635F0108000C8D",
"frequency": 868.5,
"signalLevel": 5,
"gatewayCnt": 5,
"sf": 10,
"messageType": "UNCONFIRMED_DATA_UP",
"port": 10,
"snr": 3,
"location": {
"provider": "lora",
"alt": 0,
"accuracy": 10000,
"lon": 2.526197,
"lat": 48.83361
},
"roaming" : {
"operatorNetId": "600031",
"operatorName": "Stratis IoT"
},
"missingFcnt": 0
}
}
},
"streamId": "urn:lora:20635F0108000C8D!uplink",
"created": "2021-05-30T19:02:46.789Z",
"extra": {
"_outdoor_source_alt_lat_lon",
},
"location": {
"provider": "static",
"alt": null,
"accuracy": null,
"lon": 2.545599,
"lat": 48.82198
},
"model": "lora_v0",
"id": "60b3e15603b409370d2d2b10",
"value": {
"payload": "e17aae4133333942bc8b0100",
"temperature": 21.81,
"humidity": 46.3,
"pressure": 1013.08
},
"timestamp": "2021-05-30T19:02:46.161Z",
"tags": []
}
Exhaustive JSON field mapping
Root variables
| JSON Path | Mustache Tag | Data Type | Description |
|---|---|---|---|
|
|
String |
Unique identifier of the devicce. |
|
|
String |
Unique identifier of the data stream. |
|
|
String |
Data model identifier for datamessage indexing. |
|
|
String (ISO Date) |
Datamessage insertion timestamp. |
|
|
String (ISO Date) |
Datamessage push timestamp (Device). |
Telemetry readings (value)
| JSON Path | Mustache Tag | Data Type | Description |
|---|---|---|---|
|
|
String (Hex) |
Raw uplink payload from the device (lora). |
|
|
Float |
Measured ambient temperature. |
|
|
Float |
Measured relative humidity percentage. |
|
|
Float |
Measured atmospheric pressure in hPa. |
Device geolocation (location)
| JSON Path | Mustache Tag | Data Type | Description |
|---|---|---|---|
|
|
String |
Type of location solver used. |
|
|
Null |
Altitude (if resolved). |
|
|
Null |
Accuracy radius (if resolved). |
|
|
Float |
Longitude coordinates. |
|
|
Float |
Latitude coordinates. |
General metadata (metadata)
| JSON Path | Mustache Tag | Data Type | Description |
|---|---|---|---|
|
|
String |
Source identifier of the device. |
|
|
String |
Decoder identifier. |
|
|
String |
Group path in the asset tree. |
|
|
String |
Group ID in the asset tree. |
|
|
String |
Device location provider. |
|
|
Float |
Provisioned longitude. |
|
|
Float |
Provisioned latitude. |
LoRaWAN network infos (metadata.network.lora)
| JSON Path | Mustache Tag | Data Type | Description |
|---|---|---|---|
|
|
String |
End-device unique global identifier. |
|
|
String |
LoRaWAN MType layer classification. |
|
|
Integer |
LoRaWAN FPort. |
|
|
Integer |
Datamessage uplink counter (povided by device). |
|
|
Integer |
Count of dropped datemessages detected. |
|
|
Integer |
Received Signal Strength Indicator (dBm). |
|
|
Integer |
Signal-to-Noise Ratio (dB). |
|
|
Float |
Estimated Signal Power (dBm). |
|
|
Integer |
Computed link quality metric. |
|
|
Integer |
Spreading Factor configuration. |
|
|
Float |
Uplink channel frequency in MHz. |
|
|
Integer |
Number of gateways that demodulated the device datamessage trafic. |
|
|
Boolean |
Acknowledgment requirement flag. |
LoRa network-based geolocation
| JSON Path | Mustache Tag | Data Type | Description |
|---|---|---|---|
|
|
String |
Network triangulation provider. |
|
|
Integer |
Estimated altitude. |
|
|
Integer |
Network accuracy radius in meters. |
|
|
Float |
Network estimated longitude. |
|
|
Float |
Network estimated latitude. |
Network operator (Roaming)
| JSON Path | Mustache Tag | Data Type | Description |
|---|---|---|---|
|
|
String |
Network Operator NetID. |
|
|
String |
Human-readable roaming operator name. |
Line break implementation guidelines
Because Mustache is logic-less, it cannot format line breaks automatically. Developers must structuralize the template or pre-format variables according to the specific protocol layout restrictions.
Channel A: SMS notifications (Plain Text)
SMS clients parse standard text line breaks natively.
-
Rule: Insert literal newlines directly inside the Mustache template editor, or feed strings containing escaped
\ncharacters from the JSON backend.
[ALERT] Device {{metadata.network.lora.devEUI}}
Temp: {{value.temperature}}°C
Humidity: {{value.humidity}}%
Channel B: Email notifications (HTML Format)
Email applications completely discard text file carriage returns (\n) or template editor newlines inside HTML bodies, causing text to collapse into a single horizontal block.
-
Rule: Explicitly inject
<br />HTML tags to establish vertical line breaks. -
Security Notice: If the JSON source string injects raw HTML snippets (like
<br />) within an incoming variable, bypass standard Mustache sanitization escaping by wrapping the property using triple curly braces ({{{variable}}}) instead of double ones.
<h3>Sensor Report</h3>
<p>
<strong>Device EUI:</strong> {{metadata.network.lora.devEUI}}<br />
<strong>Temperature:</strong> {{value.temperature}} °C<br />
<strong>Pressure:</strong> {{value.pressure}} hPa
</p>