Rules define what actions are to be performed in response to events related
with the transmission of
new data. If the data meets the conditions specified in the rules,
a message of a
of a specific type.
Rules can be defined for:
A rule can be active or inactive.
An incoming data analysis rule is defined for:
You can limit the analysis to data no older than a specified number of minutes.
Hysteresis is taken into account when analyzing changes in values.
If the data meets the rule’s conditions, the system generates a notification with the selected severity level:
The notification is sent to the selected list of users.
Optionally, if the rule is no longer met (the data values return to the expected range), the system generates a notification sent to the specified list of users.
Data analysis conditions are defined by:
If the “script” checkbox is not selected on the form, the conditions can be defined by filling out the form fields that appear and specifying:
You can define several such conditions.
By defining conditions using a script, you can check more relationships than by selecting options from a form. For example, you can compare different measurements with each other.
The script must define a function ` checkRule() ` that returns a result by calling either ` conditionsNotMet() ` or ` conditionsMet()`.
Example:
def checkRule():
v1 = getValue("temperature1")
v2 = getValue("temperature2")
if v1 is None or v2 is None:
return conditionsNotMet()
if v2 - v1 > 10:
return conditionsMet("temperature2", v2)
return conditionsNotMet()
When creating message content, you can use the following variables:
{target.eui} - the EUI of the device to which the rule applies (if applicable to a device){target.name} - the name of the device to which the rule applies{tag.name} - the name of the device tag to which the rule applies{tag.value} - the value of the device tag (named {tag.name}) to which the rule applies{device.eui} - the EUI of the device for which the rule was triggered{device.name} - the name of the device for which the rule triggered{var} - the name of the measurement for which the rule was triggered{measurement} - the name of the measurement for which the rule triggered{value} - the measurement value that satisfies the rule{info} - if present, this is used to separate the message subject from its body{device.owner} - the username of the user who owns the device{device.team} - a list of usernames of users who are part of the device’s team{device.admins} - a list of usernames of users who are administrators of the deviceExample used in the message:
This is the notification subject{info}Attention! The {value} value of the {measurement} parameter for the device
{device.name} ({device.eui}) is above the target.