Configuring Fields: Commands

Configuring Fields: Commands

This guide explains the various fields you will encounter when creating a command. Each section details the options available and includes examples for clarity.
 
Below is a tabulation of common fields applicable to all input types.

Field
Description
Example
Command Name
An identifier label for the command
AC ON/OFF, Room Temperature
Input Type
Specifies the type of user interface component to be used for executing the command.

Options:
Toggle, Slider, Picklist, Buttons, Numeric.
 
Command Key
The key or identifier used to extract data from an incoming data stream. A command key helps the edge device identify the command executed and initiate appropriate actions.
temp_c
Status
Options:

On: The command is active and can send the payload to the connected         device.

Off: The command is inactive and cannot be executed or send any payload.
 

Configure: Toggle ON/OFF

Description: A straightforward toggle that lets you switch between two states for controlling a resource.Users can define specific values for each state based on their needs.
 
By default, the toggle includes two states: "On" and "Off," with corresponding values of "on" and "off." These defaults can be customised to match the desired configuration.

Editing the Name

To modify the name of the toggle state, hover over the option and click on the Pencil Icon.

Customising the Payload Message

To modify the value of the toggle state, hover over the option and click on the Mail Icon, and update the value in the message string field.




 
Consider a simple example of a Toggle switch for a Smart Light with two states: ON and OFF. In this setup, the "ON" state activates the light, assigning the value "on," while the "OFF" state turns the light off, assigning the value "off."

The configured input type shall be as follows:

Toggle Name
Value
ON
on
OFF
off
 
Learn about command payloads to know how the values are used.

The following Toggle is created.

Configure:Slider

Description: A horizontal bar that can be dragged to select specific values within a defined range. In this command input type, the user sets a range of numbers that will be used as the value in the payload.

The values can be integers, decimals, or percentages. To configure, the user must specify the start value, end value, and the interval by which the values should increase or decrease across the range.

Slider Numeric Datatype: Specifies the type of numeric values the slider will handle, such as integer, decimal, or percentage (with options to set decimal places).

Slider Min. Number: Defines the minimum value that the slider can be set to.

Slider Max. Number: Defines the maximum value that the slider can be set to.

Increment/Decrement Steps: Specifies the step intervals by which the slider value will increase or decrease as the user drags it.

Default State: Specifies the initial value or position of the control element when it is first loaded or activated.
For example, consider a slider to control the temperature of a thermostat in a home heating system. If the temperature range is from 15 to 27 degrees Celsius, the slider can be configured with a start value of 15, an end value of 28, and an appropriate interval to adjust the temperature precisely within this range.
 
Slider Numeric Datatype
Integer
Slider Min. Number
15
Slider Max. Number
28
Increment Decrement Steps
1
 


The following slider is created.



Configure: Picklist

Description: A drop-down menu containing multiple options, each representing a specific value.

By default, the picklist provides a single option, which can be expanded to include additional options as required.

Adding an Option

To add a new option, click the Add Option button below the last available option and provide a name for it.




Deleting an Option

To delete an option, hover over the option you want to delete and click the minus icon.

Editing the Name

To modify the name of the option, hover over the option and click on the Pencil Icon.



Editing the Value

To modify the value of an option, hover over the option and click on the Mail Icon, and update the value in the message string field.




Rearranging the Options

To rearrange the options, hold and drag the two column dots to move the option up or down as required.
For example, consider an Air conditioner with four predefined settings: Turbo, Normal, Eco, and Fan Only. To accommodate these settings, a picklist can be configured with four options, each representing one of these modes. Users can easily select the desired setting from the drop-down menu, ensuring quick and efficient control over the system's operation.

Options Name
Value
Turbo
set_turbo
Normal
set_normal
Eco
set_eco
Fan Only
set_fan_only
 



The following picklist command is created.

Configure: Buttons

Description: Interactive buttons that trigger specific actions when clicked.

These clickable UI elements correspond to distinct values. Unlike a picklist, buttons offer more visibility of all the available actions and the current state selected. By default, a single button is provided, but additional buttons can be configured to represent multiple actions or states as needed.

Adding a Button Option

To add a new button, click Add Option below the last available option and provide a name for it.



 

Deleting a Button Option

To delete a button, hover over the option you want to delete and click the minus icon.

Editing the Button Option Name

To modify the name of the button, hover over the option and click on the Pencil Icon.




Editing the Button Option Value

To modify the value of a button, hover over the button option and click on the Mail Icon, and update the value in the message string field.



Rearranging the Button Options

To rearrange the button, hold and drag the two column dots to change the order of the buttons.


 
For example, consider an Air conditioner with four predefined settings: Turbo, Normal, Eco, and Fan Only. To accommodate these settings, a button can be configured with four options, each representing one of these modes. Users can easily select the desired setting by simply clicking the button.

Options Name
Value
Turbo
set_turbo
Normal
set_normal
Eco
set_eco
Fan Only
set_fan_only
 




The following buttons command is created.


Configure: Numeric

Description: A stepper control used to increment or decrement values within a specified range.

The value can be an integer, decimal, or percentage. To configure, users must provide the start value, end value, and the interval by which the values should increase or decrease.

Numeric Datatype: Specifies the type of numeric value the stepper will handle, such as integer, decimal, or percentage.

Numeric Min. Number: Defines the minimum value that the stepper can be set to.

Numeric Max. Number: Defines the maximum value that the stepper can be set to.

Increment/Decrement Steps: Specifies the interval by which the numeric value will increase or decrease as the user steps through the range.

For example, consider controlling the temperature of an industrial floor. If the desired temperature range is from 16°C to 28°C, a stepper can be configured to allow precise adjustments within this range, with each step representing a specific increment or decrement in temperature.

Numeric Datatype
Decimal
Numeric Min. Number
16
Numeric Max. Number
28
Increment Decrement Steps
0.5
 


The following numeric stepper is created.


 
 
See Also
Adding and managing commands