Commands

Overview

Allow users to send custom commands to devices.

The commands supported for each device model can be defined via the Supported Commands tab of the model details page, within the partners portal (Configuration -> Models -> select model). Each command may have optional dynamic parameters or a required file (filtered by filetype).

Commands sent to a device by the user are queued (in order) on the server and are received one at a time by the device. (Multiple commands are never sent to a device at once).

Workflow

  1. Each time a device sends telemetry via the Send Telemetry API, it should check the value of the command field in the reply:
    a. If command = false, no command is pending and nothing needs to be done.
    b. If command = true, continue to the next step.
  2. Use the Get Command API to get the command parameters.
  3. Save the command ID from the Get Command API's response to update the command's status.
  4. [Optional, for long-running commands] Use the Update Command API to set the status to in_progress. This will let the user know the device received the command and started processing it.
  5. After the command has completed, update the server with the status via the Update Command API.

Flow diagram