Rules Engine in IoT Platform

Rules Engine in IoT Platform

What is the Use of Rules Engine in IoT Platform?

IoT Platform is a powerful tool with Rules Engine that forms the basis of automation and custom responses in IoT projects. This tool monitors various events, analyzes data. It also initiates special actions when certain conditions are met. For example, you can easily manage scenarios such as creating an alarm when the temperature value of a device goes out of a certain range or automatically updating the status of another device when the status of a specific device changes.

It focuses on concepts such as event triggers, conditions, actions, and the runtime cycle. It also allows users to create complex rules and automation scenarios on the platform. FAST IoT Platform’s Rules Engine offers flexibility, customization and automation to its users. However, it provides a powerful tool to increase security and efficiency in IoT projects. In addition, it provides automation between devices and shapes system behavior according to certain conditions.

IoT Platform Rules Engine

Rules Engine Fundamentals

  1. Event Triggers:

The rules engine starts by using a series of event triggers. Event triggers are used to detect a specific situation or event. The system triggers an event when the device’s data exceeds a specific limit.

  1. Conditions:

After the event is triggered, certain conditions are checked. Conditions are used to control a specific state or value. For example, a condition is triggered when the temperature goes outside a certain range.

  1. Actions:

When conditions are met, certain actions occur. Actions include a variety of functions, such as sending a command to a device, sending a notification, writing data to a database, or communicating with another integration.

  1. Runtime Cycle:

The rules engine constantly listens for events, checks conditions, and takes actions. This ensures constant automation and reaction capability on the platform.

  1. Timing and Repetition:

The rules engine has the ability to handle recurring events over specific time periods or within a specific period. It uses it to perform certain operations at regular intervals.

Rules Engine Usage Scenarios

  1. Automation:

The rules engine provides automation by automatically sending commands to devices or triggering certain actions when certain conditions are met.

  1. Data Processing and Filtering:

By processing incoming data and checking certain conditions, the rules engine filters and processes data streams coming into the platform.

  1. Alarm and Notification Management:

The rules engine generates alarm situations and sends notifications when specific events occur.

  1. Writing Data to the Database:

The rules engine writes data to the database on the platform when certain conditions are met. This is used to save historical data.

  1. Integrations:

The rules engine provides integration with other systems.

Rules Engine Configuration

To configure and customize The FAST IoT Platform’s rules engine, users can use a user-friendly interface via the FAST IoT Platform interface. This interface enables the creation of intricate rules and automation scenarios.

Basic Components of the FAST IoT PLATFORM Rules Engine


The message represents any event that occurs on the platform. These events are data from devices, device lifecycle events, REST API events, RPC requests, etc.

Rule Node:

Rule node refers to a component that executes a specific function on a message. Nodes have the capability to filter, transform, or perform specific actions on the incoming message. Different types of rule nodes are used to perform various functions.

Rule Chain:

A rule Chain is a structure that provides the ability to link rule nodes together and sequence them to perform a series of operations. A rule node sends a message to other nodes in the chain. This way, users can create complex workflows to react to events.

The IoT Platform Rules Engine is a powerful tool that provides event-driven automations and functionality in IoT projects. This engine allows users to respond to device data, initiate actions based on specific conditions. This ensures the flexibility of the platform and makes it possible to create custom workflows.

IoT Platform Rule Engine Rule Chain Sample Usage

An Example of Creating and Clearing Alarms

Let’s say you want to transmit temperature data read from your device’s DHT22 sensor to the FAST IoT Platform. The DHT22 sensor typically measures temperatures in the range of -40 to 80 °C. However, we want to create an alarm if the measured temperature is outside this range.

In this tutorial, we will configure the FAST IoT Platform Rules Engine as follows:

If the temperature value is greater than 80°C or less than -40 °C, create or update an existing alarm.
If the temperature value is between -40°C and 80 °C, clear the alarm condition.

Step 1: Create New Rule Chain

IoT Platform Rules Engine

Create a new rule chain by following the numbers in the image.

Step 2: Add The Required Nodes

Node A: Script Node

The “Script” node is used to activate custom JavaScript codes within the FAST IoT Platform’s Rules Engine. This way, users can add custom logic, calculations, and custom actions to event data. The JavaScript language enables the seamless integration of custom operations like complex conditions, loops, declarations. This node allows users to create more flexible and specialized event-based workflows.

IoT Platform Rules Engine

A script node is created to check whether the parameter is within the expected range.

Node B: Create An Alarm Node

The “Create Alarm” node is used to create an alarm within the Rules Engine of the FAST IoT Platform. This node allows an alarm to be triggered when a certain condition or event occurs. Using this node, users set custom triggers and conditions, so they can create alarms for situations they want. This allows the system to react to a particular situation or event and provide information to users.

IoT Platform Rules Engine

You can change the alarm type and alarm severity values ​​as per your desire.

Node C: Clear Alarm Node

The “Clear Alarm” node is used to clear or close an alarm within the Rules Engine of the FAST IoT Platform. This node closes the alarm condition if a previously created alarm meets a certain condition. Using this node, users can create automation and scenarios to turn off the alarm condition when a certain situation is resolved or an undesirable situation occurs.

IoT Platform Rules Engine

The alarm type value in the Clear alarm node should match the create alarm.

IoT Platform Rules Engine  

The final version of the rule chain will look like this.

Step 3: Configuring the Root Directory

IoT Platform Rules Engine

Let’s add the rule chain we created to the root directory.

IoT Platform Rules Engine

The final version of the Root Rule Chain will look like this.

Result of Flexibility and Automation in IoT Projects: FAST IoT Platform’s Rules Engine

One of the most powerful features of the FAST IoT Platform, is the Rules Engine, which monitors various events, analyzes data, and accomplishes specific actions when certain conditions are met. The Rules Engine works using basic principles such as event triggers, conditions, actions, runtime loops and scheduling/recurrences. Additionally, this feature provides flexibility in users IoT projects. It enables them to create customizable workflows. Thanks to the user-friendly interface of FAST IoT Platform, complex rules, automation scenarios are created. Rules Engine is a robust tool that offers event-driven automations and functionality in IoT projects.

Contact us for further information on Rules Engine Management on FAST IoT Platform.

Instagram: roltek2014

LinkedIn: Roltek Technology

Leave a Reply

Your email address will not be published. Required fields are marked *