History_Stats Templating

Hi,

I’ve found the history_stats module and started logging durations that entities are spending in various states… Any light on, dishwasher / washer in use etc.

I’ve looked at my heat pump, and think I can record how long it spends working to produce central heating, but would also like to work out how long is spent heating water for showering, hot taps etc.

Here is a graph I have, top shows various entities within HA for the heat pump, bottom graph shows total energy usage.

Whilst not all of the energy usage can be attributed to the heat pump, a lot of it can… I’m still working towards measuring the energy use of only the heat pump.

However, for now, I’d like to log the time that the system is working, but not for central heating…

S1 Room Heating indicates that the heat pump is producing central heating, that’s the easy one!

Where there is a sharp increase in ‘external flow temp’ but no ‘S1 Room Heating’ I’m assuming the heat pump is heating water for tap/showers etc. How can I create a sensor to track this (assumed) state?

Once I can report Heat Pump energy use, I’d like to get a feel for how much energy is consumed by both central heating and hot water production.

Thanks,
Nick