Arduinon Nano and ESP-01

So I have a arduino nano and ESP-01 module spare now. I want to know if it is possible to use the ESP-01 as a wifi gateway for the arduino to connect to my MQTT server? I want to use it to read temperature, motion, reed switches and turn on/off relays in a room in my apartment. I tried searching for tutorials, but mostly found people using the ESP8266 modules on their own without the arduino…

I am just starting with the arduino platform so it will be helpful if someone can post a link to a tutorial that has some code…

Have you looked at Mysensors.org? Lots of tutorials using arduinos for HA sensors and they have a MQTT gateway which works with Home Assistant.

Hi,
I will go and have a look at the site - I did find a tutorial where they flashed the ESP-01 to connect to WIFI and subscribe to a topic on a local MQTT server. The ESP-01 then relays the received data via a serial connection to an arduino. The arduino then actions the command, responds back to the ESP-01 that interns relays the message back to the MQTT server…

Look at esp-01.ino at

I strongly believe that’s what you are looking for