Averaging input data before logging to database

Hi everyone.

Currently my local emoncms run on SBC is getting PV inverter data from local bash script every minute, this is working perfectly fine. I want to increase data frequency to every 10s but have it logged every 5 minutes. I don’t see any way of doing it in input processing or I’m missing something. I can do it in bash script so it will collect data for 5 min then feed it in to emoncms but I would like to have access to 10s resolution data. Any ideas?

Welcome, Alex, to the OEM forum.

You can of course log to two separate Feeds, one with a 10 s interval and one with a 5 minute interval, but this will record the latest instantaneous value before the 5-minute marker. This will cost you storage space, it won’t save any, and it’s exactly equivalent to what the Data Viewer in emonCMS does.

Do I sense that you only want this for a limited period, whilst retaining the 5 minute data for ever?

You’re right about input processing, there’s no ability to average a number of samples and then log to a Feed, nor in the Post Process module. I think your only solution is to do it externally - either on the incoming data before you send it into emonCMS, or afterwards by accessing the time series database afterwards when you access the data.

My minimalistic brain didn’t even though about 2 feeds containing actually the same data but it is the solution for my problem. And yes, I want 10s for diagnostic purpose so it don’t need to be logged and data kept in RAM for last couple of minutes will be fine.
Thank you Robert, scripting time…

Remember, you can’t change the interval of a Fixed Interval Timeseries database, but I believe you can post-process and downsample the old database into a new 5-minute one.