# Uncertain initial value when I use system.tag.configure!

**URL:** <https://forum.inductiveautomation.com/t/uncertain-initial-value-when-i-use-system-tag-configure/40208>\
**Category:** Ignition\
**Created:** [November 2, 2020, 2:15pm UTC](https://forum.inductiveautomation.com/t/uncertain-initial-value-when-i-use-system-tag-configure/40208 "2020-11-02T14:15:24Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![lachguerabdallah](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lachguerabdallah/32/25558_2.png) [@lachguerabdallah](https://forum.inductiveautomation.com/u/lachguerabdallah)\
**Post date:** [November 2, 2020, 2:15pm UTC](https://forum.inductiveautomation.com/t/uncertain-initial-value-when-i-use-system-tag-configure/40208/1 "2020-11-02T14:15:24Z")

</div>

hello

i’m using system.tag.confgure to enable and disable alarms by scripting, when executing it for the first time the quality of the tag changes to 'uncertain initial value.

````auto
def overrideAlarmConfig(tagPath, alarmName, alarmProperty, value):
	config = system.tag.getConfiguration(tagPath)[0]
	for alarm in config['alarms']:
		if alarm['name'] == alarmName:
			alarm[alarmProperty] = value
			break
	basePath = tagPath.rsplit('/',1)[0]
	system.tag.configure(basePath, config, 'm')

overrideAlarmConfig("[default]D33/BO01/PIT_1001/PR2/MINS", "High", "enabled", 'true')```

'''

thanks you
````

---

<div class="post-metadata">

**Author:** ![justin.brzozoski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justin.brzozoski/32/13452_2.png) [@justin.brzozoski](https://forum.inductiveautomation.com/u/justin.brzozoski)\
**Post date:** [November 2, 2020, 3:51pm UTC](https://forum.inductiveautomation.com/t/uncertain-initial-value-when-i-use-system-tag-configure/40208/2 "2020-11-02T15:51:30Z")

</div>

Unfortunately, setting some properties at the top level of a tag with system.tag.configure, even to what should be their current value, causes weird side effects. I bumped into this with the [tag quality](http://forum.inductiveautomation.com/t/unexpected-behavior-configuring-tag-sets-quality-to-good/32767). The simplest solution I’ve found is to pass only the bare minimum config back into system.tag.configure when using “merge” mode.  
Try this:

````auto
def overrideAlarmConfig(tagPath, alarmName, alarmProperty, value):
	tagName = tagPath.split('/')[-1]
	basePath = tagPath.rsplit('/',1)[0]
	config = [{ 'name':tagName, 'alarms':[ { 'name':alarmName, alarmProperty:value }] } ]
	system.tag.configure(basePath, config, 'm')

overrideAlarmConfig("[default]D33/BO01/PIT_1001/PR2/MINS", "High", "enabled", 'true')```

````

---

<div class="post-metadata">

**Author:** ![lachguerabdallah](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lachguerabdallah/32/25558_2.png) [@lachguerabdallah](https://forum.inductiveautomation.com/u/lachguerabdallah)\
**Post date:** [November 2, 2020, 4:37pm UTC](https://forum.inductiveautomation.com/t/uncertain-initial-value-when-i-use-system-tag-configure/40208/3 "2020-11-02T16:37:41Z")

</div>

its working, but clears the other properties

---

<div class="post-metadata">

**Author:** ![justin.brzozoski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justin.brzozoski/32/13452_2.png) [@justin.brzozoski](https://forum.inductiveautomation.com/u/justin.brzozoski)\
**Post date:** [November 2, 2020, 6:32pm UTC](https://forum.inductiveautomation.com/t/uncertain-initial-value-when-i-use-system-tag-configure/40208/4 "2020-11-02T18:32:32Z")

</div>

Which version of Ignition are you running? I’ve used almost this exact method to enable/disable alarms without modifying any other properties of the tag or the alarm in 8.0.12 and newer.

---

<div class="post-metadata">

**Author:** ![justin.brzozoski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justin.brzozoski/32/13452_2.png) [@justin.brzozoski](https://forum.inductiveautomation.com/u/justin.brzozoski)\
**Post date:** [November 2, 2020, 7:13pm UTC](https://forum.inductiveautomation.com/t/uncertain-initial-value-when-i-use-system-tag-configure/40208/5 "2020-11-02T19:13:34Z")

</div>

Oh! Maybe the “true” value you are passing in should be a native Python `True` instead of a string. (I didn’t even notice that on my first read through…)

---

<div class="post-metadata">

**Author:** ![lachguerabdallah](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lachguerabdallah/32/25558_2.png) [@lachguerabdallah](https://forum.inductiveautomation.com/u/lachguerabdallah)\
**Post date:** [November 3, 2020, 11:47am UTC](https://forum.inductiveautomation.com/t/uncertain-initial-value-when-i-use-system-tag-configure/40208/6 "2020-11-03T11:47:26Z")

</div>

It doesn’t work, I have tried putting True instead of true.  
behaves like an ‘overwrite’ instead of merge

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 3, 2020, 12:08pm UTC](https://forum.inductiveautomation.com/t/uncertain-initial-value-when-i-use-system-tag-configure/40208/7 "2020-11-03T12:08:27Z")

</div>

Did you use `True` _without_ the quotes?

---

<div class="post-metadata">

**Author:** ![lachguerabdallah](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lachguerabdallah/32/25558_2.png) [@lachguerabdallah](https://forum.inductiveautomation.com/u/lachguerabdallah)\
**Post date:** [November 3, 2020, 12:30pm UTC](https://forum.inductiveautomation.com/t/uncertain-initial-value-when-i-use-system-tag-configure/40208/8 "2020-11-03T12:30:50Z")

</div>

I have tried to use it without quotes and with quotes, I attach the screenshots from before and after executing the code.

 ![before](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/9/a9ac4d09f3401ef958b5491d54f6a4283ff50716.jpeg)  
 ![after](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/b/0b95a71a3e627fa51697591dfac3f36d3a117b55.jpeg)

the code:

```auto
def overrideAlarmConfig(tagPath, alarmName, alarmProperty, value):
	tagName = tagPath.split('/')[-1]
	basePath = tagPath.rsplit('/',1)[0]
	config = [{ 'name':tagName, 'alarms':[ { 'name':alarmName, alarmProperty:value }] } ]
	system.tag.configure(basePath, config, 'm')

overrideAlarmConfig("[BB2]D45/BO01/PIT_1002/PR2/MINS", "High", "enabled", False)

```

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [November 3, 2020, 1:03pm UTC](https://forum.inductiveautomation.com/t/uncertain-initial-value-when-i-use-system-tag-configure/40208/9 "2020-11-03T13:03:30Z")

</div>

Doesn’t tagPath have to be a list of tags even if its just one tag?

---

<div class="post-metadata">

**Author:** ![lachguerabdallah](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lachguerabdallah/32/25558_2.png) [@lachguerabdallah](https://forum.inductiveautomation.com/u/lachguerabdallah)\
**Post date:** [November 3, 2020, 1:25pm UTC](https://forum.inductiveautomation.com/t/uncertain-initial-value-when-i-use-system-tag-configure/40208/10 "2020-11-03T13:25:35Z")

</div>

tagPath has more tags, but I just want to change the alarm property on a tag.  
 ![aa](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/1/815c11250043e1618eb80096df65b0d13cc95a89.jpeg)

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [November 3, 2020, 2:28pm UTC](https://forum.inductiveautomation.com/t/uncertain-initial-value-when-i-use-system-tag-configure/40208/11 "2020-11-03T14:28:10Z")

</div>

I’m fairly certain it is being caused by the tag being part of a UDT instance and you are attempting to override it and not just change the value of enabled.  
I am not familiar enough with version 8 yet to say how to override and not just change a tags enabled property.

---

<div class="post-metadata">

**Author:** ![lachguerabdallah](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lachguerabdallah/32/25558_2.png) [@lachguerabdallah](https://forum.inductiveautomation.com/u/lachguerabdallah)\
**Post date:** [November 3, 2020, 2:53pm UTC](https://forum.inductiveautomation.com/t/uncertain-initial-value-when-i-use-system-tag-configure/40208/12 "2020-11-03T14:53:21Z")

</div>

yes, it looks like it’s doing an overwrite instead of merging. is there a more correct way to change the properties of an alarm?
