Hi there,
Although I am a great fan of FHEM, I decided to implement a framework in Java called HANS, which suited more what I needed. It has an API to be use by an application, whereas all the heavy lifting is done internally by Hans. So far, it is working very well.
If anybody is interested in taking a look: www.paulo-lima.org/hans
cheers !