> For the complete documentation index, see [llms.txt](https://docs.datacake.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.datacake.de/portal/rule-engine/new-rule-engine/using-configuration-fields-in-rule-conditions.md).

# Using configuration fields in rule conditions

Create one rule that compares measurements against device-specific thresholds.

{% hint style="info" %}
In short: Define a configuration field at product level, override its value where required, and select Configuration field from triggering device as the rule's comparison value.
{% endhint %}

## Overview

[Configuration fields ](/device/database/configuration-fields.md)are static settings defined for a product. They are available to every device of that product, while their values can be overridden for individual devices. This makes them useful when the same rule logic should apply to many devices but the comparison threshold differs by device.

For example:

| Device      | Target temperature |
| ----------- | ------------------ |
| Cold room A | 18 °C              |
| Cold room B | 20 °C (default)    |
| Cold room C | 22 °C              |

## 1. Create the configuration field

Open a device's Fields section, inside of Configuration. Configuration fields are defined at product level, which means, if you create it in one device of the product, all devices will have the same configuration field, with its default value.

<figure><img src="https://2221155863-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LNA8_b8wmabHgJ0QXoJ%2Fuploads%2FhQCZ588WWpOxXpUVOicZ%2FCleanShot%202026-09-08%20at%2013.19.55%402x.png?alt=media&amp;token=c73968be-af59-4fba-a9ff-b003223c6b1d" alt=""><figcaption></figcaption></figure>

Add a configuration field. For example, create Target temperature and select the appropriate unit, such as degrees Celsius.

<figure><img src="https://2221155863-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LNA8_b8wmabHgJ0QXoJ%2Fuploads%2F5sFg4GUD3QCjUxTwFeXk%2FCleanShot%202026-09-08%20at%2013.19.15%402x.png?alt=media&amp;token=68c1b6cc-ce46-45ed-82bf-5c40052e8c31" alt=""><figcaption></figcaption></figure>

Enter a default value. For example, use 20 °C. Every device of the product uses this value unless a device-specific value is set.

Override values where needed. Open a particular device and set its value, such as 18 °C or 22 °C.

{% hint style="warning" %}
Important: The configuration field must exist on the selected product. Check that every device covered by the rule has a valid default or device-specific value.
{% endhint %}

## 2. Create the rule

Create a new rule. Choose the New measurement recorded trigger and enter the rule name, description, and branding settings as required.

Select the product and devices. Choose the product that contains the measurement field and configuration field. Select the devices the rule should monitor.

Choose the measurement field. For a temperature rule, select Temperature as the field of interest.

<figure><img src="https://2221155863-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LNA8_b8wmabHgJ0QXoJ%2Fuploads%2FNX2Gp8FMNPefYMswxpp4%2FCleanShot%202026-09-08%20at%2013.21.37%402x.png?alt=media&amp;token=705807c9-bcc0-4ed8-bd8a-ecb92c079440" alt=""><figcaption></figcaption></figure>

## 3. Configure the condition

Choose Triggering device. When several devices are included, this refers to the device whose incoming measurement is currently being evaluated.

Select the measurement and time-range operation. Use Current value for the newest measurement, or an aggregation such as the maximum from one hour ago until now.

Select an operator. Available options include equals, less than, greater than, inside range, and outside range. For this example, choose Greater than.

Choose the comparison value. Select *Configuration field from triggering device*, then select the appropriate field, in this example "Target temperature".&#x20;

<figure><img src="https://2221155863-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LNA8_b8wmabHgJ0QXoJ%2Fuploads%2F4Q2vT662eel0zpHAxSwE%2FCleanShot%202026-09-08%20at%2013.22.19%402x.png?alt=media&amp;token=c264201b-35f3-4ab0-88b8-ed74dcdff41d" alt=""><figcaption></figcaption></figure>

Add the condition. The condition now evaluates each device's measurement against that same device's configured target.

{% hint style="info" %}
For this example, a device with a target of 18 °C triggers when its evaluated temperature exceeds 18 °C; a device with a target of 22 °C triggers only when it exceeds 22 °C.
{% endhint %}

## 4. Add an action and save

Add the action that should run when the condition is fulfilled, such as sending an email. Configure the recipients and message, add the action, and save the rule.

## Checklist

1. The configuration field is defined for the selected product.
2. A sensible default value is set.
3. Device-specific overrides are configured where necessary.
4. The rule monitors the correct product and measurement field.
5. The condition uses Triggering device and the intended time range.
6. The comparison source and field are correct.
7. An action is configured and the rule is saved.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.datacake.de/portal/rule-engine/new-rule-engine/using-configuration-fields-in-rule-conditions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
