Alarm Notification Work-around

Hi all,

I have a client who wants the following features for alarm notification.

  1. 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.

  2. 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.

  3. 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 :cry: ). 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.


Nice workarounds. We will be adding functionality like this to Ignition, but it is still many months away.

I don’t have any experience with 3rd party email-to-db apps. I think writing your own in Python is a perfectly good way to go.

Happy coding.

I decided to use my python app for the email retrieval. Email2db appears that it would work great but I didn’t feel like putting in the time to configure it, besides at this point my app works just fine. We’ll see.

I now have all the scripting components completed and tested. I am in the processes of assembling and finishing the UI in Ignition for a Thursday deployment. Wish me luck.

Good luck!

Just thought I would through-out an Update.

The deployment went exceptionally well and I am very pleased with the way this performs (so is my client).

If anyone else is needing this kind of functionality I would be happy share my code and give a detailed explanation of my setup. Though my implementation is not a universal fix it might at least get someone started. No sense in reinventing the wheel if you don’t have to.


I’m interested :wink: while it’s exactly what we need. We have one more feature, wich is “alarm mask” ; in this scenario, the operator can set an alarm to be “masked” for a certain time during wich he won’t receive any alert. Meanwhile, alarm is still evaluated by the system. Useful when doing some calibration of sensors for example.

We should add voice messaging for our customer using this I’ve the technical specification if someone is need it.

Thank you for your sharing.

I will try to get the code bundled up and write up a brief description in the next day or so and get it posted. My implementation may already have the alarm mask functionality, albeit manually, that you are looking for. My interface allows the operator to enable/disable an individual alarm for text msg notification while still keeping it in the alarm system in Ignition. I will describe this in greater detail in my write-up.

Does Jython 2.5 contain imaplib?

Haven’t tried to use it, but it is indeed included in the Ignition python library set.


The attached zip file contains my code and a description with installation instruction. Please forgive the typo’s in my instructions pdf, I was in a rush.

Let me know if you have any questions once you have had a chance to review the code.
SMS (84.9 KB)

Hi WKetchman,

I have just seen your post, it seems very nice.
What is the purpose of the “user_contact_mapping” and I think its description is missing in your document.

I’ll try to make it run without SQLTag DB Provider.



The “user_contact_mapping” table links the “UserID” in the “users” table to the “alert_distro_contacts_ndx” in “alert_distro_contacts”. That table is used to get the username of the person(contact) that acknowledged the alarm. Because my ackRemote script is run on the gateway, the system.alert.acknowledgeAlert function requires a username (that and we can show who acknowledged an alarm on the alarm display in Ignition).

I hope that answers your question.

Sorry one other thing I may not have mentioned. I use a database authentication profile.



Thank you Wes, that’s what I’ve understood by reading the query.
I’ll test it and get you a feedback.
Have a nice we.

Hi WKetchman,

Sorry for bumping an old thread.

Do you still happen to have the code archive (SMS I am trying to solve the same problem and would like to take a look.


I still have to code and can upload it again if you would like, however that code stopped working after version 7.6 when alarm notification was added to Ignition. It could be modified I suppose to work in the current version, I just didn’t do it. Let me know if you still want me to upload SMSAck and I will do so when I get back in the office this evening.


Yes I would like to. I will post the my updated version also.


SMS (84.9 KB)

Here you go, let me know if you have any questions.

I get a 404 not found error.