MQTT Topics

Last Updated on : 2022-10-24 08:58:56download

Tuya MQTT protocol provides various turnkey protocol specifications to help you quickly implement the required features, including device models, sending and receiving data to and from the cloud, topology, OTA update, timer, remote configuration, file transfer, and Network Time Protocol (NTP). Stay tuned for more features.

Standard functions lower the bar for IoT project development, improve efficiency, and reduce the lead time.

This topic describes the publish topics and subscribe topics.

Publish topics

An IoT device can publish messages to the following topics for sending data or requests to the Tuya IoT Development Platform.

Feature Message type Topic
Get the model The device requests the definition of the device model. tylink/${deviceId}/thing/model/get
Report property values The device positively reports its properties. tylink/${deviceId}/thing/property/report
Send property values The device responds to the property setting. tylink/${deviceId}/thing/property/set_response
Report property values in bulk The device reports its property updates or those of the sub-devices in bulk. tylink/${deviceId}/thing/data/batch_report
Report events The device reports event-triggered messages. tylink/${deviceId}/thing/event/trigger
Perform actions The device returns the result of the operation. tylink/${deviceId}/thing/action/execute_response
Get online and offline The gateway reports the online status of its connected sub-devices. tylink/${deviceId}/device/sub/login
Get online and offline The gateway reports the offline status of its connected sub-devices. tylink/${deviceId}/device/sub/logout
Bind sub-devices The gateway requests activating the discovered sub-device and establishing a topological relationship. tylink/${deviceId}/device/sub/bind
Establish topological relationship The gateway adds the device topology. tylink/${deviceId}/device/topo/add
Delete topological relationship The gateway deletes the device topology. tylink/${deviceId}/device/topo/delete
Query topological relationship The gateway queries the topological relationship from the cloud. tylink/${deviceId}/device/topo/get
Update firmware via OTA The device reports the firmware version information. tylink/${deviceId}/ota/firmware/report
Update firmware via OTA The device requests information about silent updates. tylink/${deviceId}/ota/get
Update firmware via OTA The device reports the status and progress of the update. tylink/${deviceId}/ota/progress/report
Network time protocol (NTP) service The device requests to sync time with the NTP server. tylink/${deviceId}/ext/time/request
Daylight saving time (DST) service The device requests the DST service. tylink/${deviceId}/ext/time/request
Upload files The device requests the presigned URL to upload a file. tylink/${deviceId}/ext/file/upload/request
Download files The device requests the URL to download a file. tylink/${deviceId}/ext/file/download/request
Send the configuration file remotely A device gets the latest configuration file. tylink/${deviceId}/ext/config/get
Report custom format data The device sends custom format data to the cloud. tylink/${deviceId}/channel/raw/up

Subscribe topics

An IoT device can receive messages or commands that the Tuya IoT Development Platform publishes to the following topics.

Feature Message type Topic
Get the model The device receives the device model definition. tylink/${deviceId}/thing/model/get_response
Report property values The device receives a response to the reported property. tylink/${deviceId}/thing/property/report_response
Send property values The device receives the property values from the cloud. tylink/${deviceId}/thing/property/set
Report property values in bulk The device receives a response to the reported property in bulk. tylink/${deviceId}/thing/data/batch_report_response
Report events The device receives a response to the reported event message. tylink/${deviceId}/thing/event/trigger_response
Perform actions The device receives a command to perform an action. tylink/${deviceId}/thing/action/execute
Bind sub-devices The device receives a response to sub-device binding. Note that the sub-device does not need to subscribe to this topic. tylink/${deviceId}/device/sub/bind_response
Establish topological relationship The device receives a response to topological relationship establishment. Note that the sub-device does not need to subscribe to this topic. tylink/${deviceId}/device/topo/add_response
Delete topological relationship The device receives a response to topological relationship deletion. Note that the sub-device does not need to subscribe to this topic. tylink/${deviceId}/device/topo/delete_response
Query topological relationship The device receives a response to a topological relationship query. Note that the sub-device does not need to subscribe to this topic. tylink/${deviceId}/device/topo/get_response
Change topological relationship The device receives a topological relationship change. tylink/${deviceId}/device/topo/change
Update firmware via OTA The device receives an OTA firmware update. tylink/${deviceId}/ota/issue
Update firmware via OTA The device receives the information about silent updates. tylink/${deviceId}/ota/get_response
Network time protocol (NTP) service The device receives a response to the time sync request. tylink/${deviceId}/ext/time/response
Daylight saving time (DST) service The device receives the DST information. tylink/${deviceId}/ext/time/response
Upload files The device receives the presigned URL to upload a file. tylink/${deviceId}/ext/file/upload/response
Download files The device receives the URL to download a file. tylink/${deviceId}/ext/file/download/response
Send the configuration file remotely The device receives the configuration file. tylink/${deviceId}/ext/config/get_response
Send custom format data The device receives custom format data from the cloud. tylink/${deviceId}/channel/raw/down