Error in or unwanted design on how EmonCMS calculates Wh data

I use direct write from two Iotawatt units to emoncms installed on an Emonpi. Sometimes, estpecially after power outage, the Iotawatt start re-submitting all data from a historic date. Right now, this date is about five months in the past. Re-submitting takes some 20-30 hours. This is not a wanted situation, but for now it is what it is.

In this 20-30hrs period the emoncms data gets garbled. The Watt feed updates just fine, but the kWh feed gets sky-high values for the 24hr period this is going on. Example, if the daily power usage is 50-70kWh, this particular day it can be calculated to 2000 or even 4000kWh.

Here is a zoomed in short period (10s data viewed as 5s) where this happened:

Re-calculation of feed is not really an option here since this “error” is seen on all feeds, and re-calculation seems to require storing data in a new feed. Which again requires me to re-configure my entire setup and everything downstream.

It seems to be a very short period that affects the entire day’s worth of data. To me this looks like some strange handling of time stamps. Is there something to be done here to make this calculation more robust?

Hello @OlavKristiansen what does your input processing look like for these feeds? are you using power_to_kwh process or is the IotaWatt providing cumulative kWh readings?

Iotawatt provides Watt data only. Emoncms on the EmonPI then processes like this:

Thanks, does the second feed the TotalUsage kWh show unexpected spikes? Have you tried using this feed to create daily data as described in the guide here: Calculating Daily kWh - Guide | OpenEnergyMonitor

Your third process ‘kWh to kWh/d’ will not work as the ‘Power to kWh’ process just returns the original power value. You could use Power to kWh/d instead … or just keep process 1 & 2 and use the ‘delta’ mode in the graphs to generate the daily data on the fly (as per linked guide).

The bar graphs in my opening post shows the delta values from the “TotalUsage kWh” feed (from calc step 2). You can see there what values come out of the processing step 1&2. I have only used the method in “Viewing a kWh per day bar graph”, and I also use the “TotalUsage kWh” feed in the “My Energy” app and the Android emoncms app. They all show the same behaviour.

And you are right, the “kWh to kWh/d” does not work (there is another thread where I bother you all with questions about that…), so that feed is always 0 and should be disregarded in this thread. BTW, thanks for clarifying why it is 0!