This method of measuring mains AC electrical energy use is quite nice, it doesn’t require any breaking of the mains wire, which makes it much safer, you just clip-on to the wire a sensor called a current transformer (CT) that measures the current flowing through either the live or neutral mains wire. It does this by measuring the magnetic field that surrounds the wire, created by the current. The simplicity of just clipping on the sensor means that it can be used to measure the electrical energy used by the whole house. It is the method used by many commercial devices that you can buy.
I don’t have much knowledge of how the commercial devices work apart from the use of the CT sensor, I couldn’t find much information on them and so the following is what I have managed to get to work in quite an experimental way. The results seem promising and useful, there are probably better more accurate ways of doing it and so hopefully it will improve over time but this is how far I have got so far.