4 Replies Latest reply on Jun 12, 2015 1:37 AM by norah

    Creation of Pi Notification based on a value change

    norah

      Hi Guys

       

      I have been playing around with Pi notifications for while and manged to create some useful  but basic notifications for our senior management.

       

      But as with all good things, I have been asked to improve a basic notification into something more complex and at the moment I am a bit stumped.

       

      I have a level in a dam that we monitor very closely during this time of year (wet season lots of rain dam level increasing), and my simple notification was when LT1> number, start sending out a daily notification containing the level at 7:30 each morning.

       

      What I have been asked to do is to send out a notification every 5 cm above this level. so not time based, no matter what time of the day or night, an email with the value to a certain group of people.

      While I can do a separate notification for each 5 cm this is a bit messy, I thought that maybe I could create other element attributes that could hold the 5cm value and maybe compare values but still seems messy.

      I am currently trying to work out if there is an if then else but my logic skills are rusty so it could take a while.

       

      I would really appreciate if anyone has some suggestions to point me in the right direction.

       

      Cheers

      Norah

        • Re: Creation of Pi Notification based on a value change
          xwang

          Hi Norah,

           

          For this goal, the following could be as the reference.  There are 2 attributes, one is for your PI Tag (A), another is using PI Analysis to calculate (B).  It should be easy for you to do your normal notification when A > the value (value) you setting up.  Now, let us configure B for another noticiation:

           

          In PI Analysis, you might use the following logic as the reference:

          If A > value or (A - B > 5 and B <> 0) then A else if A < value or (Hour('*') = 7 and Minute('*') = 30) then 0

           

          For your second notification, please using B as the trigger with Natural method, and the condition is B <> 0.

           

          Wish this could help.

           

          Xi Wang

          PI Developer Club

          1 of 1 people found this helpful
            • Re: Creation of Pi Notification based on a value change
              dng

              Hi Norah,

               

              Another alternative would be to set up state groups to define multiple threshold values for your notification. For example, you can set a new state group which holds several state of the dam level: lowlow, low, medium, high, highhigh. You can then set your notification as follow:

              2015-03-09 15_22_33-__DNG-AF2014_Dev Support - PI System Explorer.png

              (In your case, you will have multiple conditions with values of 5 apart.) The idea is to use different states to identify conditions with the same input but different limit values in order to rank the alert states by the severity of the condition. Note that in this case, an email will be sent with the attribute value goes above 10, another email will be sent with the attribute value goes above 20. However, if the value goes from 20+ to 10+, no email will be sent. In this configuration, you will want to set your time rule to Natural Trigger.

               

              Of course, the downside of this method is you still have to manually configure each alert condition (5 cm apart). However, it can be useful if the level in the dam only rises to a certain level, or if you only want one alert after the level reached a critically high level.

              1 of 1 people found this helpful
            • Re: Creation of Pi Notification based on a value change
              pthivierge

              Hello Norah,


              Did Daphne or XI proposed solution worked for you?

              If so you can mark it as correct answer, otherwise please let us know if you if you have more questions or what you did to solve your problem.


              Regards