跳到主要内容

What is the command-response framework? How is it different from get/set params?

The Command-Response framework is an alternative to the set-params workflow for sending data from clients (phone app, CLI) to devices. With get/set params, commands are delivered in real time over MQTT—the device must be online, and there is no built-in way to get the status of a request or to queue commands for when the device comes back online.

Key differences:

FeatureGet/Set ParamsCommand-Response
DeliveryReal-time; device must be onlineCloud queues; device fetches when online
Offline supportMessage lost if device offlineRequest stored; executed when device connects
Request statusFire-and-forget; no explicit statusQuery status (requested, in_progress, success, timed_out, failure)
ValiditySent once, delivered or droppedConfigurable timeout (e.g. up to 30 days or never expire)
Access controlParameter-levelUser-role aware (super admin, primary, secondary)

Typical use cases: Scenes and schedules (so they run even if the device was offline when triggered), device state recovery after power loss (device queries last command from cloud), and any flow where you need reliable delivery or request status. Enable via CONFIG_ESP_RMAKER_CMD_RESP_ENABLE=y. For details, see Command-Response and Command-Response Usage.