se the Esp8266 Nodemcu and a 4 channel relay module to create a webserver that enables us to control devices from a web page over a WiFi network. This acts as a switch in a number of home automation projects.
Before we can proceed you should look at my other posts on how to use the 4 channel relay module and how to create a web server using the nodemcu;
Interfacing 5V 4-Channel Relay Module with Arduino
Nodemcu Webserver with Arduino IDE for Controlling Leds.