This guide will show you how to create and configure rules to send email messages in Studio using the Alerts module. Through Alerts, customized emails can be sent about specific sensor events, for example, to:
- Know when a Cloud Connector or a sensor is offline
- Send an alert when a freezer is too hot
- Alert security when a window opens
- Notify the maintenance team if there is a water leak
- Be aware when someone presses a service button
What you need
- Access to Studio
- A user account with Project developer, Project administrator, or Organization Administrator permissions
Steps
- In Studio, select the Alerts module
- Navigate to the Configure tab
- Click on Create Alert rule
- Choose a suitable Alert name
- Select Trigger
- Select Schedule (Optional)
- Select Add devices
- Select Add Action and choose Send Email
- Add Escalation
- Click Save Alert Rule in the lower right-hand corner
Congratulations — your alert has been successfully created!
Next, you can learn how to Acknowledge the alert and customize the alert email using Variables to include as much relevant information as possible.
Select trigger
Select the event that will trigger the alert.
Trigger | Description | Devices |
Temperature | Triggered when the temperature is above, below, outside, or within the defined range. |
Temperature, EN12830/330s, Humidity, Industrial Temperature sensor, Temperature sensor (Gen 2), Temperature sensor (3rd Gen), CO2 Sensor |
Door & Window | Triggered when the door or window is open or closed. | Door & Window Sensor |
Door & Window (Count) | Notifications will be sent when a sensor reaches the set count of open or closed events. The counter resets when the notification has been sent. | Door & Window Sensor |
Proximity Status | When the sensor is covered within 5mm, it is triggered if set to True. Triggered when the sensor stops being covered if set to False. |
Proximity sensor (Counting Proximity sensor is not supported) |
Proximity Count | Notifications will be sent when a sensor reaches the set count of open events. The counter resets when the notification has been sent. | Proximity sensor |
Touched |
Notifications will be sent when a sensor is touched. | All small sensors |
Touch Count |
Notifications will be sent when a sensor reaches the set count of touches. The counter resets when the notification has been sent. |
Touch Sensor, Tactile Touch Sensor |
Humidity |
Triggered when the humidity is above, below, outside, or within the defined range. | Humidity, CO2 Sensor |
Water Detected |
It is triggered when the sensor is covered with water if set to True. Triggered when the sensor stops being covered with water if set to False. |
Water Detector |
Motion |
It is triggered when the sensor detects motion if the state is set to Motion detected. It is triggered when the sensor does not detect motion if the state is set to No motion detected. |
Motion sensor |
CO2 | Triggered when the CO2 level is above, below, outside, or within the defined PPM range. | CO2 sensor |
Desk Occupancy |
It is triggered when the sensor detects occupancy if the state is set to Occupied. It is triggered when the sensor does not detect occupancy if the state is set to Not occupied. |
Desk Occupancy sensor |
Offline Monitoring |
Triggered when a Cloud Connector or a sensor is offline. For Cloud Connectors: Notifications are triggered when a Cloud Connector has been offline for an extended period of time (5-15 minutes) and is unable to forward sensor events. For sensors: Notifications are triggered when a sensor loses connection to its Cloud Connectors (eg. due to a depleted battery or going out of range). However, if the Cloud Connector itself goes offline, you won't receive individual sensor notifications. |
All sensors and Cloud Connectors |
Adding a trigger delay
Alert rule can trigger immediately, or after a delay, e.g., the temperature remains above 40°C for 1 hour and 30 minutes, or a door remains open for more than an hour. The maximum delay is 72 hours.
Updating the alert rule while a sensor is in the triggering state
If you update the trigger, trigger delay, or schedule while a device in the Alert rule is triggering*, that state will be ignored, and no e-mail will be sent.
Example:
-
- Your Alert rule is set to send an email whenever a temperature sensor has sent temperature events above 4°C for 1 hour
- You decide to update this Alert rule to get notified when all temperature sensor events have been above 4°C for 2 hours
- At the time you update the Alert rule, one of your sensors has already sent temperature events above 4°C for 30 minutes, and is thus in the triggering state.
- To avoid false alerts, the fact that this sensor is currently triggering will be ignored, and no email will go out.
- The temperature sensor goes below 4°C
- The temperature sensor is above 4°C for 2 hours
- The trigger is set to true for two hours, and an email alert is sent.
* Triggering means that the trigger for a device is set to true. You can see the trigger status in the list of devices.
Schedule
Optionally, you can set a schedule for when the triggers can happen by selecting the days and timeslots you'd like in the drop-down menus. Alert rules triggered outside the set timeslots are not delivered.
Set the schedule to apply for local time or UTC from the Timezone dropdown menu.
Add devices
To apply the Alerts rule to specific devices, click Add Devices. A list of all your devices will appear, similar to the Sensors & Cloud Connectors overview. To add a device, click the (+) icon next to its name.
Add recipients
Currently, sending an email is the only action available. Fill out the recipients, the subject, and the body text to include in the email.
Add Escalation
If the issue is unacknowledged, unaddressed, or unresolved, you can use Escalations to trigger an additional alert email to another user for follow-up.
The Escalation delay setting allows you to specify how many hours to wait before the escalation email is triggered. You can configure as many Escalation levels as needed.
Acknowledging the alerts
You can interact with alerts by acknowledging them, adding comments, and assigning corrective actions - all of which are recorded in the alert timeline. Every alert follows a lifecycle, which looks like this:
-
Open: Alert is triggered when sensor readings are outside the defined limits.
-
Acknowledged: (Optional) A user acknowledges the alert, taking responsibility.
-
Corrective Action: (Optional) A user adds a description of corrective steps taken.
-
Monitoring: Status set to monitor the effectiveness of the corrective action.
-
Resolved: The alert is resolved automatically when sensor data returns to normal.
Variables
You can add variables to the email text to include relevant information for the device. Supported variables are:
Placeholder | Description | Example |
$name | Name of the device. The device ID is displayed if there is no name. |
Fridge 3 |
$description | Description of the device. | Mounted on the top of the fridge. |
$deviceID | The ID of the device. | bivd53b1e97600enrts0 |
$celsius | The temperature (°C). | 12.70°C |
$fahrenheit | The temperature (°F). | 12.70°F |
$relativeHumidity | The humidity (%RH). | 87 %RH |
$proximityStatus | The status displayed in Studio for proximity sensors ("open" or "closed") | Closed |
$objectPresent | The status displayed in the API for proximity sensors ("not present" or "present") | not present |
$waterPresent | The status displayed in Studio for water sensors ("water present" or "no water present") |
no water present |
$label.{labelKey} | The value of a Label for a device. | If a device has a Label where Key=room and value=34A, then $label.room displays the value 34A |
$deskOccupancy | The status displayed in Studio for Desk Occupancy sensors ("occupied" or "not occupied") | Not occupied |
$motion | The status displayed in Studio for Motion sensors ("motion detected" or "no motion detected") | No motion detected |
$co2 |
CO2 sensor value in PPM |
1000 PPM |
$triggerStatus |
Can be used if the “Resolved Notification” toggle is enabled where a notification is sent when the trigger is resolved. $triggerStatus will then either be “Triggering” or “Resolved”. | Resolved |
How to include the Studio link in the email
It can be valuable to have a link in the Alerts email for quick access to the sensor details in Studio. A simple way to achieve this is to put the link (URL) for the sensor in the description field of the sensor and include it in the message.
Step 1 - Add the sensor link (URL) to the sensor description
- Open the detailed view for a device in Studio
- Copy the URL from the browser address (typically at the top)
- Paste the URL into the description field for the sensor
Step 2 - Include the description field in the email
- Open the Alert rule
- Go to the "Send Email" section
- Include the $description placeholder in the Email body. It should look something like this:
- Save by selecting "Update Alert rule"
- Emails sent out will now include a link to the device in Studio
Note that the recipient needs a Studio account to access the device, and that you could do a similar approach using Labels.
Tip - emulated sensors
Use emulated sensors to test out your notifications with different values.