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.
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
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 Printables.com.
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.
- Sensor mount 3D Printed design
- D-Z73 reed switch sensor
- Aqara Zigbee magnetic Door/WIndow sensor
- Home Assistant yaml package file
Amazon links are affiliate links that help support the site