I think above looks pretty good, going back to the top here, 118 cycles = 0.2m3, how would I put this in the template to proplery calculate flow/usage?
I noticed that from the top to the bottom picture, the range of values changed quite a bit. In the top picture, the x-axis is going from (~60 to ~110) while in the last picture they only go from ~70 to ~80. Did you move it or end up going with the Y-axis maybe? You definitely want to go with the axis that gives you the largest difference between highs and lows, that way it’s easier to identify when you’ve gone high/low. Assuming the x-axis data looks the same as in the top picture, I’d probably go with counting high at ~95 and low at ~70 (just eyeballing).
This should get you to the right gas rate/consumptions, based on what you counted.
#118 counts per 0.2m3, or 590 per m3, multiplied by 2 to get per minute based on update interval
- platform: template
name: "Gas Rate"
lambda: |-
int temp = id(gas_counter);
id(gas_counter) -= temp;
float temp2 = temp;
float temp3 = (temp2/590)*2;
return temp3;
update_interval: 30s
unit_of_measurement: m³/min
device_class: 'gas'
- platform: template
name: "Gas Total"
lambda: |-
float temp = id(gas_counter_total);
return temp/590;
update_interval: 1s
unit_of_measurement: 'm³'
state_class: 'total_increasing'
device_class: 'gas'
I got the axis names messed up in that first screenshot, then got the axis wrong again in the second screenshot, the correct axis is the last one there with the lines (real X). Because the other two axis had some sort of ballooning, which I assume was the diaphragm moving really slowly, but the X axis did not have this so it looked like the cleanest axis to use
I’d probably go with counting high at ~95 and low at ~70 (just eyeballing).
Where are these numbers from? Is it not the highest and lowest point? When the heaters going full blast (screenshot 3 from before) the lowest is -83 and the highest is like -68, I assume when you use “~” you mean minus (-) not around (~), or ~-…
Thanks for doing those calculations, gas total is working, but gas rate seems stuck at 0m3/min
Are you talking about the bit I circled in red? I think that’s just the diaphragm moving very slowly from a pilot light, so the fact that you can see it is a good sign (since it means it’s more sensitive).
I just eyeballed the same graph (so roughly where the green lines are in my picture.
If it’s working, then there isn’t necessarily a reason you HAVE to change it, but I’d definitely go with the axis I highlighted in my picture since it’s got the largest swing from high to low. In regards to your gas rate not moving, I think that just comes down to the fact that cubic meters are so much larger than cubic feet and you’re using a very tiny percentage of a cubic meter per minute (whereas when my furnace is running I’m using a big percentage of a cubic foot per minute). Might be worth using a rate per 15 minutes (or another unit like cubic feet). Not sure what would be more meaningful to you.
I noticed the style of a few suggestions and comments on this thread (mainly between @alexhyde and @brooksben11 ) which I really like as general development principles (and think contributed to productive/faster troubleshooting). Many are on the site guidelines. Probably pro developers know this stuff by heart but the rest of us might take-away a few things I reckon.
They are something roughly like:
Clear OP
Share visuals and your config
Visualise your sensor data (I like Grafana for granular Viz).
Have lots of lower level intermediate sensors during development for debugging and consolidate/internalise them once things are stable.
Strip things back to minimal for debugging.
suspect it’s hardware (especially power related or connections).
I think learning to debug ESPHOME projects is an important skill which I don’t see discussed too much at a meta level?
I have changed to the axis you have highlighted (which was the Y axis, ignore the axis names in the screenshot) and have a peculiarity, apparently I have use 17.2 m³ of gas in 1 hour, which seems impractical. I am 100% sure that there was 118 pulses in the 5 minutes, using 0.2m3.
Im not insane that theres a 0.2m3 difference between these photos?
@brooksben11 has been a great help in this project, the understandings of how this sensor works/how we calculate gas usage based on it is a bit out of my pay grade. hopefully the next person to see this thread can skip my headaches and mistakes and jump right to a working sensor
It’s a cubic unit (1000x1000x1000), so it would be a LOT more mm3 (and I also don’t think Home Assistant would know what to do with mm3 anyways). But, in looking at the picture of your meter I also see a better way to count cycles: the red dial. Looks like one full rotation is equal to 0.05m3, so I’d just count how many cycles for it to rotate once. Then convert it to the equivalent cycles for one cubic meter (1/0.05=20 so just multiply the cycles for one rotation of the dial by 20 and you’ll have how many cycles for one cubic meter of gas).
Very kind words! Absolutely more than happy to help you (or anyone else) out. It’s how we all learn; can’t count the number of times someone else’s help/post has guided me along with a project.