# Sensor rules

Sensor rules in Efento Cloud enable you to monitor sensor measurements and automatically trigger alarms or notifications when specific conditions are met. These rules help ensure timely responses to critical events, improve system reliability, and allow for automated monitoring of your environment. Sensor rules are highly configurable, allowing you to define thresholds, timing, recipients, and notification methods for each sensor or sensor channel.

All rule management options are available exclusively to users with **Administrator** or **Manager** permissions. Users with other roles can view alarms triggered by the rules but cannot access or modify the rules themselves.

## Types of sensor rules

Sensor rules can be triggered by different types of events or **stimuli**, depending on what you want to monitor. Understanding the types of rules available helps you choose the appropriate conditions for your monitoring needs:

1. **Threshold exceeded** – Triggered when a sensor measurement goes beyond a defined value. This type of rule is ideal for monitoring environmental or physical conditions such as temperature, humidity, pressure, or other measurable values. You can specify whether the alarm should be triggered when the measurement exceeds an upper threshold (**Above**) or falls below a lower threshold (**Below**).
2. **Low power level** – Monitors the sensor’s battery status. When a low battery condition is detected, the platform generates an alarm. The sensor continues operating for approximately 30 days after a low battery alert, giving you time to replace it before it stops reporting measurements.
3. **Lost connection** – Triggered if the platform does not receive measurements from a sensor within the expected timeframe. This type of rule ensures you are immediately notified of sensors that stop transmitting data, allowing you to investigate potential issues quickly.

## Creating a Sensor rule

Creating a sensor rule involves defining the conditions that trigger the alarm and configuring how it should behave. This section explains the step-by-step process to ensure the rule works as intended. To create a new rule click **Create new rule** in the upper-left corner of the **Sensors** tab.

<figure><img src="/files/TYKBfQCa3clbkO3D6M5J" alt=""><figcaption></figcaption></figure>

{% stepper %}
{% step %}

### Define conditions

1. Enter a **rule name** (up to 50 characters) to easily identify it later.
2. Select the **event type** (stimulus) for the alarm.
   * For threshold-based rules, choose **Above** or **Below** and enter the threshold value.
   * For low battery or lost connection rules, no additional fields are required.

![](/files/056cc898dc8d4375dc306ec913fe4154678a6d04)

{% hint style="info" %}
You may optionally configure a **delay** for evaluating the rule’s condition and/or l**imit the rule so that it is active only during selected time periods**. Click the expandable sections below to learn how to set these options.
{% endhint %}

<details>

<summary>Delay (optional )</summary>

Use the **delay feature** to avoid triggering alarms for short-term fluctuations. Check **Use delay in assessing the rule’s condition** and set a delay in minutes. The alarm will only trigger if the condition persists beyond this delay

</details>

<details>

<summary>Rule schedule (optional)</summary>

By default, every rule in Efento Cloud is active **24 hours a day, 7 days a week**. This means that any time the rule’s condition is met (regardless of day or hour) an alarm will be generated and notifications will be sent to assigned recipients.

However, in many real-world scenarios, you may want a rule to apply **only during specific time periods**. Examples include:

* Temperature monitoring required only during business hours
* Weekend-only supervision of storage areas
* Alarm rules that should be active outside working hours (e.g., "after-hours door opening")
* Rules that must be inactive during scheduled maintenance periods

The **Rule Schedule** feature allows you to precisely control *when* a rule is monitored and *when* notifications can be triggered.

**Enabling Scheduled Operation**

To limit a rule to specific days and times:

1. In the rule configuration window, check the box **Enable the rule only within the specified time ranges**.
2. A weekly table will appear, showing all days of the week and indicating when the rule is active.
3. Click **Add hours ranges** to define one or more time intervals during which the rule should operate.

**Defining Time Ranges**

When the **Add hours ranges** button is selected:

* Choose one or multiple days of the week.
* Define the time period during which the rule should be active (start and end hours).
* Click **Save** to add the interval.

<p align="center"> <img src="/files/b95aaa88da2c429614511d24a271a00417fa5d72" alt="" data-size="original"></p>

**Multiple intervals per day are supported.**\
This allows precise scheduling for complex work patterns or shift-based operations. Examples:

* **Business-day monitoring:**
  * Monday–Friday, 08:00–17:00
* **Out-of-hours monitoring:**
  * Monday–Sunday, 00:00–08:00
  * Monday–Sunday, 17:00–23:59
* **Shift-based activity:**
  * Monday–Sunday: 06:00–14:00, 14:00–22:00

Each defined range appears as a removable "chip" under the selected day(s). To remove a range, click the **“X”** icon in the chip.

**How Scheduled Rules Work**

Once schedules are configured, Efento Cloud will:

* Trigger alarms only during active periods
* Send notifications only when the rule is active
* Ignore threshold breaches that occur outside scheduled time windows
* Automatically resume monitoring once the scheduled active period begins again

This prevents unnecessary alerts and ensures alarms are raised only when relevant for your operational requirements.

{% hint style="info" %}
**Important Notes**

* Scheduled rules apply to **all devices assigned to the rule**.
* If a rule is disabled due to scheduling and an alarm occurs outside active hours, it **will not be recorded** and **no notifications** will be sent.
* If a measurement exceeds a threshold just before the scheduled time period begins, the alarm will be triggered immediately once the rule becomes active.
* If you need rules active 24/7, leave scheduling disabled (default).
  {% endhint %}

</details>
{% endstep %}

{% step %}

### Assign sensors

Once the rule is defined, you need to assign the sensors it applies to. This determines which devices will trigger the rule:

1. **Assign to all sensors in a location** – Automatically applies the rule to every sensor in the selected location, including sensors added in the future. This is useful for universal rules like *Low battery* or *Sensor lost*.
2. **Select individual sensors** – Allows you to choose specific sensors and channels. Navigate to **Select sensors**, click **Add sensors**, and select the desired devices and channels. This method provides precise control for rules that apply only to certain sensors.

Assigned sensors appear in the configuration summary. Remove sensors by clicking the **trash can icon**. Save the rule after assigning sensors. Existing rules can be modified anytime from the rule list.

![](/files/35a083c9e8f10faf07e5691f6157d7448026c323)
{% endstep %}

{% step %}

### Select notification recipients

To ensure that alerts reach the right people, you must assign recipients for each rule. Efento Cloud provides multiple notification channels, allowing flexibility in how users are informed:

* **Email** – Sent to the user’s registered email address
* **Phone call** – Automatically calls the user (requires phone number in Profile)
* **SMS** – Sent to the user’s phone number (requires phone number in Profile)
* **Push notification** – Sent to users with the Efento mobile app

{% hint style="danger" %}
To use push notifications, the recipient must install [Efento mobile application for Android](https://play.google.com/store/apps/details?id=pl.efento.cloud\&hl=en) and log into their Efento Cloud account
{% endhint %}

To activate notifications, click **Add recipients** and select the desired users. For each recipient, click **Select recipient**, then **Save**. You can then define notification channels for each recipient by clicking **Add notifications** and configuring how and when they are notified:

* **Notification delay** – Stagger notifications for escalation purposes. For example, the first user receives a push notification immediately, and another user receives a phone call if the alarm persists.
* **Notification channels** – Choose one or multiple channels: email, SMS, phone call, push.
* **Notification repetitions** – Determine how often notifications are resent while the alarm remains active.

![](/files/06442d4bbae447b85b761736b6ed854f98552999)

Multiple notifications can be added for the same user to create escalation workflows. **Email and push notifications are free**, while **SMS and phone call notifications** require a purchased message or call pool.

{% hint style="danger" %}
Phone call notification is repeated three times (5 minute gaps), if unanswered. If the user’s mobile phone is out of the network range or switched off they won’t get the notification. If the user has voicemail enabled, they also won’t be notified.
{% endhint %}
{% endstep %}

{% step %}

### (Optional) Add integrations

You can connect **Webhook** or **Slack** integrations to any alarm rule. When the rule is triggered, the platform will automatically send a message to the configured channel:

* [**Webhooks**](/efento-cloud/integrations/alert-webhooks.md) – Sends JSON data to a specified HTTP endpoint for third-party integration
* [**Slack**](/efento-cloud/integrations/slack-integration.md) – Sends messages to a Slack channel

To attach an integration to a rule, click **Connect integration**, choose the integration type (Slack or Webhook), and select the appropriate notification channel. If needed, you can also enable repeated notifications by checking **Repeat notifications** and defining how often the message should be resent while the rule remains active.

{% hint style="warning" %}
You must configure the integration in the [*Integrations*](/efento-cloud/integrations/measurement-webhooks.md) section before enabling it.
{% endhint %}
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.efento.io/efento-cloud/advanced/markdown/sensor-rules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
