Type Definitions
ConditionCallback() → {boolean}
- Source:
Returns:
true if the condition is met, otherwise false
- Type
- boolean
EventObject
- Description:
When a rule is triggered, the script is provided the event instance that triggered it. The specific data depends on the event type. The
EventObject
provides several information about that trigger.Note:
Group****Trigger
s use the equivalentItem****Trigger
as trigger for each member. Time triggers do not provide any event instance, therefore no property is populated.
- Source:
Properties:
Name | Type | Description |
---|---|---|
oldState |
string | only for |
newState |
string | only for |
receivedState |
string | only for |
receivedCommand |
string | only for |
itemName |
string | for all Item-related triggers: name of Item that triggered event |
groupName |
string | for all |
receivedEvent |
string | only for |
channelUID |
string | only for |
oldStatus |
string | only for |
newStatus |
string | only for |
status |
string | only for |
thingUID |
string | for all Thing-related triggers: UID of Thing that triggered event |
cronExpression |
string | for |
time |
string | for |
timeOnly |
boolean | for |
offset |
number | for |
eventType |
string | for all triggers except |
triggerType |
string | for all triggers except |
eventClass |
string | for all triggers: Java class name of the triggering event |
module |
string | (user-defined or auto-generated) name of trigger |
raw |
* | original contents of the event including data passed from a calling rule |
payload |
* | if provided by event: payload of event in Java data types |
When a rule is triggered, the script is provided the event instance that triggered it. The specific data depends on the event type. The EventObject
provides several information about that trigger.
Note:
Group****Trigger
s use the equivalent Item****Trigger
as trigger for each member.
Time triggers do not provide any event instance, therefore no property is populated.
Type:
- object
ItemConfig
- Description:
configuration describing an Item
- Source:
Properties:
configuration describing an Item
Type:
- object
RuleCallback(event)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
event |
EventObject |
RuleConfig
- Description:
configuration for
rules.JSRule
- Source:
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name |
string | name of the rule (used in UI) |
||
description |
string |
<optional> |
description of the rule (used in UI) |
|
triggers |
HostTrigger | Array:.<HostTrigger:> |
<optional> |
which will fire the rule |
|
execute |
RuleCallback | callback to run when the rule fires |
||
id |
string |
<optional> |
UID of the rule, if not provided, one is generated |
|
tags |
Array:.<string:> |
<optional> |
tags for the rule (used in UI) |
|
ruleGroup |
string |
<optional> |
name of rule group to use |
|
overwrite |
boolean |
<optional> |
false
|
whether to overwrite an existing rule with the same UID |
switchItemName |
string |
<optional> |
(optional and only for |
configuration for rules.JSRule
Type:
- object