# Alarm Acknowledge Button

**URL:** <https://forum.inductiveautomation.com/t/alarm-acknowledge-button/36866>\
**Category:** Ignition\
**Created:** [July 20, 2020, 2:16pm UTC](https://forum.inductiveautomation.com/t/alarm-acknowledge-button/36866 "2020-07-20T14:16:47Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jared\_E\_82](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@Jared\_E\_82](https://forum.inductiveautomation.com/u/Jared_E_82)\
**Post date:** [July 20, 2020, 2:16pm UTC](https://forum.inductiveautomation.com/t/alarm-acknowledge-button/36866/1 "2020-07-20T14:16:47Z")

</div>

I need to make a button in my application that when pressed (on release) it acknowledges all unacknowledged alarms.

This button would reside on the screen containing my alarm table.

I was unable to locate any examples in the forums of code that worked for this that didn’t generate errors.

---

<div class="post-metadata">

**Author:** ![Jared\_E\_82](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@Jared\_E\_82](https://forum.inductiveautomation.com/u/Jared_E_82)\
**Post date:** [July 20, 2020, 2:27pm UTC](https://forum.inductiveautomation.com/t/alarm-acknowledge-button/36866/3 "2020-07-20T14:27:09Z")

</div>

no

---

<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:** [July 20, 2020, 3:29pm UTC](https://forum.inductiveautomation.com/t/alarm-acknowledge-button/36866/4 "2020-07-20T15:29:08Z")

</div>

```python
# Query alarm status. This example grabs all alarms that are unacked.
data = system.alarm.queryStatus(status = ['ActiveUnacked', 'ClearUnacked'])
# Create list of event IDs
uuidList = [str(row.getId()) for row in data]
# Acknowledge alarm list. 
system.alarm.acknowledge(uuidList)

```

---

<div class="post-metadata">

**Author:** ![Jared\_E\_82](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@Jared\_E\_82](https://forum.inductiveautomation.com/u/Jared_E_82)\
**Post date:** [July 21, 2020, 12:14am UTC](https://forum.inductiveautomation.com/t/alarm-acknowledge-button/36866/5 "2020-07-21T00:14:47Z")

</div>

Thanks for the info! I’ll try it out when I get back from site later this week and let you know how it goes.

---

<div class="post-metadata">

**Author:** ![Jared\_E\_82](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@Jared\_E\_82](https://forum.inductiveautomation.com/u/Jared_E_82)\
**Post date:** [July 28, 2020, 12:59pm UTC](https://forum.inductiveautomation.com/t/alarm-acknowledge-button/36866/7 "2020-07-28T12:59:10Z")

</div>

Well note quite there yet. When I press the button I get this error

Traceback (most recent call last):  
File “event:mouseReleased”, line 5, in   
TypeError: acknowledge(): expected 2 args; got 1

```
at org.python.core.Py.TypeError(Py.java:265)
at org.python.core.PyReflectedFunction.throwError(PyReflectedFunction.java:211)
at org.python.core.PyReflectedFunction.throwArgCountError(PyReflectedFunction.java:264)
at org.python.core.PyReflectedFunction.throwError(PyReflectedFunction.java:321)
at org.python.core.PyReflectedFunction. __call__ (PyReflectedFunction.java:169)
at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction. __call__ (ScriptManager.java:524)
at org.python.core.PyObject. __call__ (PyObject.java:480)
at org.python.core.PyObject. __call__ (PyObject.java:484)
at org.python.pycode._pyx25.f$0(<event:mouseReleased>:5)
at org.python.pycode._pyx25.call_function(<event:mouseReleased>)
at org.python.core.PyTableCode.call(PyTableCode.java:171)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1614)
at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:782)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:206)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:297)
at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:57)
at com.sun.proxy.$Proxy58.mouseReleased(Unknown Source)
at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)
at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.desktop/java.awt.Component.processEvent(Unknown Source)
at java.desktop/java.awt.Container.processEvent(Unknown Source)
at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

```

Ignition v8.0.14 (b2020062220)  
Java: Azul Systems, Inc. 11.0.6

---

<div class="post-metadata">

**Author:** ![code\_skin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@code\_skin](https://forum.inductiveautomation.com/u/code_skin)\
**Post date:** [July 28, 2020, 1:00pm UTC](https://forum.inductiveautomation.com/t/alarm-acknowledge-button/36866/8 "2020-07-28T13:00:56Z")

</div>

Try `system.alarm.acknowledge(uuidList, ` `None` `)`

---

<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:** [July 28, 2020, 1:10pm UTC](https://forum.inductiveautomation.com/t/alarm-acknowledge-button/36866/9 "2020-07-28T13:10:03Z")

</div>

Odd, as I had tested it on 8.0.13, but trying again throws the error.

Using None for the notes parameter does work. According to the manual, though, it’s supposed to be optional.

---

<div class="post-metadata">

**Author:** ![code\_skin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@code\_skin](https://forum.inductiveautomation.com/u/code_skin)\
**Post date:** [July 28, 2020, 1:12pm UTC](https://forum.inductiveautomation.com/t/alarm-acknowledge-button/36866/10 "2020-07-28T13:12:20Z")

</div>

Client vs Gateway scope. OP didn’t specify Vision or Perspective so based on the error I assume they invoked this event via Perspective. The gateway scope of this function requires the notes.

[https://docs.inductiveautomation.com/display/DOC80/system.alarm.acknowledge](https://docs.inductiveautomation.com/display/DOC80/system.alarm.acknowledge)

---

<div class="post-metadata">

**Author:** ![Jared\_E\_82](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@Jared\_E\_82](https://forum.inductiveautomation.com/u/Jared_E_82)\
**Post date:** [July 28, 2020, 1:14pm UTC](https://forum.inductiveautomation.com/t/alarm-acknowledge-button/36866/11 "2020-07-28T13:14:03Z")

</div>

Hey that makes it functional. I will play with it a bit more to see if I can break it but hopefully this has got me covered. Thanks to both of you guys this has been so helpful!

---

<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:** [July 28, 2020, 1:16pm UTC](https://forum.inductiveautomation.com/t/alarm-acknowledge-button/36866/12 "2020-07-28T13:16:21Z")

</div>

> [@code\_skin](#):
>
> Client vs Gateway scope.

Yeah, but it throws the error in the Script Console. Plus, you would also need the username parameter in the gateway scope.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 28, 2020, 1:16pm UTC](https://forum.inductiveautomation.com/t/alarm-acknowledge-button/36866/13 "2020-07-28T13:16:47Z")

</div>

As far as I can tell the `notes` parameter has always been required and the manual is incorrect to state that it’s optional, rather than stating that it can be `None`.

---

<div class="post-metadata">

**Author:** ![code\_skin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@code\_skin](https://forum.inductiveautomation.com/u/code_skin)\
**Post date:** [July 28, 2020, 1:16pm UTC](https://forum.inductiveautomation.com/t/alarm-acknowledge-button/36866/14 "2020-07-28T13:16:53Z")

</div>

That is odd. ~~The username is optional in the gateway scope which seems strange too.~~

Seems the username is recommended to be omitted via Client scope.

---

<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:** [July 28, 2020, 1:21pm UTC](https://forum.inductiveautomation.com/t/alarm-acknowledge-button/36866/15 "2020-07-28T13:21:02Z")

</div>

Thanks, Kevin. Not sure what I did to make it work the first time, then. Luck of the old man, I guess.

Whose auspices does the manual fall under?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 28, 2020, 1:25pm UTC](https://forum.inductiveautomation.com/t/alarm-acknowledge-button/36866/16 "2020-07-28T13:25:22Z")

</div>

I pinged @Paul.Scott about it. Whether he’s still the right person I’m not actually sure 😅

---

<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:** [July 28, 2020, 1:27pm UTC](https://forum.inductiveautomation.com/t/alarm-acknowledge-button/36866/17 "2020-07-28T13:27:07Z")

</div>

If it’s not right, we’ll always think it should have been.

---

<div class="post-metadata">

**Author:** ![Paul.Scott](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul.scott/32/4578_2.png) [@Paul.Scott](https://forum.inductiveautomation.com/u/Paul.Scott)\
**Post date:** [July 28, 2020, 3:40pm UTC](https://forum.inductiveautomation.com/t/alarm-acknowledge-button/36866/18 "2020-07-28T15:40:41Z")

</div>

Thanks for the report gang. I’ll take care of the user manual.
