Community
OpenEnergyMonitor

Community

How to recalculate a (kWh) feed?

Hi, due to some regular,weekly crashes on my local emoncms running on my emonpi, the statistics on kWh/d has gone a bit haywire:

The emoncms is fed by two IotaWatt units, and they hold watt-data during the down-periods of the emonpi. So when I cycle emonpi power and its rebooted, all power (Watt) data samples are written into the emoncms database. But - in the mean time the calculated kWh gets all wrong, as can be seen on two consecutive Sundays (and the following Monday).

This graph shows the same, where the crashes happened on each of the jump in the curve:

I have updated the emonSD image to oct19 now, so I have hopes these crashes are history, but…
Is there a way to recalculate entire FEEDs or parts of FEEDs?

Hello @OlavKristiansen

Yes there is a tool called the post process module, you can select a source power feed and recalculate a kWh feed from this, you can find the post process module in the setup menu:

Thanks, I already tried that. It calculated all samples correctly and within a fraction of a second. But the new feed did not ‚Äúcome alive‚ÄĚ, it calculates up to now only and stays there until you click ‚Äúcalc‚ÄĚ again. And it creates a new feed, it does not recalc the old one.
Or have I got it all wrong?

Ok, so I may have misunderstood here. In the field ‚ÄúEnter output feed name‚ÄĚ I did not dare enter an existing feed. But that may very well be the main purpose, is it? Just wanted to check with the experts before doing something entirely wrong.

Thanks for correcting my slightly embarrassing typo…English is not my native language…

1 Like

Hello @OlavKristiansen, yes one more step after post processing is to recreate the input processing and link it to the new feed, so that it continues to update.

Ok, I got that working, thanks.

Now I have this other, strongly related problem. In cases where either the emonpi hangs or where the wifi is not available for some reason, all power (kWh) data become garbled.
This happens for CT data written from my two IotaWatts (they write directly using API write key). Not sure how kWh data are calculated, but it is quite inconvenient that the values add up to unphysical quantities when Watt data are not coming in.

Example, the houshold typically uses 30-60kWh/d. Yesterday the wifi went down for a perod of a few hours and IotaWatt feed were obviously on hold during this period. Emoncms interpreted the lack of Watt inputs so that the calculated consumption became 2287.7kWh…similar odd values were calculated for the other 61 feeds as well.
I do not think the re-calculate function would be the best way forward here, re-creating all >60 feeds.
What I would think emoncms should do would be to stop accumulating once input feeds stop. A possible workaround (to maintain the statistics) would be to manually alter the kWh values for the hours/days affected. In a MySQL db I would know how to do this, but I would need help for the db used by emoncms.