Tutorial: Using Conditional Rules¶
This tutorial will walk through setting up a conditional rule for an Asset Signal, specifically a
sustained threshold rule that incorporates time. It includes adding the threshold and status into dashboard panels and how to get notifications based on the rule.
What's a Rule?¶
Rules in ExoSense can be added to a digital asset's signal. Signals are streams of data, say for a temperature sensor, pressure, or a state like 'running'. Signals can be of type numeric, boolean, string, or JSON formatted data.
A rule is a function applied to this stream of specific signal data to look for a specific condition state such as values over a threshold. For a temperature sensor, which is numeric data, one might look for a value above 120. For boolean or string type data, rules can also be used for look for a specific bool value or a matching string condition. Each rule will specify the types of signals required (primitive types like numeric, string, boolean or measurable types like Temperature, Pressure, Electrical Current.)
Example use case¶
In this example, I have a digital asset with signals temperature, speed, electrical current, and vibration RMS. The real-time values are displayed along with a line chart showing historical data for the temperature signal.
Let's say that a temperature above 100 for more than 3 minutes would be a warning sign for us and if above 110 for 5 minutes would be a critical issue. We will create a 'Threshold' rule which allows specifying 1 or more thresholds, each threshold's alert level, and duration period that the threshold must be sustained.
Setting up a rule¶
Most real-world use cases for detecting a conditional state require the state to be seen for some amount of time. Simple thresholds (value is above or below for example) tend to generate false positives.
ExoSense's off the shelf rules support sustained options for rule conditions to ensure a condition exists before alerts are generated.
Sustained Duration: The condition must last for a set amount of time, meaning the last value(s) all must meet the condition logic such as greater than or equal to a threshold.
Repeated: The condition is met if a specific number of values meet the condition logic consecutively such as the 10 consecutive values greater than or equal to a threshold.
Repeated Count in a Time Duration: The condition is met if a specific number of values meet the condition logic within a given time duration such as the 10 values greater than or equal to a threshold within 10 minutes.
The rule is now running, we can see here initially it's in the 'Ok' state, none of the conditions have been met.
I can visualize this threshold rule and it's affect on the signal on my dashboard. Dashboard panels can be configured to show rule status and thresholds (if applicable) for signals used in that panel and that have a rule associated to them.
Now I have condition status information on my dashboard for that signal.
I can also choose to receive notifications (email or sms if enabled) for one or more assets. Find this in your user account profile area, going to the notifications tab. Here you choose which assets to subscribe to for notifications, the alert levels, and in the case of SMS your contact number and blackout periods.
When conditions are met¶
You can see in this updated screen shot what happens when a condition is met, in this case it's in warning state.
Now a few minutes later, you'll see the rule is in critical sate.
Rules and Asset statuses¶
When a rule for a signal on an asset moves to warning or critical level states, it will put the asset's overall status to that level. When viewing in asset lists, maps, and group views, this will be shown. (Note that Timeout is a different type of status but works the same way - any timeout rule will affect the entire asset's timeout status)
Here are some additional ideas on ways to use rules.
- Contains / Equal To / Boolean Rules can be used to look for specific states of non-numeric signals. For example, if a signal sends machine running codes or error messages, a rule can be set up to look for these conditions.
- Using a Transformation function before a rule allows detecting conditions based on multiple signals. For example, use a join function to calculate the delta of two signals and use a rule on the delta output signal.
- Build custom rules with advanced ExoSense tiers based on your system knowledge and ExoSense's Insights interface.