Discussions
Querying cumulative usage
Hi - I'm writing the binding for to support Flume devices for openhab. Given openhab has its own persistence service, I'd like to query a cumulative number of gallons used over time. I have a few questions:
- Is there any performance issues that Flume would be concerned with in having a long window range with a "since_datetime" being very early? Or, should I only do that query infrequently (like at midnight every day) and do a more frequent query to get the day usage and add that do the cumulative usage since midnight?
- In the first 2 queries below, the result is always the same even though the until_datetime is different. Any idea why?
- Lastly, is the rate limit per submission of a set of queries, or based on the number of queries (for instance, in the below there would be 4).
Thanks
Jeff
{"queries":[
{"bucket":"YR","group_multiplier":5,"units":"GALLONS","until_datetime":"2024-07-10 00:00:00","since_datetime":"2016-01-01 00:00:00","operation":"SUM","request_id":"cumulativeUsage"},
{"bucket":"YR","group_multiplier":5,"units":"GALLONS","until_datetime":"2024-07-10 19:26:37","since_datetime":"2016-01-01 00:00:00","operation":"SUM","request_id":"cumulativeUsage2"},
{"bucket":"DAY","units":"GALLONS","until_datetime":"2024-07-10 19:26:37","since_datetime":"2024-07-10 00:00:00","operation":"SUM","request_id":"todayUsage"},
{"bucket":"MIN","units":"GALLONS","until_datetime":"2024-07-10 19:26:37","since_datetime":"2024-07-10 19:25:37","operation":"SUM","request_id":"instant"}
]}
{"success":true,"code":602,"message":"Request OK","http_code":200,"http_message":"OK","detailed":null,"data":[
{"cumulativeUsage":[{"value":552508.298842}],
"cumulativeUsage2":[{"value":552508.298842}],
"todayUsage":[{"value":673.7198743}],
"instant":[{"value":0}]}],"count":0,"pagination":null
}