Node-RED Calculate Node

0.1.4 · abandoned · verified Sun Apr 19

node-red-contrib-calculate is a Node-RED contribution package providing nodes for performing simple calculations like average, maximum, minimum, and median over a specified time period or message count. It is currently at version 0.1.4. The package appears to have an infrequent release cadence, with the last update more than six years ago, suggesting it is no longer actively maintained. Its key differentiator lies in its straightforward configuration within the Node-RED visual editor for basic aggregate computations, contrasting with more general-purpose `function` nodes or other calculation-oriented nodes that might offer broader mathematical operations but require more complex setup.

Common errors

Warnings

Install

Imports

Quickstart

This Node-RED flow demonstrates various calculation nodes (average, median, min, max) configured to process random numbers either every minute or every 10 messages, outputting the results to a debug node. This can be imported directly into Node-RED's 'Import' menu.

[{"id":"4c3a1551.6c254c","type":"random","z":"aff2cc18.0b484","name":"RandomNumber","low":"1","high":"100","inte":"true","property":"payload","x":340,"y":300,"wires":[["6f127280.30cf3c","6867669e.2a13a8","ac90cf81.6e61b","6dd3b70c.dfd938","596e1e94.3205b"]]},{"id":"6f127280.30cf3c","type":"calculate","z":"aff2cc18.0b484","name":"AvgEveryMinute","pauseType":"timed","calculation":"average","timeout":"1","timeoutUnits":"minutes","rate":"10","x":600,"y":180,"wires":[["4fb1838b.89fb2c"]]},{"id":"b32574cf.036708","type":"inject","z":"aff2cc18.0b484","name":"10SecBump","topic":"","payload":"","payloadType":"date","repeat":"10","crontab":"","once":true,"onceDelay":0.1,"x":140,"y":300,"wires":[["4c3a1551.6c254c"]]},{"id":"6867669e.2a13a8","type":"calculate","z":"aff2cc18.0b484","name":"AvgEvery10Msg","pauseType":"rate","calculation":"average","timeout":"10","timeoutUnits":"seconds","rate":"10","x":600,"y":240,"wires":[["4fb1838b.89fb2c"]]},{"id":"ac90cf81.6e61b","type":"calculate","z":"aff2cc18.0b484","name":"MedEveryMinute","pauseType":"timed","calculation":"median","timeout":"1","timeoutUnits":"minutes","rate":"10","x":610,"y":320,"wires":[["4fb1838b.89fb2c"]]},{"id":"6dd3b70c.dfd938","type":"calculate","z":"aff2cc18.0b484","name":"MinEveryMinute","pauseType":"timed","calculation":"min","timeout":"1","timeoutUnits":"minutes","rate":"10","x":600,"y":380,"wires":[["4fb1838b.89fb2c"]]},{"id":"596e1e94.3205b","type":"calculate","z":"aff2cc18.0b484","name":"MaxEveryMinute","pauseType":"timed","calculation":"max","timeout":"1","timeoutUnits":"minutes","rate":"10","x":610,"y":440,"wires":[["4fb1838b.89fb2c"]]},{"id":"4fb1838b.89fb2c","type":"debug","z":"aff2cc18.0b484","name":"Debug","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":870,"y":300,"wires":[]}]

view raw JSON →