-
-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Measuring cost of gas etc. #153
Comments
yes! This has been on my list for a while. Current thinking is:
|
I did the same thing based on a SONOFF POW2 and made some experiences on a oil heating. Below variables might help you thinking it through. Of course you have no tank using gaz. but the temp of incoming gaz, changes for sure how much you use. On the output side, what I would recommend...
With those values send out by MQTT, you can do all the rest with GRAFANA On the variables side (for oil heating)
|
Hmm, okay. It's a bit different here but I will try to gather all the neccessary informations about the different gas types. Let's see if I can put this together to a working calculation - but the user must provide some information for the calculations. The ESP should provide the amount of gas used over a time period and then send it to f.i. ioBroker, where the real calculations take place - I usually use vis for visualisation, Grafana and InfluxDB for the history diagrams. |
The gaz types and similar, should be variables kept in the ESP. To have a KISS system (keep it simple and stupid), you do not want to have the logic spread over different systems. What I learned is that over time the calculation becomes more accurate. But they change whenever your heating was checked by a specialist. This allows you you to adjust the l/h@100% (or m3 gaz/hour in your case) regularily and to get very close numbers to the reality. My solution does output from the ESP every hour, freshly calculated numbers and sends them to a DB (GRAFANA). Grafana does then some magic, to calculate the price per month and Openhab then only displays the values. I hope this helps, I needed >1 year to find out those points :) |
Instead of the Energy per hour, I was thinking though it mught me easier to just store/ the amount of gas per hour instead of using calculation factors. I checked the manual for the topline compact hrc 25 and 30, and they specify the max amount of gas per hour for heating (100% burn) and for tapwater (114% burn) and there seems to be a linear relation. So when buring at 50% for an hour it should be exactly 50% m3 of the value specified as the max in the manual. It could be just a simple parameter to be stored once on the spiffs either using a set command or a settings file. Knowing this you could just integrate the actual burn power percentage over time when heating or tapwater active |
If you save values in the SPIFF then we need to add SPIFF rotation into the code. If the problem is split into chunks I would volunteer to code a part. |
@lobocobra luckily the code to store values in permanent EEPROM and rotate the sectors is already in the code (see myESP.cpp). I use this to store stack dumps when testing crashes. |
To have accurate measurements the ESP8266 needs to have an accurate date/time, maybe via ntp. I looked at the behauviour of my boiler: It usually starts ignition, the gas power goes to 46%, then down to 28% after 13 seconds and down to 23% after 10 seconds. Then up to 27% after 4 seconds. Then down to 23% again after 20 seconds. Then the selected temperature is reached and the gas burner is switched off. I would approach this with a (boiler dependent or user set) variable containing the maximum gas throughput at 100% and a counter, sampling the gas power (while the burner is on) ie. every second - multiplying the gas power (divided by 100) with the variable and add it to the counter. This way I have the gas consumption for every second and can then calculate all the following values like gas consumption last hour/1 hour/24 hours and so forth. I wouldn't need much memory, just a counter and a few variables. Because the ESP8266 is powered 24/7 I would even use the internal RAM. Counter/cost/gas consumption reset could be done via telnet and/or MQTT. |
@mediaDS NTP is in version 1.9 and it has better supporting for persisting data to EEPROM and SPIFFs. So theoretically we can implement this now. |
Hi Paul, sorry, was on holiday and then knee-deep into my own projects. Just installed your latest code - very impressive and very well done! I'll have a closer look into it later on and report back. Dieter |
Hi guys. I have just started looking at this repos in order to get some interesting data from my Bosch ZSB14-3. I'm quite new on the ESP interface, but if I'm not mistaking, this seems to be the right way in order to pull from data from the unit. My main goal is to get some gas usage reported, which was the reason why I came across this thread. Is the functionality to calculate gas usage still possible / or in development? |
I don't believe anything has happened. In theory we can store and send the amount of gas per hour with EMS-ESP as the infrastructure is there but someone needs to document the exact requirements |
Hi proddy. Thanks for your swift reply. Sounds good with the infrastructure in place. I would love to help document the exact requirement in order to achieve it. How do we do this best? What I want to be able to in the end, is to have the gas usage in m3 received (in decimal?) on frequent basis (hourly?) and viewed in Home Assistant, so I can follow the usage in Home Assistant, just like having e.g. the temperature from the Bosch ZSB14-3 showing HA, received by MQTT. |
I'm not an expert in this but the other guys on this post seem to know what they're doing. As @Bonusbartus and @mediaDS mentioned it makes sense to store the amount of gas used per hour. I think there needs to be 2 user settings to define the amount of gas used at a 100% burn for hot tap water and central heating for your specific boiler. Then when the burner is on (we detect this now) we start a counter. On the hour we calculate the consumption, do some magic, total the two numbers and send it out via MQTT. In case of a shutdown, we can persist the information in EEPROM (ESP8266 only). |
Dear @proddy |
How linear is the relationship between burner power (30-100% in my case) and gas consumption? I have a 24kW boiler so, can I assume 7.2kW at 30%, 24kW at 100% and linear in between? If I could fix the burner power at intermediate steps for a period, I could time the gas meter and work out gas consumption / power for them as well and get a more accurate relationship. But... there's no easy way to tell the boiler to fire at 70%, say, for a period. The chimney sweep function lets you fire the burner at 30% and 100% but nothing in between. The other approach would be to look at temperature rise across the boiler and flow rate (which would depend on pump speed). That would give boiler output power and you could work that back to gas input. But, that will vary with efficiency, which varies with return temperature and other things. Might have to settle for videoing the gas meter and the burner power together for 10 minutes and dumping sampled values in a spreadsheet to establish the relationship between them. Not easy! |
I'd assume efficiency decreases with more burner power because the heat exchanger surface does not grow, but has to transfer more energy over to the water. Is there something in the data sheets about that? We have a Buderus GB142. It has 15 kW. Burner power is constant at 100% when warm water is heating up at 4 in the morning. During this time, i measure about 18 kW gas consumption. Method of measurement: Reed contact attached to the gas meter. Outputs one pulse for 0,01 m3 of gas. Pulses counted over 4 minutes, times 15 to scale up to 1 hour, times 1.22 kWh per m3, according to information of our gas supplier. Also note that the amount of energy per m3 changes over time. Our supplier provides the factor each month and I used a weighted average over the last 2 years. Might be something the user has to calibrate, then, depending on the gas quality and boiler model. is it the same for oil burners? |
Dear @hamster65 |
Interesting, I am not aware of that but I'll look into the specs. Another thought: Would it be interesting to measure the condensation? It could be done by counting pulses of a sensor (e.g. tipping bucket). |
I would be happy to buy a ready-made device that connects to a gas meter and is preferably compatible with the mqtt |
There are solutions out there using esphome with a pulse sensor to pass info to HA. I want to so something with water. I have a digital water meter outside the house under the pavement. It’s read by some remote reading device using 866MHz radio which won’t be accessible to customers because frequent reading would quickly exhaust the lithium battery sealed in the meter. But... I have a water softener which meters most of the water use in the house via a turbine meter with a Hall Effect sensor. So I was thinking about passing these pulses to something to count them and forward to HA over MQTT. I know EMS-ESP has a spare analogue input and maybe there’s a digital one too? Maybe there’s an option to count pulses and send a raw count on to HA in the MQTT payload? Conversion factors could be applied in HA and consumption displayed. |
some link to tindie ? |
https://www.rogerfrost.com/an-electricity-usage-monitor-with-home-assistant/ This has some ideas. You might need a different sensor if your gas meter doesn’t have a flashing LED. Some of them have a pulse contact output but I don’t know if this accessible. |
Hi, @glitter-ball about measuring water look at this https://github.com/weetmuts/wmbusmeters |
meyby is better to use an unused input and connect some sensor to a gas meter ? |
I'm using a P1 sensor to read my gas directly from the meter. I'll try and figure a way out to tally those usage numbers against what I'm capturing from the boiler. |
Hi proddy,
one topic of your wishlist is:
Do you already have ideas on how to do this? I'm planning on programming something in this direction - we already have:
We also have the specification of the gas type in terms of efficiency (we have different types of gas here in Germany with different efficiency) which we can find on the monthly or annual bill. Would be nice if we could throw some ideas together.
have fun,
Dieter
The text was updated successfully, but these errors were encountered: