This is the code that can help you to automate your home.
To automate our Home, office to control the appliances with the help of our smartphones throughout the world.
NodeMCU Esp8266, 4 channel Relay, Arduino IDE, Google Firebase,
First, the Nodemcu connects the local Wifi i.e Home Wifi. Then it retrieves the data from the firebase. As required we change the data like on and off then it changes and responds accordingly to our given inputs then relay respond accordingly our data i.e high or low.