"contact", GARAGE_PORTE => "contact", RDC_CHAMBRE_BAIE => "contact", RDC_SALON_BAIE => "contact", GARAGE_PORTAIL => "contact" ); // callback fonction. Is called with these 4 parameters public function callBack($device, $property, $value) { logger(DEBUG, sprintf(_("property=%s, value=%s"), $property, $value), __FILE__ . ":" . __LINE__); switch($property) { case "contact": if ($value == false) { logger(ALERT, sprintf(_("%s est ouverte alors que personne n'est présent"), $device->friendlyName), __FILE__ . ":" . __LINE__); } break; } } public function testPortes() { global $indexDevices; logger(DEBUG, _("Function alerte_intrusion->testPorte"), __FILE__ . ":" . __LINE__); $msg = ""; foreach ($this->devicelist as $device => $property) { if($indexDevices[$device]->properties[$property] != false) { $msg .= $indexDevices[$device]->friendlyName . " is open" . EOL; } } if (!empty($msg)) { logger(ALERT, $msg, __FILE__ . ":" . __LINE__); } return nl2br($msg); } } $hooks["alerte_intrusion"] = new alerte_intrusion(); logger(DEBUG, _("Initializing event"), __FILE__ . ":" . __LINE__); $function = array($hooks["alerte_intrusion"], "testPortes"); setRecurrentEvent($function, 0, 0, 0, 0, 0, 0, 21, 0, 0, 1, 0, 0, 0); ?>