Skip to main content
Documentation v2.0
Ruang IoT MQTT topics/docs/mqtt/topics

MQTT

Stable

Ruang IoT MQTT topics

Use the MQTT v2 topic structure for telemetry, commands, and status.

On this page4 sections

Topic structure

TEXT topic.txt
PROJECT_ID/DEVICE_ID/telemetry/VARIABLE
PROJECT_ID/DEVICE_ID/command/VARIABLE
PROJECT_ID/DEVICE_ID/status/VARIABLE

Examples

Purpose Topic
Send temperature PROJECT_ID/esp32-01/telemetry/temperature
Control a relay PROJECT_ID/esp32-01/command/relay
Relay status PROJECT_ID/esp32-01/status/relay

Topic rules

  • Use the matching Project ID and Device ID.
  • Don't add a leading or trailing slash.
  • The variable must match the one registered in the project.
  • Avoid wildcards when publishing from a device.

QoS and retained messages

Use the QoS level that fits your needs. Use retained messages only when new subscribers really must receive the last status; avoid retained messages for high-frequency telemetry.

Documentation feedback

Was this article helpful?

Documentation search

What do you want to learn?

Type at least two characters to search the documentation.
Code copied.