Unable to configure dynamic alerts for "In Range" and "Out Range" Deviation types
Hi ,
I am trying to create dynamic alerts , it is working for "Above" , "Below" , "Equal To" etc. but the same logic is not working for "in Range" and "Out Range".
I am using below code :
var params = {
infoTableName: "alertAttr" /* STRING */
};
var attrs = Resources["InfoTableFunctions"].CreateInfoTable(params);
var field = new Object();
field.name = "minimum";
field.baseType = 'NUMBER';
attrs.AddField(field);
field.name = "minimumInclusive";
field.baseType = 'BOOLEAN';
attrs.AddField(field);
field.name = "maximum";
field.baseType = 'NUMBER';
attrs.AddField(field);
field.name = "maximumInclusive";
field.baseType = 'BOOLEAN';
attrs.AddField(field);
var row = new Object();
row.minimum = MinValue;
row.minimumInclusive = true;
row.maximum = MaxValue;
row.maximumInclusive = true;
attrs.AddRow(row);
Things[thingName].AddOrUpdateAlert({
alertType: DeviationType /* STRING */,
alertName: AlertName /* STRING */,
property: Property /* STRING */,
description: undefined /* STRING */,
attributes: attrs /* INFOTABLE */,
priority: Priority /* INTEGER */,
persistent: true /* BOOLEAN */,
enabled: true /* BOOLEAN */
});
Can you please help with it ?
Chahat Gupta

