Using mqtt from ESP to Openhab2

Go through this step by step tutorial: