Commands

Tinamous commands allow an instruction to be sent to your Thing.
An example of a command would be: Switch the output on.
The command function might be SwitchOnOutput, with a payload or 1, 2, 3 etc for the output number to switch on.

Commands come in various forms:

  • Adhock commands - you enter the command function and payload and send it once.
  • Pre-defined device commands - you can set-up some commands associated with a device that can be run as standalone commands
  • Pre-defined device commands with user payload - you can set-up some commands leaving the payload empty to be provided when the command is invoked
  • Pre-defined group commands - These are commands created and associated with a set of devices (pre-set or tagged).

Commands can be received in a number of ways.

  • REST API: Requesting a list of commands to execute (specifying a since date so already executed commands are ignored.)
  • MQTT: By subscribing to the Commands topic (/Tinamous/V1/Commands/[DeviceName]) See the Tinamous MQTT Server help page for more information.
  • Particle Devices: Not implemented yet but function name will map to the Particle function, and payload to the argument to pass.
  • Sigfox: not implemented yet, command will set the downlink message (or part of).

Command composition:
  • Name: User friendly name (e.g. Turn on the lights)
  • Description: What it does - for your reference only.
  • FunctionName: The function to call:
    • MQTT: This is appened to the topic. e.g. your function might be "Fans/Speed", resulting in a topic of "/Tinamous/V1/Commands/[DeviceName]/Fans/Speed"
    • Particle: This should be the name of the Particle function.
    • REST: Will simply be exposed as the function name you've specified.
  • Payload: Leave empty for setting at invokation time. e.g. for fan speed an empty payload will allow the user to input a value to set
    • MQTT: This is passed as the payload (utf-8 encoded to a byte array)
    • Particle: This is passed as the argument to the Particle.function.
    • REST: Exposed simply as payload.
    • Sigfox: Will be used for the downlink message. It must be the correct length and be hex characters only (0-f).