Smooth Node incoming data

I would like to use the smooth node to get the std deviation.
I have a string of data, similar to this one but with 32 values, streamed every 10 seconds:

12.747:12.884:12.672:12.909

Is there a way to pass all 32 values to the node rather than one by one selecting the "over the most recent xx values?

Thanks

You could preform the calculation in a change node or function node.

[{"id":"7aa1c827.66c4a8","type":"inject","z":"bf9e1e33.030598","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"12.747:12.884:12.672:12.909","payloadType":"str","x":170,"y":220,"wires":[["9eacf013.71837"]]},{"id":"9eacf013.71837","type":"change","z":"bf9e1e33.030598","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"(\t   $array := $split($$.payload, \":\").$number($);\t   $array_count := $count($array);\t   $mean := $average($array);\t   {\t       \"sample_sd\":$sqrt($sum($array.( $power($mean - $, 2) ) )/($array_count-1)),\t       \"sd\":$sqrt($sum($array.( $power($mean - $, 2) ) )/$array_count)\t   }\t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":220,"wires":[["d9d457b0.f0ad4"]]},{"id":"d9d457b0.f0ad4","type":"debug","z":"bf9e1e33.030598","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":690,"y":160,"wires":[]}]

Thats brilliant!

Thanks a lot

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.