4 Replies Latest reply on Jun 12, 2018 4:11 PM by James_Lambert

    AF Email Based on Tag Value

    James_Lambert

      I am working with a few pi ping tags. I am trying to setup an AF notification to say if pingtag1 = "I/O Timeout" Send email to me.

       

      I've gone into AF and configured all of my tags. I can't seem to figure out the syntax to get tagval(pingtag1,'*') (which evaluates to 0ms ping currently) I'd like to get some syntax so that if that value changes to I/O timeout I get an email or SMS notification.

       

      Thanks,

       

      James

        • Re: AF Email Based on Tag Value
          Steve Boyko

          You want to start with if BadVal('tag1') to find out if it is a good value or not. If you want an email whenever it is anything but a millisecond value, this is all you need to check.

           

          If you want I/O Timeout specifically, I believe the DigText() function will allow you to compare the specific text.

          3 of 3 people found this helpful
            • Re: AF Email Based on Tag Value
              James_Lambert

              Steve

               

              I am trying to trigger this as an event frame. So when this tag triggers as I/O Timeout it generates an event frame that causes a specific rule in my AF to send out an email..... does that make sense?

               

               

               

              Thanks,

                • Re: AF Email Based on Tag Value
                  rschmitz

                  Hi James,

                   

                  I tihink this is what Steve was trying to point you towards. You can test if a tag has any kind of system error using:
                  BadVal(TagVal('I/O Timeout','*'))

                   

                  If you're just looking if the tag is specifically equal to I/O Timeout you can do that with:
                  DigState(TagVal('I/O Timeout','*')) = "I/O Timeout"

                   

                  -As an example I set up a Tag that reads I/O Timeout and mapped it to an attribute named I/O Timeout to demonstrate that this works.

                   

                   

                  Cheers,

                  Rob

                  3 of 3 people found this helpful