Rule Management

Rule Management

Overview

In every IoT implementation, three crucial components are required:
  • the hardware for physical deployment
  • the software for analysis and reasoning and
  • the IoT network to connect these parts

While data collection provides insights, the ability to act on that data makes them useful. This is where a rule engine becomes essential. IoTConnect’s rule engine receives data, performs logic tests based on designated conditions, and performs actions accordingly. Your business can rapidly and effectively scale up by enabling actionable insights from your IoT models.

Why Rule Management

Rule management is essential in scenarios such as managing commercial buildings with IoT solutions. Consider a specific use case involving an IoT system embedded in a commercial building with a temperature sensor. When the temperature reaches ten degree Celsius, the heater is triggered. To achieve this, rules need to be created in the backend process to receive temperature data at specified intervals and determine the appropriate actions.

This module will guide you in creating, editing, and deleting rules, allowing customized and efficient processes.

Create a rule

To create a rule for your IoT network:

  1. From the left navigation, mouseover the Devices module. Click Greengrass 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. (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.
    • (Screen: Severity Level)

    • Attribute: Select an attribute to associate with the rule.
    • Condition: Select a condition for the rule.
    • (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.
    • (Screen: Rule Applies On)

    • Notification Type: Select all (as shown in the image below) or choose a specific notification type for the rule.
    • (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.
    • (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. (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. Select Greengrass Device. 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. (Screen: Create Rule – 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.
      • (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.
      • (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.

      (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. It 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.

(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’.

(Screen: Delete Device)

  1. Click Ok to delete a rule.