I still need to work on it more, but for now, it does what it does. There is probably a race condition in there where you may get flow rates that are astronomical. They usually clear themselves out though.
I do have added in what I refer to as current flow. I keep track of the following values:
- currentFlowAverage
- currentFlowDuration
- currentFlowHigh
- currentFlowMeterStart
- currentFlowRate
- currentFlowStartTime
This allows me to easily use HE Rule Engine.
Let me know what you think.