Go to documentation repository
...
| Code Block | ||
|---|---|---|
| ||
function GetObjectName(objtype : String, id : String) : String |
...
| Code Block | ||
|---|---|---|
| ||
if (Event.SourceType == "GRAY" && Event.Action == "ALARM")
{
var grayid = Event.SourceId;
var grayname = GetObjectName("GRAY", grayid);
var compname = GetObjectParentId("GRAY", grayid, "COMPUTER");
DoReactStr("DIALOG", "test", "CLOSE_ALL","");
DoReactStr("DIALOG", "test", "RUN","Alarm in the '" + grayname + "' sensor connected to the '" + compname + "' server.");
} |