I am working building a device handler for a water meter using a Z-Wave device that supports the PULSE METER command class. The device sends me the pulse total, from which I can calculate the total number of gallons, but what would be the best way to calculate the Gallons per Minute? This is a much more useful figure.
I could write a function that would run once per minute and compare the last two gallon values, but since all of the scheduled events are dependent on the cloud, this seems like it would be a bad idea (give the ST history with timeliness of events). Does anybody have any ideas for the best way to accomplish this?