Get Median value for an item's persistence value/influx db

I’m wondering if there is an easy way to get a median value for an item back into openhab from values stored in influx

If I’m running a query I would do it like this:

SELECT MEDIAN(value) FROM “temp” WHERE time>now() -10m

which would return the median value for the last 10 minutes for values stored in the DB.

I see there is a way to get the average as per persistence docs:

temp.averageSince(ZonedDateTime)

but I don’t see any reference to getting the median value anywhere.

Is it perhaps possible to get the value for median, into an item, perhaps as a direct query in rules or something. ?

thanks for any help+++

PS> I’ve got a way to do it via node red, and the influx module, but ideally I could just pull the value into OH.

Median isn’t supported in OH’s persistence actions. I don’t know if all the databases OH supports offers a median query (seems reasonable that they would but can’t be sure). I’m not sure it would be meaningful for rrd4j though.

You could file an issue and request it be added but I can’t promise it’ll be implemented.