This section details an essential part of the provided functionalities - remote management via commands. This is the only part of the messaging protocol where the request comes from the backend and the response (hence action confirmation) comes from the device and is mandatory. Supported Control Unit actions are explicitly defined in the Control Unit Metadata with an id and optional input/output arguments - for more information see the Control Unit Metatyping page.

Request

Topic

device/<device-type>/<device-id>/<token>/invoke

Payload

{
  "actionId" : <string>,
  "instructionId" : <string>,
  "cuType" : <string>,
  "cuId" : <string>,
  "actionArgs" : <object[]>
}
  • "actionId" - this field will always be included and will contain the action id, as declared in the Control Unit Metadata  - for detailed information see Control Unit Metatyping.

  • "instructionId" - this field will always be included and will contain a unique id, which must be sent back as a confirmation of the completed action.

  • "cuType" - this field will always be included and will contain the Control Unit type of the action's target.

  • "cuId" - this field will be included only when the action's target is an existing Control Unit, that is, it won't be included for actions like "create/add component", where the Control Unit id is not yet known. In these cases, if required, an id could be sent in the "actionArgs" field as an input argument for the command.

  • "actionArgs" - this field will be included only when input arguments are required for the action (explicitly declared in the Metadata) and will contain an array of those arguments.

Response

Topic

backend/<device-type>/<device-id>/invoke

Payload

{
  "cuId" : <string>,
  "instructionId" : <string>
}
  • "cuId" - this field is mandatory and must contain the Control Unit id of the action's target. In case of an action that adds/creates new component or sub-component, this field must contain the id of the newly created Control Unit.

  • "instructionId" - this field is mandatory and must contain the same instruction id which was sent with the action request, in order to correctly confirm the action as completed.