Natively, some Wanhao printers (and their clones) have power control or power detection capabilities:
ADVi3++ supports those capabilities when available. In addition, you can add those capabilities to printers that do not have them using a cheap module: Bigtreetech Relay 1.2.
For printer that have already some power control capabilities (i.e. Aldi Balco 3D Printer UK and Wanhao Duplicator i3 Plus Mark II), you have three possibilities:
WARNING: Most of the schemas you can find on the Internet (including the official english web site of Bigtreetech) are wrong (bad translation from Mandarin Chineese).
DANGER: This module (like the native ones) involves main power. Do not touch the wires to prevent electric shock. Be sure to always remove the power cable of the printer when disassembling it.
You can purshase a Bigtreetech Relay 1.2 from the official Bigtreetech web store or from various Internet shops such as AliExpress. Bigtreetech has also an official store on AliExpress and the module is in general cheaper their. The cost is around USD 10 including shipping (it will vary depending of your location).
The ports of the Bigtreetech Relay 1.2 are the following:
It is crutial to isolate the module from any metal and, in particular, the metal of the printer. There are different enclosures available from this module and I choose one from Egv33 on Thingiverse.
Instead of drilling the back of the printer, I attached the module and its enclosure using 3M Dual Lock.
DANGER: This wiring involves main power. Do not touch the wires to prevent electric shock. Be sure to always remove the power cable of the printer when disassembling it.
The Relay module is wired between the printer main power socket and the power supply: