Should I use separate inputs or stack multiple process steps in one input?

Hi,

Apologies if this is a dumb question, but I am still new at this. I've got an emontxv3 and RPi and using it to monitor whole house usage as well as PV generation. I have one CT on the Solar generation, and one CT on the Grid import / export, and uploading the data to emoncms.org

I now realise I need to add the PV Generation to the Grid import / export to get total house usage, but I am getting confused on best way to do that. I think I have seen examples of using the input process assigned to  PV Gen, logging to feed, and then adding Grid import, and then logging that to a feed, and I have also seen it the opposite way around, by updating the input for Grid use and adding Solar gen and logging that to a feed. And I also think I saw a suggestion of using a completely separate input, and adding the Solar Gen together with Grid input, and logging that to a feed.

Is there a preference? Is it simpler to use a separate input for each of them ? i.e. input 1 for PV Gen, input 2 for Grid, input 3 for combination of both? Is there a performance benefit in adding lots of process steps to one input, or is it better to have more inputs, with less process steps for each of them?

And if this is covered in a newbie document, please point me at it as I haven't found it on the emoncms documentation on github

Ian

Robert Wall's picture

Re: Should I use separate inputs or stack multiple process steps in one input?

I'm pretty sure it won't be documented to that level, and I doubt whether you'll see a difference in performance. So I'd advise you to use the one you're most comfortable with. The only thing I'd consider is what information do you think you're likely to want in the future: only 'feeds' are stored, anything else is lost instantly.

pb66's picture

Re: Should I use separate inputs or stack multiple process steps in one input?

The predominant factor to consider when planning your processlists it that the processing is triggered by the update of the input and the inputs are processed in the order received by emoncms. so due to the way emoncms receives most of its data the inputs are updated (and therefore processed) sequentially in numerical order, this won't be the case if data is supplied as key value pairs (eg power1 = 100 etc).

The reason I mention this is because you may wish to have any processing that includes multiple inputs located in the later of those inputs to ensure the new values are used. when input 1 is processed if it includes "add input 2" that will use the previously received value as input 2 will not have been freshly updated yet.

The triggering by input update makes the use of a "separate input" to tally 2 inputs a little more complicated to implement as it would rely on the update of that "separate input" to update the total.

So in your example I would be inclined to have the totaling in input 2's processlist.

​Another recommendation is to "log to feed" each input ( I prefer variable interval to log receipts rather than trends) and then use "add feed" rather than "add input" as it is far more robust.

Paul

Comment viewing options

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