This is my first power/voltage sensor I've build. It is based on an commercially available powermeter from B+G E-Tech. You can find them on eBay or their website. It provides a 90ms pulse for each Wh flown through it.
The line voltage is measured using a simple transformer and a circuit based on the schematic from OpenEnergyMonitor. The software to measure the line voltage is also from OpenEnergyMonitor embedded into my sensor framework.