Count gas consumption depending of burner time on for water or radiators

Hello,

I dont really know if it is even possibly what I like to do. I try to explain.

My gas heater is heating my radiators water and my hot tap water for the house. My gas counter and gas heater is already integrated into Home Assistant to show my daily usage in Kw/h and m³. Its realized with a counter helper, prox pick up at the counter and automation for the counter.

It also provides a few entities that could helpfull to do what I want. I can see the active state of the burner itself and also the state of the pump for the hot water but the pumps tunrs only on after burner is off again and the action was for the tap water. think all the others are not relevant.

When the heater is heating the hot tap water, the burner will be active always longer then 8min and if it is only heating the radiators for maximum of 8min. See screenshot:

Now I want to make two counters. I want to have one counter that counts the gas consumption only if it was for hot tap water (burner active longer then 8min) and another counter for the radiators (burner was on less then 8 min).

I think it is not possibly because when the counter starts rolling, its counting and i cant tell him afterwards to disregard the count if the burner was on less then 8min for example.

Anyway maybe someone has an idea how to get this resolved.

Thanks in advance…