Try catch get sensor and get device