Monitoring Natural Gas Usage with Home Assistant and ESPHome

Posted on Thu 21 March 2024 in Home Automation

After (adding my water meter)[monitor-water-usage-home-assistant-esphome.md] to Home Assisant, I looked to leverage the knowledge gained during the process to monitor my gas usage from my natural gas provider, Enbridge.

Unfortunately, their gas meter of choice, the Itron Metris 250, is about as dumb as they come. Enbridge still performs manual meter reads, and the meter has no pulse output (either optical, electrical, or magnetic) and as such doesn't provide an easy way to get measurements in a machine-readable fashion.

A lot of the solutions I found centered around trying to read it optically using either a camera or a lux sensor, until I stumbled on the following thread in the Home Assistant Community: Can this gas meter be made smart in any way?

The short story is that most diaphragm-type gas meters have moving metal components that can be measured with a sensitive magnetometer to determine how many cycles the diaphragm has gone through, and consequently how much gas I've used (and been billed for).

The easiest way to accomplish this with Home Assistant is to use their sister project, ESPHome. Home Assisant leverages ESPHome to control low-cost ESP8266, ESP32, RP2040 and other microcontrollers.

I again used the Olimex ESP32-POE-ISO platform (in particular the ESP32-POE-ISO-IND variant, as it has an operating temperature range that can handle Canada's cold winters and warm, muggy summers)

I also, again, turned to the MOD-QMC5883L Olimex ESP32-POE-ISO 3-axis digital compass/magnetometer, which connects to the ESP32 board with a ribbon cable with a UEXT connector, and is supported by ESPHome,