/tenants/{tenant_id}/devices/{device_id}/actions
to receive actions and publish the reponse to
/tenants/{tenant_id}/devices/{device_id}/action/status
in JSON array format.print
has been created that prints the payload:
{tenant_id}
with your project name and {device_id}
with the device id.
demo
, tries to subscribe to topic with other tenant, say mytenant
,
e.g. /tenants/mytenant/devices/1/actions
id
: An unique identifier generated for this event which will be used to ack back.name
: Name of the action that is triggeredpayload
: Optional payload that is provided while triggering the actionid
: Must be a string and the same id
which was received with actiontimestamp
: Timestamp in millisecondsstate
: can be any text to indicuate current status.
e.g. A long running commands, like OTA, might have multiple states “Downloading”, “Updating ECU 1”, “Updating ECU 2” so on so forth as statuses."Failed"
and "Completed"
are special terminal states that indicate that the action is completeerrors
: is an array of strings and is looked at only if the state
is sent as "Failed"
. The UI displays these errors. e.g. ["File not found"]
progress
: Percentage in range 0 to 100 indicating progress within a given state. e.g. if state
is “Downloading” and progress
is 50 it means 50% of Downlaod is complete.progress
is ignored if state
is "Completed"
or "Failed"
"Received"
to notify the server that the action is received is optional but a good practice.
Send "Completed"
or "Failed"
status at the end of the action.+ New Subscription
button:
kind
. That field has been deprecated.
You can send progress back as shown below:
demo
and device id 2
to your tenant and device id
You should now be able to see the action as completed on the UI