Create an Action to Send a Command to a Device (Classic)

This topic describes how to create an action to send a command to a device.

Before you begin

  1. Configure IQP MQTT to communicate with the device to which you want to send a command.
  2. Create a trigger based on an entity condition or a device condition.

About this task

You can also create an action to:

Procedure

  1. Access the event for which you want to create an action.
  2. Select Send Command to Device.
    The Send a command to a device section appears.
  3. Enter or select values as described in the following table.
    Field Name Description
    Function Select Send_MQTT_Command to send a command to a device that is configured with IQP MQTT. The Input Source and Value boxes appear for topic and payload.
    Input Source Select Fixed value if you want to send a fixed value to the device when the event is triggered.
    Value Enter the fixed value that you want to send to the device when the event is triggered.
    Allow End User to set value Select this check box if you want application users to set the value, and then enter a name in the Input Name box that appears.
    Scheduler Select one of the following options:
    • Take action only on initial trigger: Select this option if you want to send the command after switching from the state of not meeting the condition to meeting the condition. By default, this option is selected. For example, suppose you have created an action to send the command when the temperature recorded by a device exceeds 40 degrees Celsius. Suppose the temperature recorded by the device is as follows: 35, 38, 41, 45, 39, 42. In this scenario, the command is sent when the temperature is 41 and 42.
    • Take action on every trigger: Select this option if you want to send the command every time the event is triggered. For example, suppose you have created an action to send a command when the temperature recorded by a device exceeds 40 degrees Celsius. Suppose the temperature recorded by the device is as follows: 35, 38, 41, 45, 39, 42. In this scenario, the command is sent when the temperature is 41, 45, and 42.
  4. Select Save or Save and Exit.
    The event template is created.

Results

When the event is triggered, the command is sent to the MQTT broker.