FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
07-13-2023 05:39 PM
I am using the IoT Dashboard app on the CORE to build a dashboard. I want to send an email/text notification when specific recordings fall outside of range. I do not fully understand the differences between alerts and notifications and how they interact with each other, so I started with creating an alert. The alerts seem to be firing at inconsistent times. I have included two screenshots of when the alerts fired at a time when they shouldn't have and one where they didn't fire and they were expected to. There are also times when it fires at -300 but not at 300, so I do not believe I have the alert firing range mixed up with the normal range. Why is this happening and how do I configure this to fire between the ranges 600 - 800 as well as -600 - -800?
Solved! Go to Solution.
07-13-2023 07:24 PM - edited 07-14-2023 03:05 PM
Hi Erin,
There are a couple of pieces here.
In your images, you have your Reduce expression selected as the alert condition. I'm unsure of how this is actually evaluated to true or false as an alert condition, but it is not what you want selected. Only a single expression can be selected as the alert condition, so the Threshold expression won't work for your case. You'll want to use the Math expression and write a comparison such as (-800 < $B < -600 || 600 < $B < 800). See Flux Query Alert Example for a nice walk through.
You don't have this included in your screenshots, but make sure to set the evaluation duration to 0 if you'd like to fire the alert on the first instance of your triggered alert condition. Otherwise, the alert will be in a pending state until the condition has been satisfied for the specified duration.
Also, it's important to understand how the alerts are evaulated. When you query a dataset, you are pulling some range of time series data. For example, (now-10m to now). You then execute a Reduce function to convert the time series data into a single value. This is then passed into the alert condition function for evaluation. Alert conditions are only evaluated every 10s at a minimum, so this means its possible to have at least a 10s delay between when data enters your threshold and when the alert condition is checked and fired.
TLDR, these alerts are not really set up to check each data point as they arrive. It is not a real time alarming system. Keep in mind that decreasing alert evaluation frequency increases RAM and CPU usage.
07-14-2023 10:36 PM
I understand what you were saying above about the reduce function and the expression working better. In the pictures I have attached, you can see that the expression seemed to work with the positive number, but when it showed -615, the graph is still green and it hasn't triggered an alert. In both images it says firing, and even says it when the number is within range like -527. Does the red only signify alerts or does it send an alert whenever it shows 1 firing. Would I be better off creating 2 alerts for the same data set but one is a threshold between -800 and -600, while the other is between 600 and 800?
07-17-2023 05:41 PM
It will alert according to your alert evaluation behavior whenever the alert condition is firing. I am not exactly sure where the query stat plot is getting its coloring from. It should not be triggering alert on a value of -527 according to your alert condition. Can you send an image of this happening?
11-14-2023 05:04 PM
@humese Are there any news? Is this still an issue? Or can this topic be closed?