# How to pull Associated Alarm Data from the alarm event list generated with system.alarm.queryStatus?

**URL:** <https://forum.inductiveautomation.com/t/how-to-pull-associated-alarm-data-from-the-alarm-event-list-generated-with-system-alarm-querystatus/27527>\
**Category:** Ignition\
**Created:** [August 16, 2019, 6:07pm UTC](https://forum.inductiveautomation.com/t/how-to-pull-associated-alarm-data-from-the-alarm-event-list-generated-with-system-alarm-querystatus/27527 "2019-08-16T18:07:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattn1](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@mattn1](https://forum.inductiveautomation.com/u/mattn1)\
**Post date:** [August 16, 2019, 6:07pm UTC](https://forum.inductiveautomation.com/t/how-to-pull-associated-alarm-data-from-the-alarm-event-list-generated-with-system-alarm-querystatus/27527/1 "2019-08-16T18:07:11Z")

</div>

I am using system.alarm.queryStatus(state=[“ActiveUnacked”]) to poll the Gateway for any Active Unacked alarms. It returns a list of alarm events. I would like to pull out associated alarm data from the alarm event for each alarm event in the list.

Here is an example alarm event:  
{Source: ‘prov:\*\*\*\*\*wwtp1:/tag:Digesters/Digester\_1\_DO/Value:/alm:High Alarm’, Display Path: ‘Digester 1 Dissolved Oxygen’, UUID: ‘e53a939d-a2c7-485e-adc1-5095d710c462’, Current State: ‘Active, Unacknowledged’, Priority: ‘High’, Active Data: {mode=Above Setpoint, setpointA=21.0, eventValue=21.05, com.inductiveautomation.ignition.common.alarming.config.AssociatedData@1c1f3=Digester 1 Dissolved Oxygen High Alarm, name=High Alarm, eventTime=Fri Aug 16 13:51:54 EDT 2019, priority=High, displayPath=Digester 1 Dissolved Oxygen, enabled=true}, Clear Data: null, Ack Data: null, Runtime Data: {}}

The data I need is in the AssociatedData@1c1f3=Digester 1 Dissolved Oxygen High Alarm

is there a clean way to extract this information.  
Im working with Ignition 8.0.3

---

<div class="post-metadata">

**Author:** ![mattn1](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@mattn1](https://forum.inductiveautomation.com/u/mattn1)\
**Post date:** [August 16, 2019, 7:01pm UTC](https://forum.inductiveautomation.com/t/how-to-pull-associated-alarm-data-from-the-alarm-event-list-generated-with-system-alarm-querystatus/27527/2 "2019-08-16T19:01:50Z")

</div>

Not sure if this is the cleanest way of doing so but it seems to be working. I was able to use getActiveData().getProperties() and printed the list of properties

```auto
results = system.alarm.queryStatus(state=["ActiveUnacked"])
for Alarms in results:
	for Properties in Alarms.getActiveData().getProperties():
		print Properties

```

this gave me the following properties to choose from:  
mode  
setpointA  
eventValue  
com.inductiveautomation.ignition.common.alarming.config.AssociatedData@1c1f3  
name  
eventTime  
priority  
displayPath  
enabled  
I then used the com.inductiveautomation.ignition.common.alarming.config.AssociatedData@1c1f3  
as a key to pull out the associated data. And since I wanted it in a long string I used this code

```auto
results = system.alarm.queryStatus(state=["ActiveUnacked"])
ConcatenatedPropertyString=''
PropertyName = "com.inductiveautomation.ignition.common.alarming.config.AssociatedData@1c1f3"
for Alarms in results:
	for Properties in Alarms.getActiveData().getProperties():
		if str(Properties) == PropertyName:
			ConcatenatedPropertyString += str(Alarms.get(Properties))

```

---

<div class="post-metadata">

**Author:** ![mattn1](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@mattn1](https://forum.inductiveautomation.com/u/mattn1)\
**Post date:** [August 16, 2019, 7:09pm UTC](https://forum.inductiveautomation.com/t/how-to-pull-associated-alarm-data-from-the-alarm-event-list-generated-with-system-alarm-querystatus/27527/3 "2019-08-16T19:09:14Z")

</div>

it would be nice how the property name had settled on ‘com.inductiveautomation.ignition.common.alarming.config.AssociatedData@1c1f3’  
from an associated alarm property called TTS.

---

<div class="post-metadata">

**Author:** ![mattn1](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@mattn1](https://forum.inductiveautomation.com/u/mattn1)\
**Post date:** [September 4, 2019, 1:25pm UTC](https://forum.inductiveautomation.com/t/how-to-pull-associated-alarm-data-from-the-alarm-event-list-generated-with-system-alarm-querystatus/27527/4 "2019-09-04T13:25:11Z")

</div>

also note to all do not use the same parameters names as associative alarm property names, it really confuses the system.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 4, 2019, 4:32pm UTC](https://forum.inductiveautomation.com/t/how-to-pull-associated-alarm-data-from-the-alarm-event-list-generated-with-system-alarm-querystatus/27527/5 "2019-09-04T16:32:29Z")

</div>

> [@mattn1](#):
>
> `com.inductiveautomation.ignition.common.alarming.config.AssociatedData@1c1f3`

That identifier will not be the same once you restart your gateway. The `@1c1f3` is the object's hashcode in Java, identifying where it sits in the JVM's memory allocation (basically). The safer check is to use isinstance(), like this:

```auto
from com.inductiveautomation.ignition.common.alarming.config import AssociatedData

results = system.alarm.queryStatus(state=["ActiveUnacked"])
ConcatenatedPropertyString=''
for alarms in results:
	for prop in alarms.getActiveData().getProperties():
		if isinstance(prop, AssociatedData):
			ConcatenatedPropertyString += str(alarms.get(prop))

```

---

<div class="post-metadata">

**Author:** ![mattn1](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@mattn1](https://forum.inductiveautomation.com/u/mattn1)\
**Post date:** [September 4, 2019, 6:32pm UTC](https://forum.inductiveautomation.com/t/how-to-pull-associated-alarm-data-from-the-alarm-event-list-generated-with-system-alarm-querystatus/27527/6 "2019-09-04T18:32:02Z")

</div>

I appreciate you pointing out that the identifier will change on reboot. I have been working with a stable server that hasn’t needed restarting so I missed the trouble that that would cause.

I would like to fix my scripts so they will continue working if the gateway gets reset and am working with your code alteration. However, the isinstance(prop, AssociatedData) never returns true.

I did a print type() on AssociatedData and return \<type ‘java.lang.Class’\>

I did print type() on the prop in the for loop and it returns \<type ‘com.inductiveautomation.ignition.common.alarming.evaluation.EventProperty’\>  
for the property that I need, as well as every other property.

I don’t see how this will identify the needed associated data if all the properties are the same type. Am I missing something?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 4, 2019, 6:35pm UTC](https://forum.inductiveautomation.com/t/how-to-pull-associated-alarm-data-from-the-alarm-event-list-generated-with-system-alarm-querystatus/27527/7 "2019-09-04T18:35:34Z")

</div>

Hmm, maybe try `isinstance(prop.getType(), AssociatedData)` - the `EventProperty` wrapper should have an internal property with a type associated with it, which should be an instance of that `AssociatedData` class.

---

<div class="post-metadata">

**Author:** ![mattn1](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@mattn1](https://forum.inductiveautomation.com/u/mattn1)\
**Post date:** [September 4, 2019, 7:32pm UTC](https://forum.inductiveautomation.com/t/how-to-pull-associated-alarm-data-from-the-alarm-event-list-generated-with-system-alarm-querystatus/27527/8 "2019-09-04T19:32:51Z")

</div>

The isinstance() still never returns true. The type that gets returned from type(AssociatedData) is \<type ‘java.lang.Class’\> and doesn’t match any of the property types that gets spit out of the prop.getType().  
I ran:  
for alarms in results:  
for prop in alarms.getActiveData().getProperties():  
print str(prop)  
print str(prop.getType())  
print ‘+++++++++++++++++++++++++++++++++++++++++’  
to be able to see all the properties type that exist beneath the EventProperty wrapper.

I get:  
mode  
\<type ‘com.inductiveautomation.ignition.common.alarming.config.AlarmMode’\>  
+++++++++++++++++++++++++++++++++++++++++  
setpointA  
\<type ‘java.lang.Double’\>  
+++++++++++++++++++++++++++++++++++++++++  
eventValue  
\<type ‘java.io.Serializable’\>  
+++++++++++++++++++++++++++++++++++++++++  
com.inductiveautomation.ignition.common.alarming.config.AssociatedData@1c1f3  
\<type ‘java.lang.String’\>  
+++++++++++++++++++++++++++++++++++++++++  
name  
\<type ‘java.lang.String’\>  
+++++++++++++++++++++++++++++++++++++++++  
com.inductiveautomation.ignition.common.alarming.config.AssociatedData@9cb7c09e  
\<type ‘java.lang.Object’\>  
+++++++++++++++++++++++++++++++++++++++++  
eventTime  
\<type ‘java.util.Date’\>  
+++++++++++++++++++++++++++++++++++++++++  
priority  
\<type ‘com.inductiveautomation.ignition.common.alarming.AlarmPriority’\>  
+++++++++++++++++++++++++++++++++++++++++  
displayPath  
\<type ‘java.lang.String’\>  
+++++++++++++++++++++++++++++++++++++++++  
enabled  
\<type ‘java.lang.Boolean’\>  
+++++++++++++++++++++++++++++++++++++++++

\<type ‘java.lang.String’\> is used for the display path, and name property as well as the associated data I am trying to get data from so I don’t know if this would be a good unique identifier. It also doesn’t match the type from AssociatedData.

---

<div class="post-metadata">

**Author:** ![mattn1](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@mattn1](https://forum.inductiveautomation.com/u/mattn1)\
**Post date:** [September 6, 2019, 6:33pm UTC](https://forum.inductiveautomation.com/t/how-to-pull-associated-alarm-data-from-the-alarm-event-list-generated-with-system-alarm-querystatus/27527/9 "2019-09-06T18:33:46Z")

</div>

After restarting my gateway a few times I am now getting the name of the associated alarm data as I titled it.  
so when I run:

```auto
results = system.alarm.queryStatus(state=["ActiveUnacked"])
for Alarms in results:
	for Properties in Alarms.getActiveData().getProperties():
		print Properties

```

I now am getting:  
mode  
setpointA  
eventValue  
TTS  
name  
AreaDesc  
eventTime  
priority  
displayPath  
enabled

Very confusing that it wasn’t returning as TTS initially, but now it does so I can grab the data I need. Hopefully it doesn’t decide to switch back.

---

<div class="post-metadata">

**Author:** ![Kevin\_Garman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin_garman/32/48695_2.png) [@Kevin\_Garman](https://forum.inductiveautomation.com/u/Kevin_Garman)\
**Post date:** [November 4, 2025, 2:59pm UTC](https://forum.inductiveautomation.com/t/how-to-pull-associated-alarm-data-from-the-alarm-event-list-generated-with-system-alarm-querystatus/27527/10 "2025-11-04T14:59:24Z")

</div>

This is still happening….rebooting fixed it after I spent several hours trying to make it work as advertised. This needs to be fixed if it’s going to be required on the gold cert.
