I'm not sure if this will help you; I suspect you want to match your HEM reading with your energy meter read by the power company.
I found that resetting the KWH daily helped make sense of the numbers. I don't really trust the algorithm used by the HEM to calculate KWHrs (my reading leads me to think it does some assumptions); I do trust the watts however since I can measure the watts at my solar panels, and it matches up nicely with the HEM readings.
At any rate, here is the LUUP to zero out the KWHrs every day. I run this scene every night (change the device ID, and you will have THREE not TWO devices):
local meterID = 570
local kwh = luup.variable_get("urn:micasaverde-com:serviceId:EnergyMetering1", "KWH", meterID)
luup.call_action("urn:micasaverde-com:serviceId:EnergyMetering1", "ResetKWH", {}, meterID)
local meterID = 573
local kwh = luup.variable_get("urn:micasaverde-com:serviceId:EnergyMetering1", "KWH", meterID)
luup.call_action("urn:micasaverde-com:serviceId:EnergyMetering1", "ResetKWH", {}, meterID)