Table of Contents:

  1. Types of Alerts

  2. When and how does an Ubidots Event trigger?

  3. Creating a Conditional Event

  4. Creating a "Back to Normal" Notification

  5. Creating a Geofence Notification

  6. Copying an existing event

  7. Results

1. Types of Events

Ubidots already supports integrated events to allow you to send Alerts and notifications to those who need to know, when they need to know.
Ubidots' pre-built integrations include: 

  1. Email notifications

  2. SMS notifications

  3. Webhook events - learn more

  4. Telegram notifications

  5. Slack notifications - learn more

  6. Voice Call notifications - learn more

  7. Back to Normal notification - learn more

  8. Geofence notifications - learn more

2. When and how does an Ubidots Event trigger?

The figure below describes how the Events Engine triggers alerts inside an active event window. Note that data (blue line) passes through the Threshold triggering an event; then the data must fall below the threshold again before Ubidots triggers the next event.

Please note that after an alert is triggered, subsequent values will not be triggered again, even if they comply with the trigger conditions. A second trigger cannot take place unless the data values return below the threshold value and exceed the threshold again:

IMPORTANT NOTE: There's no need that an event that has just been created or edited is in a "Back to normal" state, which means that the next value that meets the condition will trigger the event.

Events can ONLY be triggered in an Active Event Window as depicted below. Activity Windows are described further in Step 9 later in this guide.

'Has been inactive' condition events will ONLY be triggered if the inactiveness is within the active window.

3. Creating a Conditional Event

Tip: In Ubidots conditional events engine you may select multiple devices and multiple variables within a single event or built complex events with triggers exist for multi-logic events (If {dev 1, varA} or {device 2, varB} are 100, then send SMS message)

Step1: Select Events (from the Data dropdown).
Step 2: Click on the add upper-right button.

Step 3: Select the If triggers tab to organize your event logic (If A,B, and/or C exists, then execute XYZ)

Step 4: Select a device: DEVICE A (one device per conditional expression; multiple devices can be added using AND / OR conditionals)

Step 5: Select a variable: Temperature (one variable per device can be selected at a time. 

Step 6: Establish event logic, you can choose either:

  • if the value is greater than 90, for 60 minutes.

  • If the variable has not been updated for 10 minutes.

  • If the device position enters/exits a geofence for 1 minute.

Step 7 (OPTIONAL): Add additional Device and Variable triggers by adding in additional AND or OR statements. Click the +And  or +Or button to add an additional If triggers expression.

Step 8: Select the Then actions tab to execute the planed Event or Alert (SMS, Email, Telegram, Slack, and/or Webhook)

Step 9: Select and Configure which actions are to be executed and the message for the receiver. Available actions include Email, SMS, Telegrams, Voice Call, Set Variable, SLACK, or WebHooks.

**IMPORTANT NOTE** SMS alerts support up to 140 characters. If exceeded, the message body will be trimmed to this length.

Select the event type:

Configure the Event notice:

Pro Tip: Add Specific Data Inputs into the Event for immediate info

  • Context

  • Device Label 

  • Device Name

  • Device Properties

  • Trigger Value ─ relative to the value which triggered the event

  • Trigger Timestamp – relative to the time at which triggered the event

  • Last Value ─ relative to the last value of the time series

  • Last Value's timestamp ─ relative to the timestamp of the last value

  • Variable

  • Variable Id

  • Variable Name

  • Variable Properties - learn more

  • Timestamp – relative to the current time

By default, data inputs involving timestamps are sent in human-readable format (YYY-MM-DD HH:mm:ss TZ). If you rather attach UNIX epoch time in milliseconds, double-click on the data input and delete the pipe symbol "|" forward.

Step 10: Repeat Events - Enable/Disable whether you prefer to get a notification every x minutes/hours/days up to x times while the event is triggered. 50 is the max times the action will be executed.

**IMPORTANT NOTE** Setting repetitive Event actions will also count as Event executions and may carry additional costs.

Step 11: Determine the activity window the events may/may not be executed.

IMPORTANT NOTE: The activity window does not comprise hour ranges including day changes, meaning, it only works when the end time is greater than the initial, otherwise, the event cannot be created.

Step 12: Confirm your Events

4. Create a "Back to Normal" Notification

After creating an Alert, it is inevitable that the event will be triggered at some point; one great feature of Ubidots Events Engine is the "Back to Normal" conditional notification. To activate a Back to Normal notification, simply follow the below three steps. 

Step 1: Select "BACK TO NORMAL" tab from the event's actions tab.
Step 2: Select the "Trigger this action" box to verify the desire to receive a "back to normal" notification.
Step 3: Add the Custom Notification Text as you see fit

Pro Tip: Be sure to save your results. 

5. Creating a Geofence Notification

Geofencing is a software feature that, through GPS, defines geographical boundaries. When a device enters or exits a determined area, an alert (or event) can be triggered using Ubidots. To set a geofence notification, simply follow the below three steps. 

Step 1: Create a new event.
Step2: Choose a device and the associated variable that indicates the devices' "position".

Step3: Choose "Location" from the dropdown and determine when to trigger an event if upon entry or exit.

Step 4: Select "Add Geofence" and draw the boundary on the map that appears:



Step 5: Continue the creation process as explained in the 3rd section of this guide.

6. Copying an existing event

At this point, you probably have set some events, some more complex than others but, what if you need to set an additional event using another device with the same conditional logic and same actions? There’s when"copy" event feature takes place. To do so, simply follow the below steps.

Step1: Search the existing event you want to copy.
Step2: From the right-side menu, choose the option "copy event".

Step3: Once done, you will get a new event named as "Copy-original event name" as depicted below.

NOTE: If the original event is linked to an organization, then, the new event will also be part of the same organization.

Step 4: Edit your new event as you see fit.

7. Results

Now it is your turn to build your very own conditional events with Ubidots. If you need a little help along the way, no problem, just message our team via email at or by the in-app chat channel with that little blue chat bubble in the bottom right of your App. 

Other users also found helpful:

  1. Events: Was my event triggered? How to check the event's Log

  2. Events: Slack Webhook setup

  3. Ubifunctions: Process/Parse data from 3rd party platforms

Did this answer your question?