Gas meter sensor

Great idea! I had the same idea, just 7 months later :wink:
I’ve just started using HA so i like to learn of other users

@GobblerGuy how did you set up the other sensors (gas counter device, gasmeter)? Did you use node-RED, HA helpers or something else?

Thanks for sharing your project!

I use a helper for the counter.gas_meter:

then a HA automation for the update of the counter.gas_meter:

note that my tradfri switch is connected via Zigbee2mqtt so I see the switch presses as actions. I’ve got no idea if the same switch connected via some other method will appear the same. Note that I’ve used the brightness_move_up action as the switch is ‘pressed’ quite slowly. I’m not sure if you will see the same behaviour if you have a different method of integrating zigbee with you HA system. You might need to use a different switch press action.

Hey Chris,
I’m trying to set this up as you’ve described. I have compiled firmware with platformio and loaded script into tasmota, changed wifi and mqtt settings in tasmota and nothing else on an ESP8266.
While i love you say magic pulls values into home assistant, my magic appears not to work. :frowning:
I only need it to detect the gas meter reading and have the hall effect sensor wired only, not sure what I am missing?
Any chance you can help, or post your compiled firmware? Or anything?
Thanks

to compile i just used gitpod, just log in, change the one file “user_config_override.h” as per the smart meter interface doc on tasmota (linked above).

what do you see when you log into the web interface of the tasmota? does it show the meter values? is the script enabled? can you see messages in the console?

If you load up node red can you see the messages coming in? add a mqtt in node to a message node… this will show all mqtt messages… you may need to add a filter depending on how many mqtt things you have.

as for the script you could clean it up to just one meter

>D
>B
->sensor53 r
;disable publishing at MQTT teleperiod, on boot
smlj=0
>S
;re-enable publishing at MQTT teleperiod, after 10 seconds of uptime
if upsecs>20
then
smlj=1
endif
;recalc descriptor math
smld(2)
>M 1
+1,5,c,1,-10,GAS
1,1-0:1.8.0*255(@100,Gas,m3,Count,3
#

now days I would probably go the esphome route… but because this one is all setup and working so well i’m really hesitant to change anything

Thank you so much Chris,
I’ve spent hours at work this morning trying to find how to easily set up esphome for the sensor.
Reflashed the D1Mini, learnt to use gitpod, screen grabbed my settings for you, read through your message a few more times, and noticed the critical line “Is the script enabled?” :open_mouth:
Going back into tasmota to find the small check box I had never noticed or used before. “Script enable”
I now have a reading to play with when I get home from work tomorrow.
Any idea how to set the base value to the actual meter reading?
Much appreciated
Brett

i couldnt figure out how to set the base reading… but i also dont need it, its more interesting looking at it day by day… telling the wife off when she has a 30min shower haha. i did track for a while to make sure i had the calibration set correctly

the other meter reader i have is jomjol ai on the edge, thats pretty easy to set a base value and does a good job of monitoring the water and i also save the screenshots so i can troubleshoot later.

I’ve tried to do this a few times with various reed switches, however none of them seemed to work. I watched the meter, and it looks like the magnet is missing on the last dial. Is anyone able to take a photo / video of the meter to see where the magnet should be?

Thanks,
Stuart

Not sure if it the magnet or not but in this photo of my meter you can see a metal line between the 9 and the zero that is not present between other digits.

I’ve also used the metal detector lite app (on iPhone). It seems to respond to a higher degree at the point where the magnet would be than it would for other ferrous metals, but it is a bit hit and miss.

@chris.huitema Any chance you could share more details on your water meter solution at the old house?
I have an identical meter and keen to use a reed switch for measuring usage, but no idea where to get a one that fits…

I just used a miniature glass reed switch, available at most electronics stores. one of the leads I carefully bent 180 degrees using a small pair of needle nose pliers so it didn’t crack the glass, then soldered some cable to it, then I put some heat shrink over the tube to protect it. It wasn’t anything too fancy!

As for the electronics I was using a Bluz to count the pulse and send the count to the particle cloud. I haven’t been keeping an eye on particle lately, Home assistant has taken up most of my spare time lately

Im sure a ESP connecting to home assistant would work well, but you will probably want to look at some power saving options if its going to be battery powered.

https://www.jaycar.com.au/miniature-glass-reed-switch/p/SM1002

2 Likes

Hi,
Anyone use this one?

D105 G2 User Manual1rqilp7_gaMTQwMzE5NzEyOS4xNjc3NDM2ODg1_ga_9MTRSJQGXV*MTY3NzQ1MTQ1Mi4yLjAuMTY3NzQ1MTQ1Mi42MC4wLjA

Hi,
I use an esp8266 to count the pulses of my gas meter. Then it gets transferred over mqtt to my influxdb database. In homeassistant the mqtt part is used to create a sensor.
My problem is, that my data is not a total value, but only the pulses every 15mins.
I cant use total_increasing, can I ? Also reconfiguring all the devices to total count would be a problem, because I already have 3 years of data (pulses/15mins).
I use grafana to display the data, but would also like to insert the data into the energy section of home assistant. Is there any way to integrate pulses/15mins data ? Or will i have to add the values and use a total variable ?

I tried :
template:

  • sensor:
    • name: “Gas Meter”
      device_class: gas
      state: “{{ states (‘sensor.gz’) | float }}”
      unit_of_measurement: “kWh”
      icon: "mdi:gas

mqtt:
sensor:
- state_topic: “GZ/Differenz”
name: “GZ”
value_template: “{{ value | float * 1.14 }}”
unit_of_measurement: ‘kWh’
device_class: gas

The energy board says sensor unavailable.

anyone happen to get this working on a pico w through esp home? hoping I could steal your code if you have!!