We are now going to use the same principles and code that we used so far for another application: controlling a lamp (or any electrical appliance) from anywhere in the world.
The configuration for this section is very simple: first, place the ESP8266 module on the breadboard, if that's not been done yet. Then, connect the Vin+ pin of the PowerSwitch Tail to the pin number 5 of the ESP8266. Finally, connect the two remaining pins of the PowerSwitch Tail to the GND pins of the ESP8266.
This is a picture of the final result:
Then, connect the lamp (or the electrical appliance of your choosing) to the PowerSwitch Tail, and the other end of the PowerSwitch to the mains electricity.
For the code, simply use the exact same code as in the previous section: the main changes will only happen inside the dashboard itself.
Inside the dashboard, delete the previous slider element, and create a new one of the Digital type, using the same parameters as before:
You...