Open chrisluedtke opened 5 years ago
Sorry about that. Like the other issue I'm really pressed for time.
Here's an example: https://api-of-things.plenar.io/api/observations?time_bucket=avg:6%20hours&sensor=metsense.htu21d.temperature&node=004
The pattern is time_bucket={function}:{interval}
where function
is a Postgres statistical function and interval
is a Postgres interval value.
You're also going to need to limit to the sensor you want to aggregate, and it usually makes sense to also limit to a node or project (rather than all the nodes).
Correction to the above comment: the function value is one of min
, max
, avg
or median
. I reviewed the controller code and remembered that I had restricted it to those.
I update the docs a bit. If you want to be a superstar and take a look and let me know if that's sufficient I'd like to hear your thoughts -- in general. I really don't like Apiary as I find it really restrictive, and I'm not sure how to best document really involved stuff like this function.
Yes, that clears it up. I'll be playing with this in the next day or two.
I'd love to use this parameter rather than pulling and normalizing/interpolating data on my end, but documentation does not make the usage clear.