TRW

Description of the device
The model TRW is a radio-based resistance thermometer for monitoring medium temperatures of all types. Resistance thermometers in this series can be installed directly into the process or combined with a large number of thermowell designs. It uses the licence-free LoRaWAN® and Bluetooth® radio standards and is used, for example, on mobile equipment and remote measuring points. Thanks to intelligent measurement and transmission control and a replaceable battery, the sensor can be operated for years without maintenance.
For more information see product site.
NETRIS1 Parser Quick Start
Parser API
All functions are pure (no global mutation) except setMeasurementRanges which updates internal range configuration for subsequent decodes.
Types:
Input types:
interface UplinkInput {
fPort: number // LoRaWAN FPort
bytes: number[] // Raw payload as array of unsigned bytes (0-255)
recvTime?: string // Optional ISO timestamp (if your LNS provides it)
}
interface HexUplinkInput {
fPort: number // LoRaWAN FPort
bytes: string // Raw payload as hex-encoded string (case-insensitive, even length)
recvTime?: string // Optional ISO timestamp (if your LNS provides it)
}Return type (shared by all decode helpers):
type Result = {
data: Record<string, any> // Parsed key/value pairs
warnings?: string[] // Non-fatal anomalies
} | {
errors: string[] // Fatal or structural issues only
}To understand the data field, take a look at the examples and the schema definition.
Supported channels to identify different sensors by:
// Is used in the returned data
type ChannelName = 'temperature'Channels that support adjusting the measurement range:
type AdjustableChannelName = 'temperature'Channel Configuration:
| Channel Name | Default Min | Default Max | Unit | Configurable |
|---|---|---|---|---|
temperature | 0 | 10 | °C/°F | Yes |
*Unit and range depend on device configuration (supports various sensor types). Check device specifications or identification frames for actual unit and range.
decodeUplink(input)
function decodeUplink(input: UplinkInput): ResultdecodeHexString(hexInput)
function decodeHexString(hexInput: HexUplinkInput): DecodeResultbytes must have even length; case-insensitive.
setMeasurementRanges(channel, range)
// Will throw on invalid channel name or if the channel disallows range updates
function setMeasurementRanges(
channelName: AdjustableChannelName,
range: {
start: number
end: number
}
): voidApplies to future decodes only.
adjustRoundingDecimals(decimals)
// Smartly adjust number of decimals for rounded values
// Impacts all numeric values in all outputs
// Default is 4
function adjustRoundingDecimals(decimals: number): voidApplies to future decodes only.
Verifying Measurement Ranges
Critical: The default temperature range (0-10) is a placeholder and likely does not match your device. TRW devices are highly configurable and support various sensor types. Always verify the actual range and unit from one of these sources:
- Device specifications from your purchase order or datasheet
- Identification frames sent by the device after activation
Using incorrect ranges will result in incorrect measurement values in all data messages.
TULIP3 Identification Frames
For devices using TULIP3 protocol, identification messages (message type 20/0x14, subtype 1/0x01) report the actual configuration:
Example TULIP3 identification frame:
{
"data": {
"messageType": 20,
"messageSubType": 1,
"identification": {
"sensor1": {
"channel1": {
"measurand": "Temperature",
"unit": "°C",
"minMeasureRange": -40,
"maxMeasureRange": 85,
"channelName": "temperature"
}
}
}
}
}TULIP2 Identification Frames
For devices using TULIP2 protocol, identification messages (message type 6/0x06) report similar information:
Example TULIP2 identification frame:
{
"data": {
"messageType": 6,
"configurationId": 1,
"productIdName": "TRW",
"channels": [
{
"channelId": 0,
"channelName": "temperature",
"measurementRangeStart": -40,
"measurementRangeEnd": 85
}
]
}
}Quick Start
- Check your device's actual measurement range and unit from purchase configuration, device specifications, or identification frames (see above)
- Add configuration code below at the bottom of your parser file
- Add wrapper function if your network server is non-compliant:
function decode(input) { return decodeUplink(input) }
Configuration code (add at bottom of parser file):
// Replace values with your device's actual measurement range from specifications or identification frames
setMeasurementRanges('temperature', { start: -40, end: 85 })NPM Module Inclusion
| Device | Included | Factory function |
|---|---|---|
| TRW | ❌ | ❌ |
