# Conditions

## Current Value Compared to Fixed Value

In this example, an alarm will occur if the current value of the tag is >= 6:

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

## Current Value Compared to Value of Another Tag

In this example, an alarm will occur if the current value of the tag is >= the current value of the `Site 1/battery/1/Battery State of Charge` tag:

<figure><img src="/files/8MGLQPbOxE5P5aUhkM2C" alt=""><figcaption></figcaption></figure>

## Max Change Over a Time Interval Compared to Fixed Value

In this example, an alarm will occur if the absolute difference between the minimum and maximum value in the past hour is >= 10:

<figure><img src="/files/9gPBlBLbAjiRPUehHvsm" alt=""><figcaption></figcaption></figure>

## Max Change Over a Time Interval Compare to Value of Another Tag

In this example, an alarm will occur if the absolute difference between the minimum and maximum value in the past hour is >= the value of the `Site 1/battery/1/Battery State of Charge` tag:

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

## Tag is Unavailable for Amount of Time

In this example, the alarm will occur if the tag is not available (NA, in other words has no value) for 30 minutes straight:

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

## Bit Value

In this example, the alarm will occur if bit 12 (`1 << 12` or `0x1000`) of the tag is `1`. Only bits 0-31 of 32-bit integer values are supported (non-integer number values are ignored):

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

## Bit Field Alarms

In this example, the alarm will occur if bit 12 (`1 << 12` or `0x1000`) of the tag is `1`, but unlike the above example, this alarm is provided by the `Inverter Status` **Bit Field Type** that is assigned to the tag in the [Tag Settings](/clarity/tags/edit-settings.md) form. In this case, the **Severity**, **Bit**, **Active When 0/1**, and **Message** can't be changed here; they can only be changed by editing the bit field type (which will also affect alarms for all other tags with that bit field type).

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

## Custom Formulae

In this mode you can enter arbitrary conditions. All of the above conditions can be expressed as a custom formula, and when you switch to **Custom Formula** mode it will show the formula corresponding to the condition you had selected (unless any options were blank). The formula must evaluate to `true`, `false`, or `null`; any time it becomes `true`, it triggers an alarm event. See [Formula Language](/clarity/formula-language.md) for a complete guide to writing formulae.

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


---

# 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.jcore.io/clarity/alarms/configure/conditions.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.
