My gas meter was recently upgraded by the council (more of a downgrade), I had made a custom hall effect sensor to measure the flow of gas, as my old one had ‘support’ for it
(here’s what my old one looked like for reference)
If you can get power there, AI-on-the-edge works. You will have to rig up a mount to get the focus right. https://github.com/jomjol/AI-on-the-edge-device Opps, I noticed you didn’t want to resort to this solution
The spec sheet of a similar looking model says it has optional “Pulse-ready inductive output”. https://www.edmi-meters.com/australasia/wp-content/uploads/2018/03/MKT-FS-045-U8-Factsheet-Australasia-Rev-01.pdf Found a links for others trying to get it to work, with limited success, https://community.openenergymonitor.org/t/edmi-gas-meters-monitoring/11072/16 and https://community.home-assistant.io/t/davies-shepherd-ds-5-gas-meter-reed-switch-compatible-in-australia/343564/3
A magnetometer has been working fantastic for me. Looking at your pictures, I can say quite confidently it’s a diaphragm type, so it should work just fine in your case.
A benefit of going that route, is you can likely put the sensor on the backside of the meter, so it’s basically hidden.
It’s definitely a diaphragm meter. What I did prior to purchasing the magnetometer was to use the one built into my phone to confirm it would work (just downloaded an app that gave me access to the actual sensors in my phone, the one I used was literally called ‘Sensors’). I just ran the furnace and placed it in different spots to test it out. You’ll want to put your phone (or magnetometer sensor) on either the front or back of the meter where that large flat plate is.
and in terms of magnetic strength, is this weak or normal? would a 3D-printed enclosure hinder the sensor? or does it have to be pushed right up against the meter in the best spot?
A camera is not an optimal solution for outdoors, the meter is owned by the council, the front meter read cant be obstructed otherwise they’ll get upset when they try read it
The first part of the z-axis looks pretty similar to what I was getting on my phone (kind of looks like you maybe moved your phone to a less optimal spot afterwards). I found it tricky since I had no idea where in my phone the actual sensor was located. I do seem to remember that with my phone, one side of the meter gave much better results than the other (but for whatever reason, this didn’t seem to be the case with the QMC5883L).
You don’t need a massive difference between the peaks and valleys, the key is just that they’re consistent and that there isn’t a bunch of noise in the data.
First thing I’d try is remove everything but the QMC58831 stuff. I’d also uncomment the other parameters and lower the update interval (maybe the 8266 can’t handle such a small interval?). Basically just end up with this:
i2c:
sda: D2
scl: D1
sensor:
- platform: qmc5883l
address: 0x0D
field_strength_x:
name: "Gas Meter Field Strength X"
id: gasx
field_strength_y:
name: "Gas Meter Field Strength Y"
id: gasy
field_strength_z:
name: "Gas Meter Field Strength Z"
id: gasz
heading:
name: "Gas Meter Heading"
range: 200uT
oversampling: 512x
update_interval: 1s
You should definitely be getting values (and they should be moving all around if you move the sensor around, it is essentially a fancy compass after all). Lastly, you are giving the magnetometer board 3V and GND, right? Maybe try swapping the SDA & SCL pins? Other than all that, I’m kind of at a loss. The only other difference is like I said before, that I’m using an ESP32 but I don’t know why that would make a difference.
It did actuall work when i first set it up, only after i made a nice case for it and assembled it all it stopped working. idk how i2c works, but if it sees the sensor that means it should work no? it either says no device found or it should work?
Turns out the ESP was cooked - probably becase a bit had corroded and it was covered in hot glue, the more you know
Would you have any suggestions on how to calibrate the esphome template?
I assume I would first install the magnetometer on the gas meter, and gather some data, change some values and i should have a pretty accurate readout?..
…I dont even know where to start after installing it
Always good to find the root of a random issue like that!
What I did originally is left all the magnetometer sensors visible (so didn’t change them to internal: true or have them commented out). Set everything up and ran the furnace for a few minutes (which might be tricky now, depending where in the world you are). I picked the sensor/axis that had the largest/best variation (read: nice, big and clean sinusoidal waves). Then I edited the firmware, commenting out the other magnetometer sensors that weren’t needed and updated this part of the code:
Going off of memory, I believe the values I got for the sensor I ended up using (z-axis in my case) ranged from around -150 to -50. I ended up choosing values that were close to the peaks (-75 & -125), but still a little bit away from them (mainly just as a safety factor in case the values in the future become a little less extreme). In your case, you’ll want to change the above part of the code to use the axis (x,y or z) that has the best readings and change the -75 and -125 to whatever values make sense based on what you see when you’re using gas.
Upload your edited YAML and you should start getting useful data for gas usage/consumption. I ultimately ended up keeping an eye on the raw readings from the z-axis for a week or 2 just to make sure it didn’t change and everything was working as it should. Ultimately though, I changed it to internal: true so that it wouldn’t be sending so much data to HA (every 1/10th of a second) that I don’t actually care about.
The other thing I’ll mention, is if you haven’t already, you’ll need to calibrate it to match your meter (how many cycles of the diaphragm equal how many units of gas). In my case, the wave output from the sensor would go through exactly 8 cycles for 1 cf of gas. So while you’re calibrating things up above, pull up the raw data on your phone and while standing in front of the meter count how many cycles you see when the meter reads 1 of whatever unit it’s counting: presumably it should line up perfectly.
And that was it. Let me know if you run into any issues and good luck!