Calculating oil burner ON state between 3 apartments

Hi guys,

I have been having a hard time working this out. I live in a house with 3 separate floors. We have a main oil burner in the basement and I have these old hour meters that were set up for counting how long each apartment’s water valves are on and a fourth that counts when the burner is on. I need a solution for charging each floor accordingly. You can’t use the apartments’ meters alone, because they count how long the valves are on and not the burner itself. If the water is hot enough then the valve will be on circulating the water but the burner will be off so no actual oil is burned. So if I were to only use these three meters I would be overcharging me and my other family members.

Now I have the meter for the burner but this is where I get confused. My friend says I just need to proportionally divide the hours from the 3 meters to the hours of the burner. But I think that is completely wrong since there is no way to know for said hours the burner is on to whom they correspond.

So I think what you need is a way to count for how long each apartment’s meter is running while the burner’s meter is also running.

Here comes HA and probably ESPHOME?

If I can add all four meters to HA so that when they are running I get an ON state, then surely there must be a way to make a third sensor per apartment that only starts counting when both burner and apartment’s meter are both as “ON”

I am hoping for ideas for the HA part mostly. Although I would definitely appreciate input whether my thinking is correct. I’m sure there are some clever people in here that could tell me if I’m being stupid and there’s a much easier way to do this.