= 200 or $instance['InstanceStatus'] == 104) { $found_device = false; // if (((int)HID_GetDeviceVendorID($hid_id) != $vendor_id) && ((int)HID_GetDeviceProductID($hid_id) != $product_id)) // { IPS_LogMessage($sender, "looking for hid device... "); $devices = HID_GetDevices($hid_id); foreach ($devices as $data) { if (((int)$data['VendorID'] == $vendor_id) && ((int)$data['ProductID'] == $product_id)) { IPS_LogMessage($sender, "found device... "); $found_device = true; HID_SetDeviceSerial($hid_id, (String)$data['DeviceSerial']); HID_SetDeviceVendorID($hid_id, $vendor_id); HID_SetDeviceProductID($hid_id, $product_id); IPS_ApplyChanges($hid_id); break; } } if (!$found_device) echo "no device found! "; /* } else { $found_device = true; IPS_LogMessage($sender, "found device... "); } */ if ($found_device and $instance['InstanceStatus'] <> 102) { HID_SetOpen($hid_id, $status); IPS_ApplyChanges($hid_id); //echo "device opened... "; } } //IPS_SetScriptTimer($IPS_SELF, $interval * 60); ?>