This node calculates energy based on power inputs. No need to measure time seperately.
As you may use one or more appliance in your home automation which are able to output power measurement you may want to know the energy consumption/production over a specific period of time. This node takes power values as input parameter and calculates the energy amount. As energy can be discribed as the product of power and a time period, the time period this node uses is the intervall between two inputs.
Basic installation:
~/.node-red
npm install node-red-contrib-simple-energymeter
Simply wire it with an power input device and make use of the output:
Fig. 1: Basic usage node energymeter
Fig. 1: Properties node energymeter