Emoncms data does not agree with emonGLCD data

When I compare the kWh data on the emonGLCD screen with the corresponding data on emoncms the ‘solar’ data values agree but the ‘using’ & ‘import/export’ data values differ by approx 1 kWh on both emoncms.org & local emoncms. The emonGLCD sketch resets all three kWh value to zero at 00:00.

Any suggestions?

Your GLCD sketch accumulates the values locally, whereas the two emonCMSs operate quite independently. There are two mechanisms that I can think of to explain, Paul B (@pb66) might be able to add to this.

1a. Some readings are going astray and are either received by the emonBase and not by the GLCD, or vice versa.
1b. A minor variant on that: Some readings are being ignored by emonCMS because the timebases of emonCMS and the emonTx don’t quite match.
2. Time runs at a different rate, so the integration of power over time to get energy is wrong.

I don’t really have a suggestion as to how you can determine which of these, or which combination, applies, and how to overcome it.

My MegunoLink gets its data from emonGLCD sketch as does emonGLCD screen; so MegunoLink & emonGLCD report identical data. Local emoncms gets its data from emonTx as does emonGLCD but their data differs. Since they’re all local devices would a timing issue be the cause?

As I said, it could well be timing.

You’ve said the difference is 1 kWh, but in how much?

But the two places that show different data don’t get it from the same place. The power values come from the same place (the emonTx) but energy is calculated on one hand by the GLCD, and on the other by emonCMS. So the discrepancy arises from that.

Good point; I’ll investigate further

But as I pointed out above, although the power data is the same, not all of it necessarily gets through and gets used.

Don’t understand this comment

Does the difference start at 1 kWh and remain at a constant value as the numbers increase together, or does it start at zero and get bigger as the numbers diverge, as the energy accumulates?
i.e. if you plot an X-Y graph of the two energies increasing over time, one increasing along the X-axis and the other increasing along the Y-axis, the graph should be a straight line y = mx + c, where m = 1 and c = 0. What are the values of m and c for your graph? An estimate is good enough.

The difference appears constant at about 0.9 kWh

Do both systems (GLCD & emonCMS) reset at the same time? And if they don’t, there’s your answer. One had accumulated 0.9 kWh when the second reset to zero.

I can see your GLCD should reset at midnight, but it looks like a reset happened just before 1 am from your screenshot. What happened there?

Both emoncms & emonGLCD reset to zero at midnight. At approx 1am I hibernated the PC so the kWh value was not zero but 0.01. I resumed from hibernation at 09:50 hence the MegunoLink graph shows interpolated values between aprox 01:00 & 09:50 which is not important as long as I get the daily kWh figure at resumation from hibernation whatever time of day that might be.
I’ll monitor the kWh difference & if it remains the same value I can add a correction factor to emonGLCD sketch to get both emoncms & emonGLCD reading the same

I’m running out of ideas. I think you have to look carefully at all the numbers, and check that both systems are doing exactly what you think they are doing.

Can you note the 4 values (emonCMS & GLCD / Use & Grid import/export) when they reach about 5, 10, 15 & 20 kWh so that we can see exactly what each is doing and relation to the others.

I think I may have found the cause; in the emonGLCD original sketch:

 if (last_hour == 23 && hour == 00)          //resets wh_gen & wh_consuming to zero at midnight
  {
   wh_gen = 0; wh_consuming = 0;
  }

It’s now 00:08 & import is still showing 22.2kWh on emonGLCD screen

I’ve since added wh_grid so I’ve added this to the above thus:

 if (last_hour == 23 && hour == 00)        //resets wh_gen, wh_consuming & wh_grid to zero at midnight
  {
   wh_gen = 0; wh_consuming = 0; wh_grid = 0;
  }

This am the difference between grid & consuming is about 10% of the original difference of 0.9 kWh
ie 0.1 kWh & I accept this difference is a timing issue but I can live with this difference

1 Like