I am trying to read my gas meter using a reed sensor. The gas meter is a Honeywell BK-G6 MT.
1 pulse is 0.01m³
I set internal_filter to 3400ms, because the meter supports a max of 10 m³/h
(10m³/h = 1000 pulses/hour = 16.7 pulses / minute = min 3600ms between two raising edges)
I use an ESP32 (az-delivery-devkit-v4) which is overkill but it was lying around.
It seems it’s reading something, but the values are strange from my point of view, it’s oscillating between two “gas consumption speeds”:
I think I need to attach a LED to the ESP32 board and make it turn on for each pulse to troubleshoot this and see if there really is two different speeds of gas consumption.
I just wondered if someone had already seen a similar effect with pulse_meter…
I use ESPhome 2024.2.1 at the moment.
- platform: pulse_meter
name: "gas consumption"
id: sensor_pulse_meter_gas
pin:
number: GPIO25
inverted: true
mode: INPUT_PULLUP
device_class: gas
state_class: measurement
accuracy_decimals: 0
# Honeywell BK-G6 MT: spikes seen, need to be filtered out.
# Qmax = 10 m³/h
# 1 imp = 0,01m³
# Max Rate = 10 m³/h / 3600s / 0,01m³ = 0,27/s = max 1 impulse every 3,6s
internal_filter: 3400ms
icon: 'mdi:fire'
total:
name: "total gas consumption"
state_class: total_increasing
actually, better idea, is there a way to draw the GPIO status in parallel? Or do I need to disabled the pulse_meter sensor and create a binary_sensor instead?
So I switched temporarily to a binary sensor. I probably will do the following for easier troubleshooting going forward:
Bridge the GPIO 25 to be able to have both binary_sensor and pulse_meter at the same time.
add a LED that will trigger each time a pulse is detected.
but for now, this is what I see with the binary sensor:
This is zoomed out (larger scale of time):
So pulses are very regular actually, I count 21 pulses within a two minute window. I would expect the pulse_meter to be at 10 or 10.5 pulses per minute or 0, maybe a brief transition phase before and after, but that’s it. The picture in the first message was taken within one of these “series” hence it should be a solid 10 pulses/min in my view.
I appreciate any pointer on how to troubleshoot this better.
Here’s my ESP8266 config for my electricity meter, fed from a photodiode module looking at the 1/Wh flashing LED.
I have the module output wired to both D2 (binary sensor) and D5 (pulse counter), and the binary sensor operates the LED. internal: true means that HA does not see the binary sensor nor the LED.
The LED is a super-useful debugging aid: recently, after a couple of years of flawless operation, the power reading dropped right down. I could see straight away from the box LED (in the garage) that it was the pulse input at fault, which led me to the massive spider in the external meter box that had dislodged the magnetically-aligned photodiode.
Is there some auto-calibration happening in pulse_meter maybe?
In general I am wondering if pulse_counter wouldn’t be better for such “blocky” pulses. I basically have 10 pulses/min or zero, that’s it. The heater is not modulating the gas consumption it appears, it’s very simple…