This is code for esp8266 that's make it connect to certain wifi and you can manage lamp on off with it via the wifi.
just change the variable const String ssid = ""; const String password = ""; with your own wifi name and password than accces it on/off control with the ip given in the IDE.