Telemetry
Publish telemetry for one or more downstream devices in a single message. Each device entry is an array of objects — either timestamped value objects, or plain key-value objects if you want the server to assign the receive time.
Topic: v1/gateway/telemetry
Provide your own timestamp using the ts and values keys:
{ "Device A": [ {"ts": 1483228800000, "values": {"temperature": 42, "humidity": 80}}, {"ts": 1483228801000, "values": {"temperature": 43, "humidity": 82}} ], "Device B": [ {"ts": 1483228800000, "values": {"temperature": 42, "humidity": 80}} ]}Omit ts to have the server assign the receive time. In this case, do not use the values wrapper — place the telemetry key-value pairs directly inside the object in the array:
{ "Device A": [ {"temperature": 42, "humidity": 80} ], "Device B": [ {"temperature": 42, "humidity": 80} ]}| Field | Required | Description |
|---|---|---|
ts | No | Unix timestamp in milliseconds. If present, the array object must also use the values wrapper. If omitted, the server assigns the receive time and the telemetry keys go directly inside the array object. |
values | No | Key-value map of telemetry fields. Required only when ts is present. |
Replace GATEWAY_DEVICE_ACCESS_TOKEN in the commands below with the gateway device’s access token.
mosquitto_pub -h "mqtt.eu.thingsboard.cloud" -t "v1/gateway/telemetry" -u "GATEWAY_DEVICE_ACCESS_TOKEN" -m '{"Device A":[{"ts":1700000000000,"values":{"temperature":23.5,"humidity":61}}],"Device B":[{"ts":1700000000000,"values":{"temperature":24.1,"humidity":58}}]}'mosquitto_pub -h "mqtt.eu.thingsboard.cloud" -t "v1/gateway/telemetry" -u "GATEWAY_DEVICE_ACCESS_TOKEN" -m '{"Device A":[{"temperature":23.5,"humidity":61}],"Device B":[{"temperature":24.1,"humidity":58}]}'Was this helpful?
Thank you for your feedback!