Define the devices Manually in the Groovy

This is maybe a basic question. Is it possible to define my home devices manually through groovy smart App, instead of user input them at the mobile app?

No. You cant.

Not yet, but with the upcoming ST web dashboard you can configure smartapps through a browser.