# Deleting an alarm through scripting?

**URL:** <https://forum.inductiveautomation.com/t/deleting-an-alarm-through-scripting/11706>\
**Category:** Ignition\
**Created:** [May 20, 2016, 11:14pm UTC](https://forum.inductiveautomation.com/t/deleting-an-alarm-through-scripting/11706 "2016-05-20T23:14:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![son122](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@son122](https://forum.inductiveautomation.com/u/son122)\
**Post date:** [May 20, 2016, 11:14pm UTC](https://forum.inductiveautomation.com/t/deleting-an-alarm-through-scripting/11706/1 "2016-05-20T23:14:25Z")

</div>

How would I remove alarm definition from a tag?

EditAlarmConfig just configures existing alarms. Best I could do with it was reset all the alarm configuration to default, but I need to delete.

```auto
system.tag.editAlarmConfig(tagPaths, {'Alarm': []})
```

EditTag, I’m not sure what the alarmList parameter is for; the manual says it is a string type, but I think it is a string array?  
I was hoping I could just not include the alarm I wanted to delete in the alarmList parameter.  
No dice.

```auto
system.tag.editTag(tagPath = tagPath, alarmList = '', alarmConfig = {'Alarm': []})
- or -
system.tag.editTag(tagPath = tagPath, alarmList = [''], alarmConfig = {'Alarm': []})
```

---

<div class="post-metadata">

**Author:** ![salbrechtsen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/salbrechtsen/32/18660_2.png) [@salbrechtsen](https://forum.inductiveautomation.com/u/salbrechtsen)\
**Post date:** [July 7, 2017, 11:09pm UTC](https://forum.inductiveautomation.com/t/deleting-an-alarm-through-scripting/11706/2 "2017-07-07T23:09:08Z")

</div>

I would like to know if this is possible as well.

---

<div class="post-metadata">

**Author:** ![Caleb\_Bohon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/caleb_bohon/32/3293_2.png) [@Caleb\_Bohon](https://forum.inductiveautomation.com/u/Caleb_Bohon)\
**Post date:** [July 13, 2017, 12:56am UTC](https://forum.inductiveautomation.com/t/deleting-an-alarm-through-scripting/11706/3 "2017-07-13T00:56:40Z")

</div>

You could disable the alarm using that script.

```auto
system.tag.editAlarmConfig(tagPaths, {'Alarm': [["enabled","Value","0"]]})

```

Or you might be able to do it with:

```auto
system.tag.editTag(tagPath, attributes, parameters, accessRights, overrides, alarmList, alarmConfig)

```

And make alarmList Blank or at least leave out the alarms you want to remove.

I think either would work, but haven’t tested them.

---

<div class="post-metadata">

**Author:** ![denji26](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/denji26/32/5805_2.png) [@denji26](https://forum.inductiveautomation.com/u/denji26)\
**Post date:** [August 12, 2017, 6:01am UTC](https://forum.inductiveautomation.com/t/deleting-an-alarm-through-scripting/11706/4 "2017-08-12T06:01:24Z")

</div>

I have been trying to get this to work myself and was finally able to figure it out.

alarmConfig = {‘Alarm’:None}  
system.tag.editTag(tagPath=tagPath, alarmConfig=alarmConfig)

This will remove the alarm named ‘Alarm’ from the tag, leaving other alarms on the tag as they are.

It seemed to me initially that the solution was to recreate the alarmConfig, removing the alarm I wanted to delete from it, and then using editTag to set it, but that did nothing.

---

<div class="post-metadata">

**Author:** ![flavien](https://avatars.discourse-cdn.com/v4/letter/f/f475e1/32.png) [@flavien](https://forum.inductiveautomation.com/u/flavien)\
**Post date:** [January 18, 2018, 10:16am UTC](https://forum.inductiveautomation.com/t/deleting-an-alarm-through-scripting/11706/5 "2018-01-18T10:16:41Z")

</div>

Hi,

Any of these solutions work for me. Do you have some exemple ?  
I tried :

```auto
system.tag.editTag(tagPath="test", alarmList="")

```

No error message, but nothing happened.

```auto
alarmConfig = {'Low Temp':None}
system.tag.editTag(tagPath='test', alarmConfig=alarmConfig)

```

error message : Error executing gateway function.

Thanks

---

<div class="post-metadata">

**Author:** ![brandon1](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@brandon1](https://forum.inductiveautomation.com/u/brandon1)\
**Post date:** [January 19, 2018, 1:29pm UTC](https://forum.inductiveautomation.com/t/deleting-an-alarm-through-scripting/11706/6 "2018-01-19T13:29:35Z")

</div>

> [@flavien](#):
>
> alarmConfig = {'Low Temp':None}  
> system.tag.editTag(tagPath='test', alarmConfig=alarmConfig)

Where did you run this code at?

---

<div class="post-metadata">

**Author:** ![flavien](https://avatars.discourse-cdn.com/v4/letter/f/f475e1/32.png) [@flavien](https://forum.inductiveautomation.com/u/flavien)\
**Post date:** [January 19, 2018, 3:19pm UTC](https://forum.inductiveautomation.com/t/deleting-an-alarm-through-scripting/11706/7 "2018-01-19T15:19:03Z")

</div>

In a button with an actionPerformed event.

---

<div class="post-metadata">

**Author:** ![brandon1](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@brandon1](https://forum.inductiveautomation.com/u/brandon1)\
**Post date:** [January 19, 2018, 6:42pm UTC](https://forum.inductiveautomation.com/t/deleting-an-alarm-through-scripting/11706/8 "2018-01-19T18:42:41Z")

</div>

That doesn’t make sense. I run the same code and it works fine.

---

<div class="post-metadata">

**Author:** ![levi.jacobs](https://avatars.discourse-cdn.com/v4/letter/l/dec6dc/32.png) [@levi.jacobs](https://forum.inductiveautomation.com/u/levi.jacobs)\
**Post date:** [November 5, 2019, 4:22pm UTC](https://forum.inductiveautomation.com/t/deleting-an-alarm-through-scripting/11706/9 "2019-11-05T16:22:11Z")

</div>

Similar to denji26's method, I was able to remove an alarm this way:

> system.tag.editAlarmConfig(tagPaths=['test'],alarmConfig={'Alarm':None})

All I changed was the function (editAlarmConfig instead of editTag). This was in version 7.9.10
