MQTT Rules Engine

Best MQTT Rules engine built-in with Thingsup IoT Platform with MQTT Broker. Validate and Transform your IoT data on the fly with serverless service.

MQTT Rule is a Rule defined in Thingsup to Process MQTT Message. Before setting up MQTT Rule, user need Add Device to his account. User need to provide following parameters.

Topic

User need to provide a topic on which data is incoming. For example, Test. Thingsup also support standard Wildcard subscriptions like Test/+ or Test/# or Test/+/LocationData

Data Validation/Transform

Here user can write a JavaScript code to validate or change data i.e "payload" which is received as payload to given MQTT Topic.

The "payload" object here in this code, can get changed or transformed before passing to Thingsup Actions. Also user can assign "null" to payload if he want to avoid action trigger after data validation.

// This code checks if payload is JSON and contains Location data 
if(typeof payload === 'object') 
{
    if(payload.Location == undefined) 
    {
        payload = null;
    }
    else
    {
        payload["time"] = Date.now(); // Transform payload
    }
}
else
{
    payload = null;
}

Action ID

User need to provide an Action ID of Action to be triggered.

Please note the following points:

  • "null" payload results into Rule Failure which doesn't trigger Action

  • Avoid using Rule Engine directly to trigger Send SMS /Email Action, bad configuration can result into High Credits Usage

Last updated