Switch Keyboard Automatically I am using Nexus 10 with android 5.0.1

I recently purchased a bluetooth keyboard to go along with the tablet. The keyboard I was using (soft) beforehand was O Beta keyboard, which does not function very well with bluetooth hard keyboard.

Is it possible to switch keyboard to the Google Keyboard automatically when the physical keyboard is paired and revert to O Beta keyboard when I don't use the physical keyboard anymore?
You can do this with Tasker if you are rooted. An explanation is here: http://www.pocketables.com/2012/09/using-tasker-and-external-keyboard-helper-to-better-the-bluetooth-keyboard-experience.html .

If you don't want to pay for Tasker, or you are not rooted, I have done something nearly as good with Llama, which is free on the Play Store.

Tell Llama to trigger an action when Bluetooth Device Connected and name your device. Tell it on this event to trigger the Android intent android.settings.INPUT_METHOD_SETTINGS .

Create a matching event for disconnection. You will then be automatically asked to pick the correct keyboard each time you connect or disconnect the BT keyboard.

In my case I used External Keyboard Helper (Play Store) as my alternate keyboard but you can select Google Keyboard instead.

The result is not totally automated but it just means you are prompted for one or two extra taps when you connect or disconnect the keyboard.