I was looking for a rolling average over time, but it seems smoothing the values might do the trick.
Now what i'm wondering is some of the working of the node.
I already found out that it can only process numbers. And that if the string contains a number, it should be working as well.
Now; what triggers the smooth node? If set to "most recent 2 values" will it only produce a value after the second?
And what if you only point it's property to msg.payload? Should it then handle all the incoming numbers?
I've got a payload containing two values. But when i dont point it towards the actual value, it wont work.
So property msg.payload.svalue1 is working
but msg.payload isnt. Is that supposed to be the case?
Also; when a string value is picked up by the node it is converted to number. Wouldn't it be easier to keep it as it was?
An example of why it cannot do arithmetic on a string is to consider the two string values "12" and "3". If asked to sort those two, lowest first, then which one should come first?
Before answering, consider the strings "ab" and "c" If asked to sort those two which should come first? The answer is "ab" as "a" comes before "c".