I have a client who wants the following features for alarm notification.
Delayed notification - They don’t want an email or text msg sent until the tag has been in alarm for some user configurable time and they want to be able to have multiple delays. For instance critical alarms are send out after 30 seconds, non-critical alarms after 3 minutes.
Notification escalation - They want the oncall operator notified first and if he/she does not acknowledge the alarm within 5 minutes then all the back-up operators are notified.
Remote acknowledgement - When notified they want to be able to acknowledge the alarm from their phone.
I almost have the programming complete to implement these feature so I thought I would through-out a discussion describing how I am going about it and see if any of you see any gotchas or have better ideas. There is one piece of this puzzle in particular that I am unsure on, but I get to that in a minute.
My strategy (not using Ignitions notification at all).
For the delayed notification I am using the alarm severity so for instance if the severity is set to high then notification occurs in 30 seconds, medium-high in 3 minutes any other setting and the alarm is not emailed. Simple enough.
So first I query the alarm system for active and unacknowledged alarms, convert to a pyDataSet and then based on the severity compare the difference of the current time and the alarm timestamp with notification delay times. If it is time to notify then I send an sms text (via email of course) to the oncall operator. The message includes the alarm condition and a numeric acknowledgement code. When the message is sent I enter the transaction is a sql table with the time, alarm, who it was sent to and the ack code. The idea is that they can reply to the message and type in the ack code to acknowledge the alarm.
Now the fun part. First I will explain what I am trying to do then were I am at so far.
My idea is to read the email and parse out the ack code and the sender. Then enter that data in another sql table. The ack transaction is then compared with the send transaction to verify the sender and ack code received match. If they don’t match the ack transaction is thrown out, if they do match then then alarm is acknowledged.
I looked on the web for email to db applications and didn’t find a lot, I downloaded a program call email2db on Friday to give it a try. I installed the program 3 times and can’t get it to not crash on start-up so I have to wait until Monday to talk to the mfg. This app may or may not be the answer. In the mean time this weekend I wrote a python app to do the email read (using IMAP) and parse function. It actually works pretty well. At first I thought it would be cool to put this function in Ignition so I wouldn’t have any outside applications to deal with (I should have read that Ignition does not include the imaplib before hand ). So it looks like even if I use my app, it will be outside of ignition.
Do any of you have any experience with third party email to database apps or words of wisdom on using your own?
Also any thoughts you might have on my methodology would be great. I know I kind of glossed over what I am doing but I can provide coding if you would like to see it.