MyGasMeter – a low-power link between the gas meter and home automation

This sensor node is attached to the gas meter in my home. It uses a 2,4 GHz RF link to a MySensors-to-MQTT gateway to report natural gas consumption data to openHAB.

The gas meter is of the type that creates magnetic pulses when the meter dial moves, so the connection is contact-less, and works without access to the inside of the “official” meter from the utility company.

Initially, MyGasMeter only reports incremental data:

  • frequently, it reports the incremental pulse count since the last report.
  • once per hour, it reports flow [liters/hour] calculated from pulse count.

Once it has received a base count value from the controller (see below), it also starts reporting absolute data:

  • frequently, it reports the absolute pulse count, i.e. base value + pulses since power on.
  • once per hour, it reports total gas volume [liters] consumed, i.e. (base value + pulses since power on) * liters/pulse.

With this two-stage approach, the node will always report correct absolute pulse count, even if the gateway misses a message now and then. Also, you can replace the battery on the node and then re-initialize it for the correct absolute pulse count, without relying on EEPROM memory.

I use HABpanel to visualize energy consumption:

Source code and schematics are available in Github. For a more detailed technical description , please visit my blog.


Just a note, not sure about this particular meter, but I recall Apator sells a pulse adapter for their gas meters. I have one myself, it goes below the counter. In Poland you can ask grid operator to provide such output (output itself is ~10€).

1 Like

Hi i have this type of gas meter

I think it has a pulse sensor build in?I has 3 wires blue and yellow,they seem normally closed with multimeter and a red.I tryed all the compinations but i cant find which cables to use to take a pulse reading.Any ideas?

pretty sure it is possible to read this gas meter with a reed contact, because there is an imprint: “1 imp = 0,01 m^3.” One impulse means a used volume of 0,01 m^3 gas. Perhaps you have to buy a special attachment - like a “clip on reed contact sensor”. (Specialist are able to read the impulse with a hall sensor.)

Look at the manual:

my plan was to remove the reed contact from a zigbee window contact and connect 2 of the meter’s pulse cables instead so when the pulse triggers the zigbee contact sends me an event to use for calculating the gas useage with a rule.I connected a multimeter in continuity mode to all the 3 cables ,i waited for long enough but no pulse signal…tomorrow i will have more time to research …

no - don’t mess up (open) your gas meter! And it is not necessary anyway - and i misread your post - Perhaps the reed contact inside your window sensor can come close enough to magnet/pulse of your gasmeter. But the better way is to buy the fitting sensor attachment for your gas meter device!

Better way: you can attach a reed contact to a ESP32 (Wemos D1 mini) micro controller. Flash it with tasmota and you can send the count of pulses per MQTT to OpenHAB.

i say it again my meter has already a pulse sensor ready to use .I dont have to open anything.The pulse sensor of my meter output 3 cables.My guess is 1 is common,1 normally open and 1 normally closed.

I would agree with rrichard’s recommendation: don’t mess with your gas meter, don’t open it, don’t attach any other electrical equipment directly.

Make sure your gas burner is consuming gas (crank up the heat), then take a reed contact, attached to an Ohms meter, and hold in in various positions near the gas meter, start above the far right digit on your gas meter. If you see the reed contact close (0 Ohms) once for every full revolution of the rightmost digit wheel, then you have found the right position!

What I liked about the MySensors solution was that it is very low power, a pair of AA batteries last well over a year. That may be difficult to achieve with a Wifi-based solution. You may think about a Wifi sensor powered via a USB wall wart plugged into mains … but don’t, anything mains-powered next to a gas line that may leak at some time in the future is not a good idea …

Ok - my fault, sorry! :slight_smile: I just had your posted picture in mind and misread that you already have this attachment.
Multimeter: continuity means measuring the resistance in Ohm? Perhaps the multimeter is not fast enough? Or does the sensor need a power supply and therefore the three cables? Manual?