Calculate percentile from data seies

Hi All

Newbie here, just getting started with Home Assistant, so sorry if this is trivial, but I haven’t been able to find a solution that works.

Issue is: I have an integration that pulls tomorrows electrical prices from the authoroties and displays them in an hourly graph (ApexChart), that works just fine:

image

I would like to calculate the, for example, 90th percentile of the days dataset, and show it as a horizontal line on the graph, and at the same time use this information for automation to, for example, turn of electrical heaters in the hours that breach the percentile line.

Ho do I get to that point? (Does my question make sense at all?)

Dennis

Hi there,

Did you check the statistics intergration?