How to Use JavaScript for Custom Rule Conditions in Qubitro
By following this guide, you can customize Qubitro rule functions using JavaScript to create dynamic conditions.
Accessing Data with Predefined Keys
Syntax and Usage
function run(){
let temperature = ${{TEMPERATURE}};
let humidity = ${{HUMIDITY}};
let light = ${{LIGHT}};
let motion = ${{MOTION}};
let voltage = ${{VDD}};
}Writing Rule Conditions
Example: Trigger an Action Based on Temperature and Humidity
Utilizing the trigger() Function
Example: Alert When Temperature and Humidity Are Too High
Practical Implementations
Example 1: Geofencing a Restricted Area
Example 2: Advanced Environmental Monitoring
PreviousHow to Publish and Decode Multiple Hex Payloads via MQTT on QubitroNextHow to Use JSONata for Real-Time Data Transformation in Qubitro
Last updated