BK-G4M Gas Meter – Home Assistant

Updated – 2 April 2024

I wanted to measure the volume of gas taken by my Ideal Vogue 18kW boiler in order to convert this to input energy in kW and therefore determine if the boilers displayed efficiency is accurate.

I decided to get a secondary gas meter fitted inline with the gas feed to the boiler, the meter was a BK-G4M from HERE.

The meter comes with a prewired switch assembly to count the number of 1/100 of m3 wheel rotations:

I’m a complete novice when it comes to Home Assistant and rely wholly on YouTube, community forums and search engines for information, and I would like to pass my sincere thanks onto all content creators who help folks like me.

I used a ESP32 flashed from within Home Assistant with the coding configuration to enable the meters switch to increment the displayed gas reading on the dashboard of Home Assistant.

The current configuration code is fairly accurate, however, I understand from the forums that a ’rounding error’ occurs and so the reading is not 100% accurate when checked against the actual meters display, their is another code available to rectify this but I don’t know how to install it yet 🙁

Current code used below:

Once the data is being imported into Home Assistant you can manipulate in many ways:

Links to Sources –

Leave a Reply

Your email address will not be published. Required fields are marked *