Programmatically create alarm with expression as condition

Hello everyone :slightly_smiling_face:,

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, 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"])
alarmConfig[name].append(["activeCondition", "Value", "my alarm condition"]).

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


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 :confused:

Thank you.

1 Like

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

1 Like