# Programmatically create alarm with expression as condition

**URL:** <https://forum.inductiveautomation.com/t/programmatically-create-alarm-with-expression-as-condition/25182>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [May 21, 2019, 7:45am UTC](https://forum.inductiveautomation.com/t/programmatically-create-alarm-with-expression-as-condition/25182 "2019-05-21T07:45:57Z")\
**Posts on this page:** 3\
**Page:** 1

<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 21, 2019, 7:45am UTC](https://forum.inductiveautomation.com/t/programmatically-create-alarm-with-expression-as-condition/25182/1 "2019-05-21T07:45:57Z")

</div>

Hello everyone 🙂,

I’m using system.tag.editAlarmConfig() in order to create new alarms. When using the alarm mode “On Condition” however, I have no idea of how to bind the “activeCondition” property to an expression.  
Analyzing a similar, in the designer created, alarm with system.tag.getAlarmStates(), I can see that the type of the “activeCondition” property is “Expression”. All other properties are of type “Value”. Unfortunately, according to [system.tag.editAlarmConfig](https://docs.inductiveautomation.com/display/DOC79/system.tag.editAlarmConfig), the alarm config PyDictionary only accepts nested lists with the format [“name”, “Value”, “newValue”]. And item 1 is always “Value”.

So I can do neither  
`alarmConfig[name].append(["activeCondition", "Type", "Expression"])`  
nor  
`alarmConfig[name].append(["activeCondition", "Value", "my alarm condition"]).`

Is there any way to programmatically create the activeCondition binding for an alarm?

Markus

---

<div class="post-metadata">

**Author:** ![rdelasheras](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@rdelasheras](https://forum.inductiveautomation.com/u/rdelasheras)\
**Post date:** [July 17, 2019, 5:24pm UTC](https://forum.inductiveautomation.com/t/programmatically-create-alarm-with-expression-as-condition/25182/2 "2019-07-17T17:24:11Z")

</div>

Hello. Same question.

Someone knows if it is possible?

By the moment I have to add 16 alarms. But maybe they will be more than 500 😕

Thank you.

---

<div class="post-metadata">

**Author:** ![harigobu.gb](https://avatars.discourse-cdn.com/v4/letter/h/b77776/32.png) [@harigobu.gb](https://forum.inductiveautomation.com/u/harigobu.gb)\
**Post date:** [October 19, 2020, 6:10pm UTC](https://forum.inductiveautomation.com/t/programmatically-create-alarm-with-expression-as-condition/25182/3 "2020-10-19T18:10:44Z")

</div>

Yes I am too awaiting for the same. Any feedbacks ?
