Running total of minutes boiler is making heat

I can only answer for the kind of boiler I have for my hydronic baseboard system. In systems like mine, the boiler fires based on a high and low limit. It will fire occasionally to keep the temperature above a lower limit, and it fires whenever a thermostat is calling for heat, up to a higher limit. So I can’t just use the total time a thermostat is calling for heat to estimate the fuel burn.

So I connected a relay (contactor) to the 120VAC (mains) supply to the burner. At first I’d connected the contacts on that relay to a door sensor. I’d removed the reed switch and soldered the wires to the contacts in its place. Later, I went directly to the GPIO pins of the RPi running HA. I’ve also tried it with the GPIO pins of an ESP8266 I plan to use to tidy things up a bit one of these days.

There are a few threads on this forum about doing things like this. Search for “boiler runtime.” One of them I started back in March '21, but the above is the gist of it. There are also some threads on using this value to estimate fuel burn, including one explaining how I did it.

My latest addition was an ultrasonic level sensor in my oil tank. Again, there are some threads here, search “oil tank level sensor.” Mine is similar to this one. I used an ESP8266 instead of an ESP32, and I used an off-the-shelf plumbing fitting which I’d drilled a hole in to hold the JSN-SR04T sensor. I’m finding it’s very accurate in my steel tank, except at very high (full) and low (empty) levels.

One more thing. It sounds like you’re doing this for rental units. Give some consideration to how you are going to track and retain the data. The HA database is pretty efficient for what it does, but it’s not really designed for long-term storage. I save my daily summaries in text (csv) files.