# Extanding the power of the Alarm Summmary component

**URL:** <https://forum.inductiveautomation.com/t/extanding-the-power-of-the-alarm-summmary-component/1892>\
**Category:** Ignition\
**Created:** [June 3, 2010, 7:19pm UTC](https://forum.inductiveautomation.com/t/extanding-the-power-of-the-alarm-summmary-component/1892 "2010-06-03T19:19:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@Robert](https://forum.inductiveautomation.com/u/Robert)\
**Post date:** [June 3, 2010, 7:19pm UTC](https://forum.inductiveautomation.com/t/extanding-the-power-of-the-alarm-summmary-component/1892/1 "2010-06-03T19:19:32Z")

</div>

I’m try to add filtering and the ability to look at alarm history.  
I have created a date selector and a couple of text boxes (for path and alarm filters)

I bound the Alerts property to this code:

`if ({Root Container.Alarms.Options.DateRange.selected},
    runscript("app.alarms.get_history_alarms()"),
    runscript("app.alarms.get_current_alarms()"))
`

The code it calls (app.alarms.get\_xxx\_alarms()) is:

[code]def get\_history\_alarms():  
import system  
import app  
options = app.alarms.get\_options()  
if options.getComponent(‘Device’).selected == 1:  
filterpath = options.getComponent(‘Text Field’).text+’_’  
else:  
filterpath = None  
if options.getComponent(‘Point’).selected == 1:  
filterpoint = options.getComponent(‘Text Field 1’).text+’_’  
else:  
filterpoint = None

```
startdate = options.getComponent('StartDate').date
enddate = options.getComponent('EndDate').date
return system.alert.queryAlertHistory("AlertHistory", path=filterpath, stateName=filterpoint,
    start=startdate, end=enddate, 
    activeAndAcked=1, clearAndAcked=1)

```

def get\_current\_alarms():  
import system  
import app  
options = app.alarms.get\_options()  
if options.getComponent(‘Device’).selected == 1:  
filterpath = options.getComponent(‘Text Field’).text+’_’  
else:  
filterpath = None  
if options.getComponent(‘Point’).selected == 1:  
filterpoint = options.getComponent(‘Text Field 1’).text+’_’  
else:  
filterpoint = None

```
return system.alert.queryAlertStatus(
    path=filterpath,
    stateName=filterpoint,
    activeAndUnacked=1, activeAndAcked=1,
    clearAndUnacked=1, clearAndAcked=0,
    flatten=0)

```

def get\_options():  
import system  
window = system.gui.getWindow(‘Alarm Summary’)  
container = window.getRootContainer()  
alarms = container.getComponent(‘Alarms’)  
options = alarms.getComponent(‘Options’)  
return options[/code]

However, it doesn’t seem to work. The control displays all current alerts regardless of the contents of the Alerts dataset. The documentation for the Alerts property says it’s read only and bindable ![:scratch:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/76d1620bec252bfac07050c889ff5a91dc8a9c25.gif ":scratch:")

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [June 3, 2010, 10:57pm UTC](https://forum.inductiveautomation.com/t/extanding-the-power-of-the-alarm-summmary-component/1892/2 "2010-06-03T22:57:58Z")

</div>

Yeah, the “read-only” part means exactly that - you can’t write to the alerts dataset. Bindable in this sense means that you can bind other things to it. The reason its there is to let you create labels for example that might be bound to an expression like:

```auto
"There are" + len({Root Container.AlertTable.alerts}) +" alerts"
```

Filtering capabilities are built-in, and adding historical capabilities are on the roadmap. In the meantime you’ll have to use a standard table and bind it up yourself.

---

<div class="post-metadata">

**Author:** ![Robert](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@Robert](https://forum.inductiveautomation.com/u/Robert)\
**Post date:** [June 7, 2010, 3:39am UTC](https://forum.inductiveautomation.com/t/extanding-the-power-of-the-alarm-summmary-component/1892/3 "2010-06-07T03:39:13Z")

</div>

You mean I actually have to do some work myself? _sigh_  
Oh well, I guess I call myself a programmer for a reason. I know you guys have been working hard on all my other requests. I’ve managed to come up with a solution that should work.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [June 14, 2010, 5:47pm UTC](https://forum.inductiveautomation.com/t/extanding-the-power-of-the-alarm-summmary-component/1892/4 "2010-06-14T17:47:28Z")

</div>

Thanks for your patience! We’ll get the alert history table in there in not too long.

---

<div class="post-metadata">

**Author:** ![scott\_stc](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@scott\_stc](https://forum.inductiveautomation.com/u/scott_stc)\
**Post date:** [August 9, 2010, 9:51pm UTC](https://forum.inductiveautomation.com/t/extanding-the-power-of-the-alarm-summmary-component/1892/5 "2010-08-09T21:51:44Z")

</div>

IA had a sample Alert History table that was downloadable for Factory PMI, but won’t work in Ignition. Are you going to update it to work in Ignition?

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [August 12, 2010, 5:46pm UTC](https://forum.inductiveautomation.com/t/extanding-the-power-of-the-alarm-summmary-component/1892/6 "2010-08-12T17:46:21Z")

</div>

The sample alert history table from FactoryPMI was nothing more than the standard Table component, with some query bindings pre-configured to query your database for alert history.

You can certainly still do this in Ignition.

1. Set up a database alert storage profile
2. Drop a table component on the screen
3. Drop a date-range component on the screen
4. Bind the table’s data property to a SQL Query binding that selects the alerts from the database where the t\_stamp is between the selected dates of the date-range component.

---

<div class="post-metadata">

**Author:** ![scott\_stc](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@scott\_stc](https://forum.inductiveautomation.com/u/scott_stc)\
**Post date:** [August 12, 2010, 9:54pm UTC](https://forum.inductiveautomation.com/t/extanding-the-power-of-the-alarm-summmary-component/1892/7 "2010-08-12T21:54:55Z")

</div>

Carl - I will do that. Thank you for the tip/reply.
