Create a New Control Element

The "Create a New Control Element" form dynamically adapts to configure controls with mandatory fields and tailored output settings.

The "Create a New Control Element" interface enables users to configure controls by filling mandatory fields like Element Name, Entity, and Sensor. Based on the selected Control Output (Native, MQTT, or HTTP), the form dynamically adjusts to include relevant fields such as Topic, Messages, URL, or authentication details. It ensures flexibility, clarity, and efficient configuration management.

Create a New Control Element

1. Header

  • The form is titled "Create a New Control Element", clearly indicating its purpose.

  • It provides an intuitive layout with dynamic elements for creating a new control configuration.

2. Mandatory Fields

Fields marked with a star (*) are required for creating the control element. These fields appear across all configurations.

Field Name
Description

Element Name*

A text field where the user must enter the unique name of the control element.

Entity*

A dropdown menu for selecting the organization or site where the control element belongs.

Control Output*

A set of three options to define how the control communicates (Native, MQTT, or HTTP).

3. Optional Feature

Feature
Description

Show Hidden Channels

A checkbox that reveals additional sensor channels in the Select a Sensor dropdown.

4. Select a Sensor

Field Name
Description

Select a Sensor*

A dropdown menu to associate the control with a specific sensor. Required for linking the control to a data source.

5. Control Output Options

The Control Output selection determines the communication protocol for the control element. Based on the user selection, the interface dynamically displays relevant fields.

Option 1: Native

Native View

If Native is selected, the form remains in its basic state,

  • Mandatory fields: Element Name, Entity, and Select a Sensor.

  • No additional fields are required.

Option 2: MQTT

MQTT View

Selecting MQTT expands the form to include additional fields specific to the MQTT protocol.

Field Name
Description

Topic*

Specifies the MQTT topic to which messages will be published.

Message (ON)*

The message payload to send when the control is turned ON.

Message (OFF)*

The message payload to send when the control is turned OFF.

User ID*

The username required for authentication with the MQTT server.

Password*

The password for authenticating the user.

Server

The MQTT server’s URL or IP address.

Option 3: HTTP

HTTP View
  • Selecting HTTP expands the form to include fields for HTTP-based communication.

  • It also displays three switch buttons for selecting the HTTP body format:

    • x-www-form-URL encoded: For form submissions in HTTP requests.

    • Raw: For sending raw data in the HTTP body.

    • Binary: For transferring binary data.

Field Name
Description

URL*

The endpoint URL for sending HTTP requests.

Message (ON)*

The message payload to send when the control is turned ON.

Message (OFF)*

The message payload to send when the control is turned OFF.

6. Action Buttons

Located at the bottom-right corner, these buttons allow the user to finalize or cancel the configuration.

Button Name
Description

Cancel

Discards all entered information and closes the form without saving.

Create

Saves the control element configuration and adds it to the system.

Dynamic Behaviour Overview

  1. Native Control Output

    • Displays the basic form with no additional fields.

    • Only requires the mandatory fields and a selected sensor.

  2. MQTT Control Output

    • Expands to include MQTT-specific fields such as Topic, Messages, User ID, Password, and Server.

  3. HTTP Control Output

    • Expands to include HTTP-specific fields like URL, Messages, and body format options (x-www-form-URL encoded, Raw, or Binary).

Example Use Case Scenarios

1. Native Configuration

Field
Value

Element Name

Light Control - Room 1

Entity

Building A > Floor 1

Sensor

Room 1 Temperature Sensor

2. MQTT Configuration

Field
Value

Element Name

Fan Control - Floor 2

Entity

Building B > Floor 2

Control Output

MQTT

Topic

building B/floor2/fan

Message (ON)

Turn On

Message (OFF)

Turn Off

User ID

admin

Password

password123

Server

mqtt.example.com

3. HTTP Configuration

Field
Value

Element Name

Valve Control - Floor 3

Entity

Building C > Floor 3

Control Output

HTTP

Body Format

Raw

Message (ON)

{ 'state': 'on' }

Message (OFF)

{ 'state': 'off' }

Conclusion

The "Create a New Control Element" form is a dynamic and versatile interface designed to accommodate various control configurations. It adapts seamlessly to the selected Control Output, ensuring users see only the fields relevant to their needs. With a simple, intuitive layout and well-defined mandatory fields, it simplifies the process of creating, linking, and configuring control elements.

Last updated