Rule Management

Rule Management

Overview

In every IoT implementation, there are three essential components:
  • the hardware for physical deployment
  • the software with the capacity to understand and reason and
  • an IoT network that links these two parts together

The collected or captured data will provide insights, but without the ability to act upon them, it all amounts to nothing. That’s where a rule engine comes in.

IoTConnect’s rule engine receives data, runs logic tests with specified conditions, and takes actions depending on the results. Your business can scale up quickly and successfully by enabling actionable insights from the data you collect through your IoT models.

Why Rule Management

Let’s continue with the use case elaborated in the users and roles module. Imagine your IoT solutions manage commercial buildings.

For rule management, imagine your use case involves an IoT system embedded in a commercial building with a temperature sensor, which triggers the heater when the temperature reaches ten degrees Celsius. This requires making rules in the backend process for receiving temperature at specified intervals and determining indications for triggering specific actions.

This module will provide instructions on how to create, edit and delete rules to ensure perfectly customized and streamlined processes.

Create a rule

To create a rule for your IoT network:

  1. From the left navigation, mouseover the Devices module. Click Wireless Device. In the middle and toward the down, select Rules.
  2. Along the top and toward the right, select Create Rule.

You can create two types of rules using IoTConnect:

  • Standard Rule – You define a standard rule using one condition.
  • Smart Rule – Define a smart rule by providing multiple conditions that should be matched to trigger the action.

Create a standard rule

  1. Select Standard Rule from the rule type.
  2. img

    (Screen: Create Rule – Standard Rule)

  3. Enter data in the following fields:
    • Rule Name: Enter a unique rule name to help you identify the rule.
    • Template: Select a template to associate with the rule.
    • Severity Levels: Select the severity level of a rule based on your business use case.
    • img

      (Screen: Severity Level)

    • Attribute: Select an attribute to associate with the rule.
    • Condition: Select a condition for the rule.
    • img

      (Screen: Select Condition)

    • Value: Enter the value upon reaching where a rule should trigger.
    • Rule Applies On: Select whether a rule should apply on all the devices of a selected entity, specific devices, or a device group. Note that when you choose all devices of the selected entity, you will also see a checkbox to include the device of child entities.
    • img

      (Screen: Rule Applies On)

    • Notification Type: Select all (as shown in the image below) or choose a specific notification type for the rule.
    • img

      (Screen: Notification Type)

    • Audience: Specify the roles and users to be notified when the rule matches. Note that you can only select the roles and users you have made. They will come in the drop-down menus of Select Roles and Select Users.
    • img

      (Screen: Audience)

    • Click Save to create a standard rule.

Create a smart rule

A smart rule applies with multiple conditions and attributes. To apply attributes, mouseover the How to Use tag on the right side of the Select Attributes box. It will open the box with the data type, format and example.

  1. Select Smart Rule from the rule type.
  2. img

    (Screen: Create Rule – Smart Rule)

    Complete the required fields as mentioned in creating a smart rule. The only difference here is you can add conditions for multiple attributes.

  3. Click Save to create a smart rule.

Rule List

To view the rule list:

  1. From the left navigation, mouseover the Devices module. In the middle and toward the down, select Rules.
  2. The rule list displays a rule name with its condition (rule condition will appear when you mouseover the question mark associated with each rule name),template name, entity name, rule type, user and role numbers, rule status and actions.
  3. img

    (Screen: Rule List)

    • Status: A rule can be Active or Inactive. When you create a rule, its default status is Active. Inactive the rule when you do not need it. Make the rule active whenever you need it back.
    • Actions: Apart from editing or deleting a rule, you can track data changes and check the rule’s history.
      • Track data change: It shows the data on created date, created by, updated data and updated by.
      • img

        (Screen: Track Data Change)

      • Rule History: It displays every rule operation, the user who created or updated the rule and the date when made the latest changes.
      • img

        (Screen: Rule History)

    • Rule Filter:
      1. Apply the filter from the top-right corner of the rule list.
      2. Add filters like rule name, template, entity, rule type and status by selecting the + icon.
      3. Active status is a default rule filter when you create a rule. You can remove that filter anytime or add more filters.

      img

      (Screen: Rule Filter)

      IoTConnect offers five rule filters. Apply any filter and enter the required keywords to retrieve matching results in the rule list. Click Apply Filter to apply it.

Edit a rule

To edit a rule:

  1. Click on the Rule Name from the rule list or select the Edit Rule icon from the actions lane. A click on either will show you the fields to edit.
  2. You can edit everything about a rule. It includes rule name, template, severity levels, attribute, select condition, value, rule applies on, notification type and audience.

img

(Screen: Edit Rule)

  1. Click Save to save changes of rule edits.

Delete a rule

To delete a rule:

  1. Select the Delete Rule icon from the actions lane.
  2. It will present the dialogue box titled ‘Delete’.

img

(Screen: Delete Device)

  1. Click Ok to delete a rule.