# editAlarmConfig replacement for alarm deletion after upgrading to 8.1

**URL:** <https://forum.inductiveautomation.com/t/editalarmconfig-replacement-for-alarm-deletion-after-upgrading-to-8-1/70860>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [March 9, 2023, 7:49pm UTC](https://forum.inductiveautomation.com/t/editalarmconfig-replacement-for-alarm-deletion-after-upgrading-to-8-1/70860 "2023-03-09T19:49:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew.gaitan](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Matthew.gaitan](https://forum.inductiveautomation.com/u/Matthew.gaitan)\
**Post date:** [March 9, 2023, 7:49pm UTC](https://forum.inductiveautomation.com/t/editalarmconfig-replacement-for-alarm-deletion-after-upgrading-to-8-1/70860/1 "2023-03-09T19:49:43Z")

</div>

Hey everyone,

Just wanted to add this here as it bit me after we upgraded from 7.9 to 8.1.

On 7.9 we could run the following script to remove an alarm from a tag

```auto
tagPath = 'Path/To/Tag/MyTag'
alarmName = 'Alarm'
system.tag.editAlarmConfig([tagPath], {alarmName: None})	

```

On 8.1 the code runs without error, but doesn't delete the alarm. I rewrote the script using `system.tag.configure` to achieve a similar result. Not as pretty, but it works

```auto
basePath = 'Path/To/Tag'
tagName = 'MyTag'
alarmName = 'Alarm'

alarms = [config for config in system.tag.getConfiguration(tagPath, True)[0]['alarms'] if config['name'] != alarmName]
system.tag.configure(basePath, [{'name': tagName, 'alarms': alarms}], 'o')

```

I tried for a bit to see if i could delete it without grabbing all alarms and excluding the one we don't want but gave up and went with this approch as I didn't want to spend too much time on it.

Hope this helps anyone in the future 🙂

---

<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:** [March 10, 2023, 4:54pm UTC](https://forum.inductiveautomation.com/t/editalarmconfig-replacement-for-alarm-deletion-after-upgrading-to-8-1/70860/2 "2023-03-10T16:54:18Z")

</div>

Hmm, that's surprising. We went to some significant pains to ensure backwards compatibility for all the legacy tag functions; it might just be that the `None` case wasn't one we knew about. Hyrum's law in action yet again.

---

<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:** [March 10, 2023, 4:55pm UTC](https://forum.inductiveautomation.com/t/editalarmconfig-replacement-for-alarm-deletion-after-upgrading-to-8-1/70860/3 "2023-03-10T16:55:40Z")

</div>

Out of curiosity, does it work if you explicitly call `system.tag.editAlarmConfig([tagPath], alarmConfig={alarmName: None})`?

---

<div class="post-metadata">

**Author:** ![Matthew.gaitan](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Matthew.gaitan](https://forum.inductiveautomation.com/u/Matthew.gaitan)\
**Post date:** [March 10, 2023, 5:07pm UTC](https://forum.inductiveautomation.com/t/editalarmconfig-replacement-for-alarm-deletion-after-upgrading-to-8-1/70860/4 "2023-03-10T17:07:01Z")

</div>

> [@paul-griffith](#):
>
> Hyrum's law in action yet again.

Lol yep! Even after months of testing there was still some stuff I missed.

> [@paul-griffith](#):
>
> Out of curiosity, does it work if you explicitly call `system.tag.editAlarmConfig([tagPath], alarmConfig={alarmName: None})`?

No luck unfortunately

---

<div class="post-metadata">

**Author:** ![illank86](https://avatars.discourse-cdn.com/v4/letter/i/c77e96/32.png) [@illank86](https://forum.inductiveautomation.com/u/illank86)\
**Post date:** [December 13, 2023, 8:20am UTC](https://forum.inductiveautomation.com/t/editalarmconfig-replacement-for-alarm-deletion-after-upgrading-to-8-1/70860/5 "2023-12-13T08:20:01Z")

</div>

Still doesnt work at 8.1.35

---

<div class="post-metadata">

**Author:** ![gottsche](https://avatars.discourse-cdn.com/v4/letter/g/ac91a4/32.png) [@gottsche](https://forum.inductiveautomation.com/u/gottsche)\
**Post date:** [May 3, 2024, 2:40pm UTC](https://forum.inductiveautomation.com/t/editalarmconfig-replacement-for-alarm-deletion-after-upgrading-to-8-1/70860/6 "2024-05-03T14:40:23Z")

</div>

Same problem here.  
I also tried your script @Matthew.gaitan, but is it possible that it not only removes the alarm? At least for me, it also overwrites the whole tag config: value source, data type,...  
I would really like to have an easy way again to remove alarms with a script
