> For the complete documentation index, see [llms.txt](https://docs.widgelix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.widgelix.com/actions-formerly-rule-engine/temporal-control.md).

# Temporal Control

### Overview

**Temporal control** lets a condition fire only after it has stayed true for a period of time, instead of the instant a value crosses a threshold. This prevents false alarms from brief, momentary readings and makes your actions react to *sustained* situations.

Without temporal control, a condition like `Temperature > 30°C` triggers the moment the sensor reports `30.1°C`, even if it was just a one-off spike. With temporal control, you can require the temperature to stay above `30°C` for, say, **10 minutes straight** before the action fires.

Temporal control is optional and configured **per condition** (per statement) in the action editor. Conditions without it keep working exactly as before.

***

### When to use it

* **Avoid false alarms**: only alert if a freezer stays warm for 10 minutes, not on a single noisy reading.
* **Detect sustained problems**: a pump running over pressure for 5 minutes is a real issue; a 2-second blip is not.
* **Reduce alert fatigue**: stop notifications that flap on and off when a value hovers near the threshold.
* **Geofences**: detect that a tracker stays outside an area, not just one stray GPS fix.

***

### Where to find it

1. Open or create an action (see [Creating an Action](https://docs.widgelix.com/actions-formerly-rule-engine/creating-an-action.md)).
2. Click a condition (statement) to open the **Configure Condition** panel.
3. Scroll to the **Temporal control** section at the bottom of the IS configuration.
4. Turn the toggle **on** to reveal the temporal options.

<figure><img src="https://2494440469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fggsr9Xlsze5cwVr4WMof%2Fuploads%2FR5L7IIfPAPAHdE8lbGiw%2Fcondition-hysteresis-temporal.png?alt=media&amp;token=11f52ec4-3ac1-4463-a95f-dbc013f14330" alt="Temporal control section" width="380"><figcaption><p>Temporal control with a 10-minute persist duration</p></figcaption></figure>

> **Note:** Temporal control is available for value and geofence conditions. It is **not** available for *Asset goes offline* conditions.

A statement with temporal control shows a timer line such as **For 10 min** on its card.

***

### Settings

#### Persist duration (required)

How long the condition must hold **continuously** before the statement becomes true.

* Enter a number and choose a unit: **sec**, **min** or **hour**.
* Default when you enable temporal control: **10 minutes**.

#### Ignore short spikes (optional)

Brief moments where the condition stops being true should not always reset your timer. With this enabled, a violation **shorter** than the configured duration (**Ignore violations shorter than**) is ignored and the timer keeps running.

* Example: with a 30-second ignore window, if the temperature dips below the threshold for 10 seconds and then climbs back up, the 10-minute timer is **not** reset.
* Default: **30 seconds**.

#### Reset after prolonged violation (optional)

If the condition stops being true for a **long** time, the accumulated progress is reset so a new sustained period is required.

* Example: if the condition is violated for more than 5 minutes, the timer goes back to zero.
* Default: **5 minutes**.

**Pause instead of full reset**

* **Off (default):** after a prolonged violation, progress is wiped and the count starts over from zero.
* **On:** progress is **paused and preserved** during the violation. When the condition becomes true again, counting resumes from where it left off.

***

### How the timing works

* **Server time is used.** Timing is based on when the platform evaluates each event, not on the device's clock.
* **Checks happen on incoming data.** The persist duration is evaluated whenever the asset sends an uplink. If an asset goes quiet, the check waits until the next uplink.
* **Unusual silence resets the condition.** If an asset stops reporting for far longer than its normal interval, the progress is reset.

***

### Works alongside other settings

* **Switching threshold range (hysteresis)** controls re-arming by *value*. Temporal control works by *time*. They are independent and can be used together on the same condition.
* **Multiple conditions.** Each condition has its own temporal control. For example, condition A can require 10 minutes while condition B is checked instantly.

***

### Examples

| Goal                                               | How to configure                                                                           |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| `Temperature > 30°C` sustained for 10 minutes      | Persist duration = `10 min`                                                                |
| Both `A` and `B` true for 10 minutes               | Persist duration = `10 min` on **both** conditions                                         |
| `A` true for 10 minutes **and** `C` true right now | Persist duration on `A`; leave temporal off on `C`                                         |
| Ignore 30-second dips                              | Enable *Ignore short spikes*, `30 sec`                                                     |
| Reset the timer after 5 minutes off                | Enable *Reset after prolonged violation*, `5 min`                                          |
| Soft reset (pause, then reset)                     | Enable *Reset after prolonged violation*, `5 min`, turn on **Pause instead of full reset** |

***

### Tips & FAQ

**Do I have to use temporal control?** No. Leave the toggle off and the condition fires instantly.

**What happens when I turn it off again?** The temporal settings are removed from the condition and it returns to instant behavior.

**Why didn't my action fire exactly at the 10-minute mark?** The duration is checked when the asset sends data. If it reports every minute, the action can fire up to one reporting interval after the duration is reached.

**Can I use very short durations?** Yes, durations can be entered in seconds.
