I ama trying to acknowledge a specific alarm on a button but for the life of me i cannot get it to work.
Alarm_name = event.souce.AlarmName
Alarm_source = event.source.AlarmSource (this is the full path for the source ie prov:default:/tag....)
alarms = system.alarm.queryStatus(state=["ActiveUnacked"], source= Alarm_source, any_property = Alarm_name)
System.alarm.acknowledge(alarms[0].id)
Any help would be appreciated
Thank you
djs
2
system.alarm.acknowledge expects a list of ids. Did you try System.alarm.acknowledge([alarms[0].id])
?
Says expecting 2 arguments and recieved one
djs
4
Then you will have to provide 2 arguments.
System.alarm.acknowledge([alarms[0].id], None)
Used system.alarm.acknowledge(alarms[0],none)
Didnt get any errors but it did not acknowledge the alarm
I got it working with
Alarm_name = "name"
Props = [("name","=",alarm_name)]
Unackedstate = "ActiveUnacked"
alarms = system.alarm.queryStatus(any_properties = props , state = unackstate)
AlarmUUID = alarms[0]['id']
System.alarm.acknowledge([str(AlarmUUID)],None)