How do I add an "alarm definition" out of a plugin?

I want to create an alarm definition out of a plugin.

I try:

_alarmDefinition.Name = definitionItem.DefinitionName;

           \_alarmDefinition.EventTypeGroup = definitionItem.EventTypeGroupId;

           \_alarmDefinition.EventType = definitionItem.EventTypeId;

           \_alarmDefinition.SourceList = definitionItem.SourceList;

           \_alarmDefinition.RelatedMap = definitionItem.RelatedMapId;

           \_alarmDefinition.Priority = definitionItem.PriorityId;

           \_alarmDefinition.Category = definitionItem.CategoryId;

           \_alarmDefinition.Save();

and:

definitionFolder.AddAlarmDefinition(

               definitionItem.DefinitionName, "",

               definitionItem.EventTypeGroupId,

               definitionItem.EventTypeId,

               definitionItem.SourceList, "", "", "", "", "", "", "",

               definitionItem.RelatedMapId, "",

               definitionItem.PriorityId,

               definitionItem.CategoryId, "");

But both ends in an error.

Where is my fault?

If you run the Config API Client sample and add an alarm definition you might get an idea which parameters are important and what valid parameters there is..

Please try the Config API Client sample.

https://doc.developer.milestonesys.com/html/index.html?base=samples/configapiclient.html&tree=tree_2.html

I tried the sample and made a mistake when selecting the “Triggering event group” - “Analytics Event” (Triggering event type is out of range). This is the same mistake I get in my plugin.

I use Corporate 2018 R2.

But in the Config API Client, when you get the error message after filling the first field you move to the next until there is no error message..

Like-

This works for me, I have a newer version but I think it will work for you also, let me know.

No, it’s not working. I get an error by selecting Triggering event group and Triggering event type. If I press Add alarm definition I get also an error (see picture).

I use SDK 2018 R2. I try the sample also on a different pc with same result.

You must pick a source. You must pick a device as source, a camera or other sort of device.

I also get this error message, I use a single camera, but later I need the option “All cameras”, as I can use them in the management client.

OK, I misunderstood. All cameras works for me..

Ok, but what can be the reason that I am not running? German Windows 10?

If I test with an old server 2018R2 I get the same issue.

Turns out to be a known issue..

https://developer.milestonesys.com/s/question/0D50O00004lpqQI/how-to-correctly-set-sourcelist-string-property-of-a-addalarmdefinitionservertask

You will have to upgrade. XProtect 2018R3 includes a fix (and 2019R1 which is available soon).

After upgrade to 2018 R3 it works fine.

Thanks…