AmyAmy / node-red-contrib-moving-average

A moving average node for Node-RED.
Do What The F*ck You Want To Public License
2 stars 2 forks source link

Feature: Output multiple values at once #9

Open Geving opened 3 years ago

Geving commented 3 years ago

It could be useful for users to be able to retrieve several values at once. Suggested output:

{
  "avg":123.456,
  "max":999,
  "min":-10,
  "count":150,
  "last":345,
  "timespan":3587
}

where "last" is the last value entered into the node, timespan indicates time since first datapoint in the average. Alternatively, a timestamp might be just as useful: "timeOfFirstPoint", "timeOfMinPoint" and "timeOfMaxPoint" are good candidates.

AmyAmy commented 3 years ago

I agree that this would be useful, especially with min and max commands which may be useful to retrieve together. The time of the points currently aren't tracked, so that may take some figuring out how to best approach.