Another new user question: logging KWH vs power?

I have a set of networked smart meters from EKM Metering in Berkely, CA, and I have my own version of an EMONCMS type software that reads them, logs them and displays the data (you can see it live at  These meters are capable of reporting both instantaneous power as well as running KWH accumulation.

I am interested in also experimenting with your interesting software (you have much richer functionality for web-based configuration and customization), but I am a bit puzzled by the way you track energy usage and wondered if someone could clarify.

As I understand it, EMONCMS generally uses regular writes of instantaneous power values, and then extrapolates energy usage (KWH) by looking at the difference in time between readings and assuming that power was constant during that time period. True?

It seems to me that this method is a decent approximation for simple meters which can only report instantaneous power, but I would think it would introduce a significant amount of inaccuracy over time when calculating KWH unless you log power readings with a very high frequency.

My question is, does EMONCMS have any way work directly with KWH data from KWH-capable meters instead of extrapolating power readings?

My system works this way; It reads the meters every minute or so and logs the current running accumulated KWH value.  It then stores the difference between KWH readings to indicate energy used in that timespan.  I store and graph this data on an hourly basis (KWH consumed per HOUR), which I think gives the time-based data most useful to my users, and I can easily aggregate it for larger time periods (days, months, years).  

I also have a way for users to pop up a temporary self-updating graph (similar to your "smoothie" visualization) of running instantaneous power.  This can be used to experiment by showing the relative power used by various appliances as things are turned on an off, and looking at vampire loads, but is generally not useful for tracking ongoing usage patterns or trends.

Anyway, I am both curious how much of this functionality I could replicate in EMONCMS as well as what folks think about the relative merits of the two approaches (power-centric vs energy-centric).  I find that the power-centric approach you seem to use is the most common, and several people have recommended it to me, but I have always personally been more interested in tracking energy usage over time, so I tend to optimize for that.


P.S. You might also find it interesting to look at the special display I have in my software for solar net-metered situations (bring up my website and click on "SW" in the left-hand tree control, for example.  This display combines the data from 2 meters, one tracking solar output and one tracking the connection to the utility, and combines them into one graph and table of historical data.  It extrapolates actual usage by summing the flows of the two meters.  The cool thing is that it can show in real time how much you are using, generating and buying/selling from the utility, and it tracks the percentages over various historical time periods.  For example, it shows that in this "SW" (i.e southwest cluster of 8 homes in my neighborhood) we have generated 59% of our power from our shared solar PV system so far this year. 

This approach can be applied just as easily to an individual home with grid-tied PV, as long as the user has meters that can report independently on PV and utility flows, and might be something worth implementing in EMONCMS.

mlemos's picture

Re: Another new user question: logging KWH vs power?

Hi, my name is Manoel I'm building my own monitor based on the EMON project and also my own EMONCMS like app.

RIght now I got the monitor to monitor Irms and Apparent Power, both using the EmonLib, which I believe provides me instantaneous readings, correct?

Well, now I'm puzzled on how to convert that to KWH. So I have 3 questions:

1. How to calculate that KWM from instantaneous Apparent Power readings (or Irms)? What is the math here?

2. Is it better to make this calculation on the Arduino or on the server?

3. Should I do that for 24 hours period and them sum all the periods to have my monthly consumption or there is any other way?

Thanks for any help!

Robert Wall's picture

Re: Another new user question: logging KWH vs power?

There is a problem. You can not get an accurate measure of energy using apparent power. You should be measuring voltage and calculating real power. The reason is complicated and if you want to know more, look here.  If you use apparent power, the energy "kWh" will always be too high, because apparent power can never be less than real power.

If you use 2 kW of power for 3 hours, you have consumed 6 kWh of energy. Mathematically, we say kWh is the integral of kW over time. That is equivalent to drawing a graph of power (kW) and then calculating the area underneath the graph. If you read power every (say) 1 minute, then the energy (kWh) during that minute is the average power x 1 minute, or

 ((reading at start + reading at end) / 2)  x ( 1/60) kWh.

The shorter the time between readings, the more accurate your value for energy will be. It does not matter where you do the sum. But if you keep the total in the Arduino and it loses power or resets, the total energy up to that point is lost, and your server program will need to recognise that it has started again from zero and remember and add the last value it received before the loss so that the total from the beginning stays correct. emonCMS does the sum in the server.

Dan Woodie's picture

Re: Another new user question: logging KWH vs power?


I live nearby and work in the same building on campus as one of your residents. I have installed the Emoncms software on my own file server and should be finally hooking up the EmonTX this weekend. If you are interested we could meet sometime for lunch and discuss. I have not delved into the code much yet, but have been looking at and working with the software a bit for several months now, culminating in monitoring my usage and generation real time. Drop me a private message and we can exchange details.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.