extends hook { public $hookName = ; public $active = true; //enable/disable hook (true => enabled) protected $devicelist = array( => array(, false)); // if you need some initialisation when creating the object, uncomment the funcion init below and put your code here. // If existing, This function is called by __construct /*protected function init() { // Your code here } */ // you can intercept the hook installation in this function. function installHooks(&$indexDevices) { return $this->installHooksFunction($indexDevices); } // callback fonction. Is called with these 3 parameters // $device -> calling device // $property -> property of the device (given by mqtt) // $value -> value of the property public function callBack(&$device, $property, $value) { if ($this->active == true) { // here your code } logger (INFO,sprintf(_("%s: notification received from MQTT from %s => parameter: %s value: %s"), $this->hookName, $device->friendlyName, $property, bool2string($value)), __FILE__ . ":" . __LINE__); } } $hooks[] = new (); ?>