Skip to main content

Kafka

Overview

Truvami supports forwarding decoded messages to your own Kafka cluster. All messages are serialized as JSON. Each Kafka message is wrapped using a consistent envelope format and includes a schema version number.

Kafka Message Envelope

{
"data": {
// message content (see below)
},
"version": 1
}

This allows forward compatibility with future schema versions.


Message Types

Represents an uplink transmission from a device, including raw payload and radio metadata.

FieldTypeNullableDescription
uuidstringNoUnique identifier for the uplink
devEuistringNoDevice EUI (unique identifier)
customerstringYesCustomer ID
payloadstringNoHex-encoded payload data
portnumberNoPort number used for the uplink
uplinkCounternumberNoUplink counter for deduplication
downlinkCounternumberYesDownlink counter for deduplication
consumedAirtimenumberYesAirtime consumed by the uplink
bestSnrnumberYesBest Signal-to-Noise Ratio
worstSnrnumberYesWorst Signal-to-Noise Ratio
averageSnrnumberYesAverage Signal-to-Noise Ratio
bestRssinumberYesBest Received Signal Strength Indicator
worstRssinumberYesWorst Received Signal Strength Indicator
averageRssinumberYesAverage Received Signal Strength Indicator
spreadingFactornumberNoSpreading factor used for the uplink (SF7 - SF12)
confirmedbooleanNoWhether the uplink is confirmed
receivedAtstringNoTimestamp when the uplink was received (RFC 3339 format)
dutyCyclebooleanYesWhether duty cycle is applied

Example:

{
"data": {
"uuid": "126cd4ea-4c15-4cd7-b2a0-9860b5088fc2",
"devEui": "10CE45FFFE01xxxx",
"customer": "126cd4ea-4c15-4cd7-b2a0-9860b5088fc2",
"payload": "hex-string",
"port": 1,
"uplinkCounter": 123,
"downlinkCounter": 12,
"consumedAirtime": 0.56,
"bestSnr": 10.2,
"worstSnr": -3.4,
"averageSnr": 5.3,
"bestRssi": -45.0,
"worstRssi": -105.0,
"averageRssi": -78.6,
"spreadingFactor": 12,
"confirmed": true,
"receivedAt": "2025-08-06T12:00:00Z",
"dutyCycle": false
},
"version": 1
}

Event

Describes a device-level event such as button press or reset.

FieldTypeNullableDescription
uuidstringNoUnique identifier for the event
devEuistringNoDevice EUI (unique identifier)
typenumberNoEvent type (see EventType enum below)
customerstringYesCustomer ID
receivedAtstringNoTimestamp when the event was received (RFC 3339 format)
occurredAtstringNoTimestamp when the event occurred (RFC 3339 format)
uplinkstringNoUplink ID associated with the event

Example:

{
"data": {
"uuid": "126cd4ea-4c15-4cd7-b2a0-9860b5088fc2",
"devEui": "10CE45FFFE01xxxx",
"type": 7,
"customer": "126cd4ea-4c15-4cd7-b2a0-9860b5088fc2",
"receivedAt": "2025-07-29T15:12:25.243406716Z",
"occurredAt": "2025-07-29T14:19:02Z",
"uplink": "126cd4ea-4c15-4cd7-b2a0-9860b5088fc2"
},
"version": 1
}

type enum values (EventType)

ValueMeaning
0Unspecified
1ButtonPress
2ConfigChange
3ManualDeviceReset
4AutomaticDeviceReset
5DutyCycle
6FirmwareChange
7RotationStatePouring
8RotationStateMixing
9RotationStateError
10RotationStateUndefined

RotationStatus

Describes a transition between rotation states (e.g., from mixing to pouring).

FieldTypeNullableDescription
uuidstringNoUnique identifier for the rotation status
devEuistringNoDevice EUI (unique identifier)
customerstringYesCustomer ID
uplinkstringNoUplink ID associated with the rotation status
lastStatenumberNoPrevious rotation state (see RotationStatusType enum below)
newStatenumberNoNew rotation state (see RotationStatusType enum below)
rotationsnumberYesNumber of rotations completed during the state transition
elapsedSecondsnumberNoTime elapsed during the state transition in seconds
receivedAtstringNoTimestamp when the rotation status was received (RFC 3339 format)
capturedAtstringNoTimestamp when the rotation status was captured (RFC 3339 format)
sequenceNumbernumberNoSequence number for deduplication

Example:

{
"data": {
"uuid": "126cd4ea-4c15-4cd7-b2a0-9860b5088fc2",
"devEui": "10CE45FFFE01xxxx",
"customer": "126cd4ea-4c15-4cd7-b2a0-9860b5088fc2",
"uplink": "126cd4ea-4c15-4cd7-b2a0-9860b5088fc2",
"lastState": 1,
"newState": 2,
"rotations": 2.5,
"elapsedSeconds": 60,
"receivedAt": "2025-08-06T12:00:00Z",
"capturedAt": "2025-08-06T11:59:50Z",
"sequenceNumber": 42
},
"version": 1
}

lastState / newState enum values (RotationStatusType)

ValueMeaning
0undefined
1pouring
2mixing
3error

Position

Provides location data captured by the device (GNSS, LoRa, Wi-Fi, BLE).

FieldTypeNullableDescription
uuidstringNoUnique identifier for the position
devEuistringNoDevice EUI (unique identifier)
customerstringYesCustomer ID
uplinkstringNoUplink ID associated with the position
latitudenumberNoLatitude in decimal degrees
longitudenumberNoLongitude in decimal degrees
altitudenumberYesAltitude in meters
accuracynumberYesHorizontal accuracy in meters
sourcenumberNoSource of position data (see PositionSource enum below)
movingbooleanYesWhether the device is moving
bufferedbooleanNoWhether the position is buffered
bufferLevelnumberYesBuffer level indicating how full the buffer is
receivedAtstringNoTimestamp when the position was received (RFC 3339 format)
capturedAtstringNoTimestamp when the position was captured (RFC 3339 format)
ttfnumberYesTime to first fix in seconds
pdopnumberYesPosition Dilution of Precision (PDOP) value
satellitesnumberYesNumber of satellites used for the position fix

Example:

{
"data": {
"uuid": "126cd4ea-4c15-4cd7-b2a0-9860b5088fc2",
"devEui": "10CE45FFFE01xxxx",
"customer": "126cd4ea-4c15-4cd7-b2a0-9860b5088fc2",
"uplink": "126cd4ea-4c15-4cd7-b2a0-9860b5088fc2",
"latitude": 4.13743,
"longitude": 2.57549,
"altitude": 520.5,
"accuracy": 3.2,
"source": 0,
"moving": true,
"buffered": false,
"bufferLevel": 0,
"receivedAt": "2025-08-06T12:00:00Z",
"capturedAt": "2025-08-06T11:59:30Z",
"ttf": 8,
"pdop": 1.5,
"satellites": 6
},
"version": 1
}

source enum values (PositionSource)

ValueMeaning
0gnss
1lora
2wifi
3ble

BatteryStatus

Provides battery voltage readings.

FieldTypeNullableDescription
uplinkstringNoUplink ID associated with the battery status
devEuistringNoDevice EUI (unique identifier)
customerstringYesCustomer ID
voltagenumberNoBattery voltage in volts
receivedAtstringNoTimestamp when the battery status was received (RFC 3339 format)
capturedAtstringNoTimestamp when the battery status was captured (RFC 3339 format)

Example:

{
"data": {
"uplink": "126cd4ea-4c15-4cd7-b2a0-9860b5088fc2",
"devEui": "10CE45FFFE01xxxx",
"customer": "126cd4ea-4c15-4cd7-b2a0-9860b5088fc2",
"voltage": 3.65,
"receivedAt": "2025-08-06T12:00:00Z",
"capturedAt": "2025-08-06T11:59:55Z"
},
"version": 1
}

Additional Notes

  • Timestamps use RFC 3339 format and are in UTC.
  • Enum values are serialized as integers.
  • All messages are wrapped using the same envelope structure containing a data object and a version field.