Have a look at the Analog Devices AD7750 Product-to-Frequncy Converter. You can feed it an AC voltage sample, an AC current sample, and it will generate a frequency proportional to the instantaneous power. Count the pulses over a period of time and you get the energy use in joules, watt-seconds, or whatever. Harold