Skip to main content
All CollectionsUser Guides
Events: Creating Conditional Events and Alerts
Events: Creating Conditional Events and Alerts

How to create conditional events to trigger sensor and actuator data-based alerts.

David Sepúlveda avatar
Written by David Sepúlveda
Updated over 6 months ago

Enable passive monitoring, generation of complex alerts, device control, and the triggering of different actions within and outside Ubidots by creating events that activate based on a set of easy-to-configure conditions.

1. Creating a conditional event

To begin, head to the “data” tab →"Events" and hover over the “+” button, located at the upper right corner of the screen, and click on the “create event” button (the one with a “+” icon).

Once the event modal pops up, you’ll find yourself in the first stage of configuration, where you’ll set up the logic of the triggers.

By default, a newly created event loads with a value-based trigger, but you can choose another type of trigger by clicking on the “+ add trigger” or “+ add OR group” buttons.

The available types of triggers are these:

  • Value based (e.g., if the value is greater than X).

  • Inactivity (e.g., if the variable has not been updated in X amount of time).

  • Geofence (if the device enters/exits a defined area in a map).

These triggers can be deleted or copied by clicking on the corresponding button located at the upper right corner of the trigger.

To learn about inactivity and geofence triggers, head to their corresponding guides, linked above. Keep reading this guide to learn about value-based triggers.

2. Creating a value-based trigger

2.1. Triggers

Step 1: Select one variable per conditional expression. Multiple variables can be added using AND (“+ add trigger”)/OR (“+ add OR group”) conditionals.

Step 2: Define the triggering condition out of these options:

  • Equal to

  • Not equal to

  • Greater than

  • Greater than or equal to

  • Less than

  • Less than or equal to

Step 3: Select whether the event’s variable’s value will be compared to a fixed value or to another Ubidots variable by choosing the Dynamic Threshold option (the “+” button next to the “trigger value” field). With a dynamic threshold it’s possible to, for example, have an event activate when a variable's value is greater than another variable. Note that dynamic thresholds are only available from the Industrial plan and above.

2.2. Actions

After configuring the “triggers” tab and clicking on “next”, you’ll move onto the “actions” tab. There, you’ll be able to select and configure the action that will be triggered when the event is activated.

Step 4: Click on the “+ add action” button to start this process. These are the options you can choose from:

For a detailed explanation on how each of the actions work and how to configure them, visit their respective article (linked above).

2.3. Settings

After completing the action configuration and clicking on “next”, you’ll proceed to the final step, the “settings” tab. There, you’ll identify your event and define its active windows.

Step 5: Start this stage by naming your event and, optionally, giving it a description so that it’s easy to distinguish from other events later on.

Step 6: Another optional step is to use a tag on the event. This is a great tool to control what your end users see in your app. In this case, for instance, you could decide that your end user sees one event, but not another, using tags. Learn more about tags here.

Step 7: Determine the activity window in which the events should be executed. An event can have multiple active windows by clicking on the “+ add window button” and configuring them correspondingly.

Notes:

  1. Events will only activate during the active windows you define in this step.

  2. A variable whose incoming values don’t go below the defined threshold will still activate the event when a new value arrives during the next active window (as depicted in the image below).

Note: To learn more on how and when Ubidots’ events are triggered, take a look at this guide.

Step 8: Click on the “save” button to finish creating the event.

Did this answer your question?