[Custom Integration] Virtual Gas Meter - Track your gas consumption easily!

Hi everyone! :waving_hand:
I’ve been working on a custom integration for Home Assistant called Virtual Gas Meter and I’m finally at a point where I’d love to share it with the community and get some testers.
If you want to track your gas consumption (or simulate a gas meter) without having a dedicated physical smart meter on your main gas line, this integration might be useful for you.
What it does
The Virtual Gas Meter integration allows you to create a virtual sensor that tracks gas usage based on custom triggers, pulses, or calculated values, perfectly integrated with Home Assistant’s energy dashboard (device_class: gas, state_class: total_increasing).
Features

  • Easy setup and configuration.
  • Designed to work seamlessly with the Home Assistant Energy dashboard.
  • Lightweight and built following current HA standards.

Installation (HACS / Manual)

  1. Via HACS (recommended): (Note: If you haven’t added it as a custom repository yet, you can do so in HACS using your GitHub URL).
  2. Manual: Copy the virtual_gas_meter folder into your custom_components directory and restart Home Assistant.

Links & Repository
You can find the source code, documentation, and installation instructions on GitHub:
:backhand_index_pointing_right: GitHub - nebbiadigiorno/ha-virtual-gas-meter
Feedback & Testing
Since this is an integration ready for testing, I would really appreciate any feedback, bug reports, or feature requests. Feel free to open an issue on GitHub or reply directly to this thread if you try it out!
Happy automating! :rocket:

Managed to get this going, though I’m having a hard time getting my head around it.

  • I have a single gas boiler and a single thermostat - no sensors for individual radiators
  • At this time of year most of the gas goes on heating, but I also use it for water and for cooking

I have set it up with a template so that when the boiler is heating the index is 100%, otherwise 0%. Presumably cooking/water usage will get absorbed into this after a few readings. What happens in the summer when the index is 0%?

Or have I misunderstood entirely… :worried: