# How to read values from Extended Alarm Configuration

**URL:** <https://forum.inductiveautomation.com/t/how-to-read-values-from-extended-alarm-configuration/27962>\
**Category:** Ignition Early Access\
**Tags:** ignition80\
**Created:** [September 3, 2019, 8:38am UTC](https://forum.inductiveautomation.com/t/how-to-read-values-from-extended-alarm-configuration/27962 "2019-09-03T08:38:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![oisin.gribben](https://avatars.discourse-cdn.com/v4/letter/o/9d8465/32.png) [@oisin.gribben](https://forum.inductiveautomation.com/u/oisin.gribben)\
**Post date:** [September 3, 2019, 8:38am UTC](https://forum.inductiveautomation.com/t/how-to-read-values-from-extended-alarm-configuration/27962/1 "2019-09-03T08:38:00Z")

</div>

HI,  
I am trying to read the alarm setpoint, enabled, displaypath etc… from a tag.  
I am using the getConfiguration to find which tags have alarms then doing a tag read on the tapath.alarms.  
it returns an ExtendedAlarmConfiguration object. Is this the right way to go about reading the alarm properties.

```auto
nodes = system.tag.getConfiguration(folder, True)

# Iterate over the results
for item in nodes:
     
    # Through the results, search each dictionary
    for key, value in item.iteritems():
         
        # ...looking for a 'tags' key
        if key == 'tags':
            # iterate over the tag configurations we found
            for tagConfig in value:
				for conf in tagConfig:
					if conf == "alarms": 
						filter = []
						path = folder+"/" + tagConfig["name"] + "." + conf
						p = system.tag.read(path)
						print p

```

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [September 3, 2019, 1:20pm UTC](https://forum.inductiveautomation.com/t/how-to-read-values-from-extended-alarm-configuration/27962/2 "2019-09-03T13:20:00Z")

</div>

It’s all in the config.

```python
nodes = system.tag.getConfiguration(folder, 1)

# Iterate over the results
for item in nodes:

	# Through the results, search each dictionary
	for key, value in item.iteritems():
	
		# ...looking for a 'tags' key
		if key == 'tags':
			# iterate over the tag configurations we found
			for tagConfig in value:
				# ...looking for a 'alarms' key
				if 'alarms' in tagConfig.keys():
					
					print tagConfig['name']			
					for alarm in tagConfig['alarms']:
						for alarmKey in alarm.keys():
							print ' ', alarmKey, ':', alarm[alarmKey]
						# print alarm listing sparator
						print ' ------------------'
					# print tag listing separator'
					print ' ______________________'

```

_Note: This only shows configured items. If there is no displayPath key, there isn’t one set up. If there is no enabled key, it’s enabled._

 ![2019-09-03_9-19-09](https://us1.discourse-cdn.com/inductiveautomation/original/2X/f/f361f148297d0df866146a799833f6de148f50f2.jpeg)

---

<div class="post-metadata">

**Author:** ![oisin.gribben](https://avatars.discourse-cdn.com/v4/letter/o/9d8465/32.png) [@oisin.gribben](https://forum.inductiveautomation.com/u/oisin.gribben)\
**Post date:** [September 19, 2019, 10:51am UTC](https://forum.inductiveautomation.com/t/how-to-read-values-from-extended-alarm-configuration/27962/3 "2019-09-19T10:51:25Z")

</div>

with this solution it seems that this only returns the tag on the lowest level.  
So I have a UDT with over 40 tags with 15 of them having alarms configured.  
The UDT also has 4 folders with tags inside with alarms configured on a few.  
The only tag that are returned are the ones in the folders.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [September 20, 2019, 7:06pm UTC](https://forum.inductiveautomation.com/t/how-to-read-values-from-extended-alarm-configuration/27962/4 "2019-09-20T19:06:06Z")

</div>

This will recurse through the config

```python
def iterTagConfig(dictIn, tab=0, folderIn = ''):
	keys = dictIn.keys()
	if 'tags' in keys:
		keys.append(keys.pop(keys.index('tags')))
	if 'alarms' in keys:
		keys.append(keys.pop(keys.index('alarms')))
	for key in keys:
		if isinstance(dictIn[key], dict):
			iterTagConfig(dictIn[key])
		elif key == 'tags':
			for tag in dictIn[key]:
				print ' ' * tab,'tag'
				iterTagConfig(tag, tab + 1, folderIn = folderIn + str(dictIn['path']) + '/')      
		elif key == 'alarms':
			print ' ' * tab, 'alarms'
			for tag in dictIn[key]:
				print ' ' * (tab+1),'alarm'
				iterTagConfig(tag, tab + 2)      
		else:
			if key == 'path':
				fullPath = folderIn + str(dictIn['path'])
				print ' ' * tab, key,":",dictIn[key],' fullPath =', fullPath
			else:
				print ' ' * tab, key,":",dictIn[key]

nodes = system.tag.getConfiguration(folder, 1)

for item in nodes:
	iterTagConfig(item)

```

---

<div class="post-metadata">

**Author:** ![oisin.gribben](https://avatars.discourse-cdn.com/v4/letter/o/9d8465/32.png) [@oisin.gribben](https://forum.inductiveautomation.com/u/oisin.gribben)\
**Post date:** [September 26, 2019, 10:59am UTC](https://forum.inductiveautomation.com/t/how-to-read-values-from-extended-alarm-configuration/27962/5 "2019-09-26T10:59:47Z")

</div>

Hi Jordan,

What should be in the itertag function on line 9 instead of v?

---

<div class="post-metadata">

**Author:** ![oisin.gribben](https://avatars.discourse-cdn.com/v4/letter/o/9d8465/32.png) [@oisin.gribben](https://forum.inductiveautomation.com/u/oisin.gribben)\
**Post date:** [September 26, 2019, 11:02am UTC](https://forum.inductiveautomation.com/t/how-to-read-values-from-extended-alarm-configuration/27962/6 "2019-09-26T11:02:17Z")

</div>

Never mind got it working.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [September 26, 2019, 12:36pm UTC](https://forum.inductiveautomation.com/t/how-to-read-values-from-extended-alarm-configuration/27962/7 "2019-09-26T12:36:52Z")

</div>

Thanks for the catch! Example updated.
