Chapter 4 - Relay Control

Hobby relay contacts are typically rated at 10A 220V = 2,200W
Contact rating is important because current flow can have the kinetic energy of a battering ram - so the more current flowing through contacts when they start to open, the more electrical energy will spark across the opening gap, taking metal from one side and depositing it on the other to effectively re-shape the contact surface area. The rate that this happens will depend on the quality of the metal contacts and the amount of current they have to handle, Continued use will transfer sufficient metal to leave pitting on one side and create carbonised build-up on the other, reducing the contact surface area and increasing contact resistance. Resistance to current causes heat, so eventually the deteriorating contacts can heat up enough to melt surrounding insulation, or even act like an arc welder to fuse the contacts together so that the electricity and current flow cannot be stopped. Such a situation is very dangerous and potentially lethal... and this is not just scare-mongering, it is from painful personal experience.

Electricity causes muscles to involuntarily contract - the heart is a muscle, and it only takes about 35mA to make the heart contract sufficient to prevent it from beating... which is why Earth Leakage Circuit Breakers are rated to trip out at 30mA leakage.

If your hand touches Live Mains causing current to flow through you to earth, the electrified muscles can tightly spasm into a vice-like grip preventing you from letting go again... similarly the heart will contract into tight spasm and stop beating, then it doesn't take long for oxygen starvation to cause blackout and eventual death. A 30mA ELCB won't prevent a shock, but it will shut off the current before it has time to kill.
Birds perch on live wires without harm because no current discharges through their body, due to all points of contact being at the same potential.

You could also touch a live wire without harm if you did not provide a path for the electricity to discharge through... such as your feet in contact with the ground, or through one hand and arm across your chest to the other. That's why I never use both hands when working near Live electricity which has potential to kill me, and I never wear footwear with any metal, and preferably I place a rubber mat to stand on, and never lower the resistance of my body by having a cuppa just beforehand... all simple precautions that reduce risk and increases chance of surviving a mishap.

The lack of controls of many eastern manufacturers and sales chains allows them to pretty much do and say what they want without fear of consequences or compensation claims from hapless victims the other side of the world.
So don't assume the ratings and specs you read are true or tried and tested, or even relevant for the purchased item.

Don't push your luck by using appliances that are rated close to the stated contact ratings, because even if able to cope now, eventually it will fail.
Equipment includes the added complication and expense of being earthed for safety reasons unless it is deemed safely 'double insulated'.

Many eastern-made Mains relay modules are not earthed, and are barely and inadequately insulated.
So add a pass-through earth wire yourself between the Mains input plug and the switched Mains output socket to provide an earth for appliances.
The reality is that the only person in the world with any vested interest in the safety and well-being of you and the things you care about is YOU.
Therefore the onus is on YOU to ensure that your project is not a danger to you or others, including pets and property.

There are now several eastern manufacturers producing cheaply available ESP Mains-switching relay modules, which often means it is more convenient and cost-effective to buy something ready-made than to construct your own heath-robinson home-brew.

I've tried many different types, but Itead/Sonoff are usually the cheapest and they usually do work.
The original Sonoff TH is cheap enough at a fiver and gives gpio14 to play with - which is what I've used for the Differential Thermostat project.
There are now TH10 and TH16 versions available which bring gpio14 out to a side-mounted 2.5mm 4 pole jack socket to allow a range of pre-wired one-wire temperature sensors to be plugged in. A step in the right direction, but could have been better, and still leaves room for improvement.

What all these ESP-based switched relay modules have in common is the ability to connect a UART (even if un-populated holes) for re-flashing.
One of the big advantages of using Annex-Wifi Basic is that you only need a serial connection to flash the firmware for the first time, then all programming and control is done over wifi, and subsequent firmware updates can be OTA.