---
title: "Statistic Values in Smart Rules"
description: "Use calculated statistic values in Equation and Formula Smart Rules for advanced automation based on device data averages."
url: "https://taphome.com/en/docs/configuration/statistic-values-smart-rules/"
language: en
lastmod: 2026-11-08
generator: hugo
ai:
  topics: ["statistic-values","smart-rules","equation","formula","variables","automation"]
  questions: ["How do I use statistic values in Equation and Formula Smart Rules?","Where do I find the Variables section to select device statistics?","What predefined statistic values are available (average, actual value)?","How to compare humidity between two rooms using an Equation Smart Rule?","How to write an equation that triggers when humidity difference exceeds 10 percentage points?","Can I use device statistics for automation triggers?"]
---

# Statistic Values in Smart Rules

How to use calculated statistic values in Equation and Formula Smart Rules

Last updated: 2026-11-08

Currently it is possible to use calculated statistic value in **Equation** and **Formula** Smart Rules.

In **Variables** section, select device and pick one of its predefined statistic values:

![Variables statistics](https://taphome.com/documentation/statistic-values/variables-statistics.png)

> [!IMPORTANT]
> The list offers only statistics that already exist on the device. Create the statistic first: open the device, then **Statistics** → **Add new statistic**, and only then pick it in the smart rule. A variable whose statistic does not exist stays empty and the rule never reacts, without showing an error.

## Condition that lasts for some time

With **Period type** **Period to now** a statistic is a rolling window that ends at this moment, so it can tell how long a condition has lasted: the maximum over the last 3 hours at or below −5 °C means the temperature stayed there the whole 3 hours. **Current period** starts again at the full hour or at midnight and cannot do this. A complete example, switching between a heat pump and a gas boiler by outdoor temperature, is in [Bivalent heating](https://taphome.com/en/docs/functional-areas/heating-cooling/bivalent-heating/).

## Equation: Turn on vent if humidity in bathroom is 10 percentage points higher than in other room

Variables:

**Hu**
Humidity in bathroom - Average by hours

**Hu1**
Humidity in other room - Actual value

Equation:

```taphome
(Hu - Hu1) > 0.1
```

Action:

Vent → Turn on

**See also** — [Statistics and value info](https://taphome.com/en/docs/script/value-info/), [Scripts in smart rules and notifications](https://taphome.com/en/docs/script/smart-rules/).
