I've just published v0.1.0 of node-red-contrib-watt2kwh which is specifically written to convert power (watts) to energy (kWh).

It carries out the conversion by measuring the interval between consecutive inputs, and multiplying it by the power value - **interval x power = energy**.

The output is then scaled to deliver units of Joules, Watt hour, Kilowatt hour or Megawatt hour which is selectable in the node's configuration.

Hope it's of use!