Summing multiple inputs

There are a number of things it could be, there is quite a lot of info missing to determine what it is exactly.

But I’m guessing the data is coming via an emonPi or an emonBase running the emonPi image as the nodes and inputs are named not numbered, is that correct? or are you posting to emonCMS via a homebrew script?

If you are using the emonSD the issue is most probably the use of mqtt, you have no control over which inputs update in what order, each input is independent and therefore the inputs could even be updating simultaneously.

Also we cannot see what feed types you have there, if they are fixed interval then it really doesn’t matter what updates when in between intervals as the feed will only record a snapshot at the interval.

Can you post a screen dump of your feed list?

The advice @bidouilleur has shared is good advice but a bit off topic for the basic issue here, the reason he’s using a “different name” is because he has a “log to feed” at the start and another at the end, therefore yes they must be different for the purpose of identifying them, but in actual fact it’s only emoncms.org doesn’t support reusing the same names, in a self hosted emoncms you could in theory name every single feed “feed”, I cannot imaging why anyone would and it would be a nightmare if they did but emoncme will allow it and function perfectly well.

I’m not aware of any reason to not name feeds the same as inputs, but maybe @Robert.Wall has experienced something I haven’t. I actually make a point of always using a “log to feed” at the start of a processlist to record the raw values and I usually name them the same as the input they mirror.

IMO better advice is to not use spaces or special characters, I use only alphanumeric chars, underscores and dashes. I have seen some bizarre things happen with other characters and emoncms often removes spaces too.

Robert’s example is exactly how easy it should be [quote=“Robert.Wall, post:5, topic:1373”]
Inputs:

Node: Key Name Process list last updated value
0 power1 + inp log 3 mins ago 220
0 power2 + inp log 3 mins ago 310

Input Power 1 processing:

Order Process Arg Actions
1 + input Node 0: power2 (inputvalue:310.00)
2 Log to feed Node:0: Node 0:power1 (feedvalue:530.00)
[/quote]

However if you are posting the data as a packet of value in a fixed order (eg csv), the inputs are processed in order starting with 1 then 2 etc, as long as you put you “input1+input2” in the processlist of input 2 not 1 it cannot go wrong (famous last words), if it’s in input1 processlist input2 will not have been updated yet so you will use the old value.

With any other method JSON named inputs or individual MQTT topics you have no guarantees and you probably will not easily spot this type of issue as the screen you are watching is not always upto date info, eg the inputs page refreshes every 10 secs and the processlist screen (I believe) only displays fixed value of when opened.

This is the reason the emonPi has a “power1pluspower2” input because it has to be done in the sketch to be reliable unless you revert to posting orderly packets of data.

The use of feeds over inputs was good advice but the main reason for doing that was if you delete inputs when they are referenced in another inputs processing you would lose that other inputs processlist and have to delete it, it is not as easy to accidentally delete an input now so it’s less of an issue but still good advice IF you are not referencing a fixed interval feed as it will always use the feeds last value which could be stale, as it is not updated in between intervals, so it isn’t good “blanket advice” and whilst it is still my preferred method I have learn’t fixed interval feeds do not work as expected.

Do you have a emoncms.org account? try also sending the date there at the same time, you may spot the difference.