Difference between revisions of "Rule"

From Senfi Docs
Jump to: navigation, search
Line 23: Line 23:
  
 
== Rule execution options ==
 
== Rule execution options ==
;Evaluate Type
+
By setting '''Evaluate Type''' to '''Immediate''' or '''Polling''', you can choose to execute a Rule when new values are received for any Input Measurements, or periodically, regardless of whether any Input Measurements have changed.
: Immediate - Rule is executed immediately upon receipt of new values for any Input Measurements
 
: Polling - Rule is executed periodically, regardless whether the value of Input Measurement have changed.
 
  
 +
== Inputs, Conditions and Output ==
  
Before adding a Rule, you should already have an event or situation that you wish to be notified about. The event or situation should be one that can be detected by monitoring data received by Senfi. If not you will first need to send the relevant data to Senfi before Senfi can monitor those data.
+
Before adding a Rule, you should already have an event or situation that you wish to be notified about. The event or situation should be one that can be detected by monitoring data received by Senfi.
 +
 
 +
Select, as '''Inputs''', the '''Metrics''' and '''Measurements''' from which the event or situation can be detected from. Then, construct the set of '''Conditions''' that will evaluate to true when event or situation occurs. The result of said '''Conditions''' is the '''Output''' of the Rule.
 +
 
 +
== Actions ==
 +
Whenever '''Output''' changes (from true to false and vice versa), '''Actions''' may be executed. Examples of '''Actions''' are email, sms, sending a request to a webhook, triggering an alert in the dashboard.
 +
 
 +
=== Content of Actions & Description ===
 +
You can embed the value of an '''Input''' in the Rule's description and content of '''Action''' (title & body for email, message text for sms, request body content for webhook).  
 +
 
 +
== Misc ==

Revision as of 16:40, 18 September 2019

As introduced in general concepts, a Rule is a tool that you can use to monitor your assets and be notified of abnormal situations or events.

A rule in Senfi comprises of:

  • Inputs
  • Conditions
  • Output
  • Actions
  • Rule execution options

Inputs are evaluated by Conditions to generate a single boolean Output. When value of Output changes, Actions, such as email and dashboard alerts, are executed. Rule execution options allows you to configure how the Rule should execute. e.g: how often the Rule is evaluated, when to execute Actions etc.

 Inputs --> Conditions --> Output
 Output Changed --> Actions

Example

  • Input: iot_weighingscale_v1.battery_level
  • Condition: < 20
  • Action: Email reminder to replace battery
  • Rule execution option: Immediately (means evaluate this rule whenever there is any incoming measurement)

Rule execution options

By setting Evaluate Type to Immediate or Polling, you can choose to execute a Rule when new values are received for any Input Measurements, or periodically, regardless of whether any Input Measurements have changed.

Inputs, Conditions and Output

Before adding a Rule, you should already have an event or situation that you wish to be notified about. The event or situation should be one that can be detected by monitoring data received by Senfi.

Select, as Inputs, the Metrics and Measurements from which the event or situation can be detected from. Then, construct the set of Conditions that will evaluate to true when event or situation occurs. The result of said Conditions is the Output of the Rule.

Actions

Whenever Output changes (from true to false and vice versa), Actions may be executed. Examples of Actions are email, sms, sending a request to a webhook, triggering an alert in the dashboard.

Content of Actions & Description

You can embed the value of an Input in the Rule's description and content of Action (title & body for email, message text for sms, request body content for webhook).

Misc