Template sensor from two total_increasing statistical calculation

Hi,

I want to calculate the COP of my Heatpump. I have a flow meter (produced_heat) entity that outputs energy as a total_increasing (kWh) class. I also have a energy meter (used_electrical_energy) that outputs the energy as total_increasing.

How can I calculate cop = produced_heat/used_electrical_energy

Since the absolute values of the measurements are not usable the increased amount in both in the same statistical period needs to be used. How can I achieve that using a template sensor?

Thanks,

Marco

Nobody really?

it’s not possible, that’s why no body is responding. There’s no way to get stats information in a template sensor.

You can attempt to emulate the stats with the statistics integration

then do your calc from there.

Juat found your topic. I asked the same question today and @petro guided me in the right direction. You can find what i did here: Heating COP calculation

Still testing the solution, but i think i’m in a right direction.