To send a command to an IoT device and know it arrived, store it as a request with an id, have the device answer on that id, and follow its state until it ends. Hermetry’s Commands tab (2.2.0, 22 October 2026) shows each command move from Queued through Sent and Delivered to Successful, Failed or Timed out.
Fire-and-forget is fine for a reading. For a command that starts a pump or reboots a gateway, the operator needs a clear answer: did it get there, and did it work?
What does each command state tell you?
Each state answers one part of that question. Hermetry stores every command as a request and moves it through these states:
| State | Meaning |
|---|---|
| Queued | Stored, waiting for the device |
| Sent | Sent to the device |
| Delivered | The device received it |
| Successful | The device answered with success |
| Failed | The device answered with an error |
| Timed out | No answer arrived in time |
| Expired | It expired before it could be delivered |
| Cancelled | Someone cancelled it |
Timed out is the state people misread. It means no answer arrived, not that the command did not run, and Hermetry shows it as “No answer: the outcome is unknown”. I would check the device before sending the same command again.
How do you send a command from the device page?
Use the device’s Commands tab, which offers the commands in the device profile’s catalog. The catalog is set up per profile, next to the profile’s other settings.
- Open the device and its Commands tab.
- Pick a command under Choose a command and fill in its Parameters.
- Set the Answer timeout (seconds), 1 to 600; without one, the command’s or the profile’s default applies, else 10 seconds.
- For a device that may be offline, turn on Deliver when the device comes back (persistent) and set Give up after (24 hours by default, at most 7 days).
- Select Send. A high-impact command asks for a confirmation first.
Without persistent, a command to an offline device fails at once, and the tab warns about that before you send. The History then lists each command with its status, who or what sent it, and its duration, for 90 days.
What must the device do to close the loop?
Subscribe, answer on the same id, and never run one id twice. Over MQTT the device subscribes to v1/rpc/req/+ and answers a two-way command on the matching response topic:
PUBLISH v1/rpc/req/42
{"method": "sys.ping", "params": {"host": "192.0.2.10", "count": 3}}
PUBLISH v1/rpc/res/42
{"ok": true, "result": {"sent": 3, "received": 3, "avg_ms": 18.2}}
A command may arrive twice, so the device should remember at least the last 32 request ids for 10 minutes. Commands are delivered only after the subscription on the current connection, which means subscribing again after every connect, and they travel only over TLS sessions unless the profile allows a command in clear. A long job is accepted at once with a job_id and its result reported later in the rpc_result attribute. The topic basics are in MQTT for industrial devices.
How do you know the command did what you asked?
Successful means the device answered with success; it does not prove that the valve moved. Read the effect back from the device’s own telemetry, and if nothing changed physically, check the device side.
Other systems can follow the same outcome without polling: the webhook event rpc.completed fires when a command ends Successful, and rpc.failed when it ends Failed, Timed out or Expired. High-impact and raw commands are written to the audit log when they are created and when they end. The full state reference is on sending commands to devices, and stuck commands are covered in commands do not reach the device.
Frequently asked questions
Can I send a command to a Hermetry device from my own software?
Yes, with the commands API: POST /api/iot/devices/{deviceId}/rpc with a method and parameters. A two-way, non-persistent command with a timeout of at most 30 seconds waits for its end and answers 200; any other call answers 202 at once, and you read the result later by the command’s id.
How many commands can I send to one device?
By default 10 commands per device per minute and 600 per organisation per minute. Parameters can be up to 16 KiB of JSON and an answer up to 64 KiB. Commands that flows send to one device are limited separately, to 30 a minute by default.
Can I cancel a command after sending it?
Yes, while it is Queued or Sent. Open the command in the Commands tab’s History and select Cancel command; through the API, POST to the command’s cancel route. A cancelled command ends in the state Cancelled, and a cancel through the API is audited.

