Delete one alarm in a tag

Hi everybody,

I have a tag with two alarms. What can I do if I want to delete only the first alarm with system.tag.configure() ?

Thanks,

Hi,
I'm currently facing the same problem.

Did you manage to find a solution?

Hi,

Here my script.
For my use, I created an Associated Data named "alarm_id" for each alarm.
Otherwise, you can use alarm name.

def deleteAlarm(fullTagPath,alarm_id):
	tags = system.tag.getConfiguration(fullTagPath)
		
	for alarm in tags[0]['alarms']:
		if alarm['alarm_id'] == alarm_id:
			ndx = tags[0]['alarms'].index(alarm)
			break
	
	del tags[0]['alarms'][ndx]

1 Like