Average from 4 MQTT In nodes

Hello guys, in my NODE-RED flow, I have 4 MQTT In nodes receiving data every 10 seconds from a Python script via the server. Now, I want to integrate the 4 inputs from the MQTT nodes into a function and output the average every 10 seconds. I don't have a solution on how to precisely calculate the average value in the end.

Hi and welcome

You could join the four mqtt nodes manually using a join node, then do your calculation. Create a single message from separate streams of messages : Node-RED

Or possibly feed your mqtt nodes into the smooth node which can do an average. node-red-node-smooth (node) - Node-RED

p.s. I have moved the category to general, as this is not about developing a node.

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