Read the following in order:
http://docs.openhab.org/tutorials/beginner/index.html
http://docs.openhab.org/introduction.html
http://docs.openhab.org/addons/bindings/mqtt1/readme.html