he need a script to send information by mail ore what ever ( we will establish )
with the current values of the windows and doors from group Security > F R O M H E R E <
Here we go, my 50cents:
1st: simple script, only for displaying at script executer.
Code: Alles auswählen
!Windows and doors current value by Alchy
var sec=dom.GetObject("Security");
string i;
string slist;
string since;
string status_new;
slist="windows and doors: \r\n";
foreach(i,sec.EnumUsedIDs()) {
var item=dom.GetObject(i);
var dev=dom.GetObject(item.Device());
if((dev.HssType()=="HM-Sec-RHS") || (dev.HssType()=="HM-Sec-SC") || (dev.HssType()=="HM-Sec-SC-2") || (dev.HssType()=="HM-Sec-SCo")) {
var since = item.LastTimestamp().ToString("%d.%m.%y %H:%M");
if (since == "01.01.70 01:00") {since = " unknow time";}
var where = dom.GetObject(item.ChnRoom());
var status = item.DPByHssDP("STATE").Value();
if (status == 0 ) { status_new = "locked"; }
if (status == 1 ) { status_new = "tilted"; }
if (status == 2 ) { status_new = "open"; }
slist=slist # dev.Name() #" - status: " # status_new #" - since: " # since #" - at room: " # where #"\r\n";
}
}
WriteLine(slist);
Give me mor information, what you need or not need.
Alchy