Skip to content

Standard Conditions ​

This page describes the standard conditions for rules.

openHAB comes with a set of standard conditions. These are built-in mechanisms that decide if a rule should be executed when triggered.

Conditions Structure ​

The standard conditions are fundamentally Java classes that implement the required logic. We identify these conditions using a code called the condition type. These codes are used as titles for the sections below. To tell the condition implementation what to evaluate, conditions can have configuration parameters with predefined names. These configuration parameters and a brief description of what values they expect are listed in the following sections.

ephemeris.DaysetCondition ​

This condition checks if the current day is in the configured dayset.

ParameterDescription
daysetThe name of a dayset from the ephemeris settings.
[offset]The number of days to add to or subtract from the current day (values can be negative).

ephemeris.WeekdayCondition ​

This condition verifies that the current day is a weekday.

ParameterDescription
[offset]The number of days to add to or subtract from the current day (values can be negative).

ephemeris.WeekendCondition ​

This condition verifies that the current day is in a weekend.

ParameterDescription
[offset]The number of days to add to or subtract from the current day (values can be negative).

ephemeris.HolidayCondition ​

This condition verifies that the current day is a holiday.

ParameterDescription
[offset]The number of days to add to or subtract from the current day (values can be negative).

ephemeris.NotHolidayCondition ​

This condition verifies that the current day isn't a holiday.

ParameterDescription
[offset]The number of days to add to or subtract from the current day (values can be negative).

timer.DayOfWeekCondition ​

This condition checks the current day of the week against a specified list of days.

ParameterDescription
daysA set of days to check against. The days are specified with the following strings: MON, TUE, WED, THU, FRI, SAT, and SUN.

timer.IntervalCondition ​

This condition verifies that a minimum interval has elapsed since the last time the condition was met.

ParameterDescription
minIntervalThe minimum number of milliseconds since the last satisfied evaluation.

core.ItemStateCondition ​

This condition verifies that the State of the specified Item fulfills the requirements.

ParameterDescription
itemNameThe name of the Item.
operatorThe evaluation operator, one of =, !=, <, <=, >, and >=.
stateThe State to compare with.

script.ScriptCondition ​

This condition verifies that the provided script returns true.

ParameterDescription
typeThe code/MIME-type for the scripting language.
scriptThe script content in the specified scripting language.

core.ThingStatusCondition ​

This condition verifies that the status of the specified Thing fulfills the requirements.

ParameterDescription
thingUIDThe UID of the Thing.
operatorThe evaluation operator, either = or !=.
statusThe status to compare with. Valid statuses are UNINITIALIZED, INITIALIZING, UNKNOWN, ONLINE, OFFLINE, REMOVING and REMOVED.

core.TimeOfDayCondition ​

This condition verifies that the clock is within the specified time window.

ParameterDescription
startTimeThe start of the time window.
endTimeThe end of the time window.