Gas Meter Usage Sensor Using Zigbee Door Sensor

Since Home Assistant launched the Energy Management dashboard, I wanted to find a way to add my Gas usage to the dashboard. I’ve opted for the moment not to have a Smart Meter since the mess that was the SMETS 1 meter rollout, but that means I had to find a way to measure usage from my analog gas meter.

Commercial pulse sensor

The meter has a small magnet in the last digit of the dial, each rotation of the digit represents 10 cubic decimetres of gas consumption. You can buy a module specifically for the meter for around £40 here, but that still needs to be connected to something to actually measure the pulses. In order to sense the rotation of the magnet it just needs a reed switch, a £40 solution seems a bit overpriced.

Wireless Magnetic Sensor

To meet my requirements I needed a magnetic sensor that could send pulse information wirelessly and be battery powered with a 6-12 month battery life. I already have a number of magnetic door/window sensors around my house that use Zigbee and the battery life on those has been surprisingly good.

I initially tested to see if placing the door sensor on/around the meter would trigger it, but it didn’t, so I knew I’d have to be able to better position the sensor in order for it to work and provide accurate measurements. Opening the Aqara Zigbee magnetic Door/WIndow sensor I could see it used a simple glass reed switch, I was about to de-solder it when I noticed two pads on the PCB which connected in parallel with the sensor so I opted to leave the existing reed switch in place and solder on wires for the external sensor

Reed Switch

I could have used the glass reed switch from the door sensor, or sourced another glass reed switch, but I wanted something that looked a bit more professional, should someone take a look in the meter cabinet. I also wanted a sensor that I would be able to position easily. A quick search revealed a number of reed switches enclosed in plastic housings, the smaller ones tending to be used for pneumatic control systems. Based on availability and size I ended up with the D-Z73 reed switch sensor. Hooking this up and testing it held near the bottom of the meter showed that the pulses were sent on each rotation.

Mounting the Reed Switch

The meter has a couple of small plastic posts protruding from the front, in a small recess at the bottom right-hand cover of the meter dial. Taking some measurements I created a mount for the sensor that would press-fit over these posts and hold the sensor securely in place. The design is available over on

Home Assistant Integration

Along with tracking consumption, I wanted to track the cost of the gas and integrate it with the energy dashboard. To do this required the creation of a number of sensors, to track the units used, incrementing the value on each pulse received. Along with calculating the cost after converting the consumption to kWh. I wrapped up all the sensors etc into a package file for home assistant, which is available on GitHub.


Amazon links are affiliate links that help support the site

2 thoughts on “Gas Meter Usage Sensor Using Zigbee Door Sensor

  • 13th July 2022 at 7:37 pm

    Thank you very much for this. I thought you might be interested to know that I found your post and replicated your setup perfectly. I wrote my own HA automation from scratch, with subtle differences, but completely cribbed the hardware side.

    I asked a friend to 3D print the part, but unfortunately it doesn’t fit over my meter’s stubs. I’ll drill it wider when I get a chance. Until then I’m using Blu-Tack.

    Some photos, if you’re interested:

    Thanks again!

    • 13th July 2022 at 7:40 pm

      So glad it worked for you. 3D printer tolerances can vary, so that may account for why it doesn’t fit. But you can’t go wrong with blu-tack 😉
      I hope a few spins for a drill bit, possibly even by hand, will get the mounting plate to fit.


Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.