Sensorclouds
Commands

Sending Commands

Send a command from the device page or a dashboard toggle

ADMIN ENGINEER

You can send a command in two ways: by hand from a device's Messaging tab, or with a Toggle widget on a dashboard.

Before you begin

  • Your device firmware must subscribe to its Commands topic and acknowledge each command on its Command ACK topic. See Command Lifecycle.
  • The device should be online. Commands sent to an offline device usually end as TIMEOUT.

From the device's Messaging tab

Open the device and select the Messaging tab (Device Commands).

Click Send Command. The Send Command to [device] dialog opens.

Enter the Command name, for example SET_CONFIG or setInterval.

Enter Parameters (JSON), for example {"seconds": 30}. This field is required: use {} for commands without parameters.

Click Send Command.

The command appears at the top of Command History as PENDING, then SENT, then ACKNOWLEDGED once the device replies.

The Send Command dialog

Sensorclouds doesn't define a list of commands. Each device understands only the commands its firmware implements, so agree on the names and parameters with your firmware developer.

From a dashboard toggle

A Toggle widget sends a preset command when it's switched:

  • The command name and the on/off values are set when the widget is configured.
  • An optional confirmation step prevents accidental switching.
  • The switch moves immediately and rolls back if the command fails or times out.
  • Recent toggle commands appear in the dashboard's Command history.

See Widget Types → Toggle.

Rules for commands

ItemRule
Command nameLetters, numbers, and _ - . :. Up to 100 characters
ParametersA JSON object, up to 3 levels deep
Reserved namesota:update, ota:rollback (used by OTA campaigns)
Device must beConnected and subscribed to /cmd to receive it

Troubleshooting

Message or symptomCauseFix
Command name must not exceed 100 characters, or the name is refusedThe name is too long or has characters other than letters, numbers, and _ - . :Shorten or rename the command
The parameters are refusedThey aren't valid JSONCheck quotes and braces. Use {} for no parameters
Stays SENT, then TIMEOUTThe device didn't receive it, or didn't acknowledge it within 5 minutesCheck that the device is online and subscribed to its Commands topic, and that it publishes an ACK with the same commandId
FAILED although the device did the workThe ACK didn't say successReply with "status": "ok" or "success": true. "status": "success" counts as a failure
Commands sent while the device was offline never arriveThe broker doesn't keep them for a clean sessionSend again once the device is online, or see MQTT Settings → Clean session

Next Steps

On this page