{ public $hookName = ; public $active = true; enable/disable hook (true => enabled) private $devicelist = array() => ); // assigne the function to the sensors devices function __construct() { global $indexDevices; if ($this->active === true) { foreach ($this->devicelist as $ieeeAddress => $property) { $indexDevices[$ieeeAddress]->$property["functions"][] = array($this,"callback"); } } // put here your code to init the class } // 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) { // here your code logger (INFO, _("%s: notification received from MQTT from %s => parameter: %s value: %s"), $this->hookName, $device->friendlyName, $property, $value); } } $hooks[] = new (); ?>