I like the enthusiasm, but you REALLY shouldn't be DIYing this. This project is almost certainly violating half a dozen safety standards which exist for a very good reason.<p>Don't toy around with mains voltage - <i>especially</i> when an off-the-shelf solution is widely available for <i>less</i> money. A Sonoff smart socket is only $15, and you can even flash your own firmware on its ESP8266. All of the benefits, none of the "accidentally setting the house on fire" or "giving yourself a fatal shock"!
2a relay does not look like a good idea unless the socket is marked appropriately and fused to suit as well.<p>Mains electricity is ubiquitous so we tend to think it's safe. It really isn't, and electrocution and fire are both real hazards, only uncommon due to good safety standards.
If the pins of the relay were insulated with heat-shrink and everything soldered + mounted nicely, this project would be more passable. In its current state it honestly seems like a fire hazard.
Maintaining 40+ smart sockets was getting truly messy. Mostly I needed master switch to turn them all off. So eventually this evolved into this here touch-button master switch, with PIR-sensor for detecting sleep or absence (or death). <a href="https://github.com/timonoko/Hipaisunappaimisto">https://github.com/timonoko/Hipaisunappaimisto</a>