Skip to content
Stand with Ukraine flag

Telemetry

Publish time-series data to ThingsBoard by sending a message to the telemetry topic. ThingsBoard stores each key-value pair as a time-series data point and makes it available in dashboards, rule chains, and the REST API. For connection parameters and credential types, see Getting Connected.

FormatTopic
Shortv2/t
Standardv1/devices/me/telemetry

ThingsBoard records the server receive time as the timestamp.

{"temperature": 22.5, "humidity": 61}

Use this when the device has a reliable clock and you want the exact measurement time stored. ts is a Unix timestamp in milliseconds.

{"ts": 1451649600512, "values": {"temperature": 22.5, "humidity": 61}}

Array of objects with client-side timestamp

Section titled “Array of objects with client-side timestamp”

Send multiple readings at different timestamps in a single publish.

[
{"ts": 1451649600000, "values": {"temperature": 22.5, "humidity": 61}},
{"ts": 1451649601000, "values": {"temperature": 22.7, "humidity": 60}}
]
TypeExample
String"value1"
Booleantrue
Double42.0
Long73
JSON object{"nested": {"key": "value"}}
JSON array[1, 2, 3]
Terminal window
mosquitto_pub -d -q 1 -h "$THINGSBOARD_HOST" -p 1883 -t "v2/t" -u "$ACCESS_TOKEN" -m '{"temperature": 22.5, "humidity": 61}'