cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Ignore some data samples for Alert

emoreira
14-Alexandrite

Ignore some data samples for Alert

Hello All,

I am creating an application where I monitor a Current data stream and in my case in the begging of the process the property has an overshoot that should not be considered (in Red):

I thought about doing a condition with the orange line ( if >7 then Alert). I know I could create a flag and set it but I'm curious to know if there is something that could be done using the Alerts capability.

Any thoughts?

Cheers

Ewerton

ACCEPTED SOLUTION

Accepted Solutions
emoreira
14-Alexandrite
(To:emoreira)

I just tested it and it works!

I subscribed to the property and added this code:

var params = {

  persistent: undefined /* BOOLEAN */

};

(eventData.newValue.value <15.0 || eventData.newValue.value > 490.0)? me.DisableAllAlerts(params):me.EnableAllAlerts(params)

Any other feedback is appreciated!

View solution in original post

6 REPLIES 6
ttielebein
14-Alexandrite
(To:emoreira)

Sorry, I am confused. You want an alert to fire when what happens exactly?

emoreira
14-Alexandrite
(To:ttielebein)

I want the alert to fire when the reading exceeds the limits but not in the begging in the process because it is known that this overshoot makes the property to go over the limit and it is not a problem.

Cheers

Ewerton

ttielebein
14-Alexandrite
(To:emoreira)

You should be able to just add an alert to an integer or number property. Alerts do allow you to set a threshold, if that is what you need. Just go to the property in question, edit it, click "Manage Alerts" and then select "Above" as the type of the alert and enter the threshold in the "Limit" box.

sharmon
13-Aquamarine
(To:ttielebein)

To account for the overshoot, I'd test for conditions that indicated the device was in "startup" mode in the subscription for the "out of range" alert. IOW, in either the subscription, or the service the subscription runs, the first test would be"

if (conditions that indicate I'm in startup) {

  no op, log entry, etc.

} else {

  raise a notification

}

You may have to be clever to make that determination - I don't know which properties are available to you.

emoreira
14-Alexandrite
(To:sharmon)

Thanks Stephen.

This was my initial approach (use subscription instead of using the Alerts capability).

One thing that just occurred when me I was replying your message    is that I can create a subscription that monitors one of the variables and add  in the condition:

  1. if (conditions that indicate I'm in startup) { 
  2.   me.DisableAllAlerts
  3. } else
  4.   me.EnableAllAlerts
  5. }

In this way I can use the OOTB alerts feature.

Cheers

Ewerton

emoreira
14-Alexandrite
(To:emoreira)

I just tested it and it works!

I subscribed to the property and added this code:

var params = {

  persistent: undefined /* BOOLEAN */

};

(eventData.newValue.value <15.0 || eventData.newValue.value > 490.0)? me.DisableAllAlerts(params):me.EnableAllAlerts(params)

Any other feedback is appreciated!

Announcements


Top Tags