Audible Alarms in Perspective

I develop in a secure, air-gaped environment where it takes an act of congress to import modules. I needed a way to get audible alarms working for my remote endpoints and IA support saved the day.

For windows, navigate to the following directory:

C:\Program Files\Inductive Automation\Ignition\webserver\webapps\main\

Linux:

/usr/local/bin/ignition/webserver/webapps/main/

Create a new directory for your .wav alarm files and add the file you want to use.

Add an audio component on a header in your perspective project, something that is always visible and for the source property give it this:

http://ip_of_gateway/name of_new_directory/alarm.wav

To play the audio for critical alarms add an expression binding:

if(runScript('len(system.alarm.queryStatus(priority=[4],state=[2]))'>0, true, false))

to the play property.

I have tested this in Fedora, Debian, Gentoo, Arch, Elementary, Ubuntu, & windows server 19, 10 & 11 successfully and gotten this to work.

If you are a developer, or even just an audio nerd like me, you should check out Reaper before heading straight to Audacity:

This feature can become obnoxious very quickly so I would kindly suggest you normalize your audio and add in 10-15 seconds of dead air if you intend to loop the audio.

Be aware that using /webapps/main/ as location for serving static files is a technical accident. It works as long as you don't try deleting or replacing any files you put there. And if IA has to change anything in the platform that breaks this, you won't get an apology.

Well, you might but it will be in the form of "Sorry, but it stinks to be you..."

3 Likes

Thanks for the wisdom and guidance @pturmel. I normally clone my lab VMs and try to patch their copies so I can test functionality before any major updates to ignition on my production server. Our team relies upon those alarms for federal compliance, so I like to also keep my Fedora & Windows Server 2019 test lab as current as possible so I'm aware of any updates that will break this functionality they depend on.

I'm certain there is a better way, in the past this has caused browser errors for perspective users that can force you to change some flags to get it to work depending on which version/browser they use.

All that being said, you are absolutely correct that this could not work in the future, I'm thankful that it has worked for the past 2 years of updates and currently works for 8.1.44. Will update original post if this changes.

As a developer myself, I certainly wouldn't expect any apology for updating this industry leading tool. It's always a pleasure to upgrade and get access to their latest features. Perhaps IA might consider expanding the functionality of the image management tool to include .wav/mp3 as part of a future update. There don't seem to be many free options I have found to get this to work without installing separate software, which just isn't an expedient possibility with our compliance requirements.

Curious and excited to see other solutions from this community!

1 Like

Have you tried my free Blob Server module?

1 Like

Yes it's brilliant, well done!

It's the first solution I tried to push for when I had a break a few months ago related to browser flags. Just had a compliance time crunch and needed an emergency workaround. Everything I import into my server must be quarantined and go through a very lengthy approval process, and it stacks more monthly paperwork onto my compliance team so I try to keep ignition and all of my applications as bare-bones as I can. I think it would be cool if the Perspective audio component that comes with ignition would work for my users through perspective sessions without the need for additional software.

Could you point me in the direction of this module? The v1.0.0 link appears not found.

1 Like