Energy Dashboard gas usage

Hi,

My energy dashboard is running well :slight_smile: (p1monitor)
we have also a Nefit Easy boiler. also in Home Assistant. i got there a gas year total usage.

I want it also in the energy dashboard as an gas-spent device. just like an Eneergy-spent device.

How can I do that? :slight_smile:

you have more gas consumers in your home?

Yes,

The Nefit boiler and the kitchen stove

I finally managed to add my furnace gas usage to energy dashboard so here it is, in case someone need it.
I have Buderus logano furnace with Logamatic 2107 control. I bought control module and installed it in my furnace. It’s very easy to do so.
I have a bunch of sensor from my furnace and I wanted to add gas consumption to ha energy dashboard.

In configuration.yaml I have

sensor: !include sensors.yaml
template: !include template.yaml

First step was to calculate running time of furnace. It is doable because esp firmware exposes binary sensor that is on every time burner is on. So I need a sensor that will calculate burning time for a day. So in my sensors.yaml file I added

- platform: history_stats
  name: Buderus On Time Today
  entity_id: binary_sensor.buderus_kessel_betrieb_1_stufe
  state: "on"
  type: time
  start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
  end: '{{ now() }}'

When I was able to measure how long furnace was on in a day it was easy to calculate how much gas furnace is using for one minute of burner running. Maybe for more precise measurement I should add temperature, but in my observation max temperature is mostly somewhere between 80 and 90 degrees and it seems to me that this is just using amount of gas it can burn. There is no multiple stages of burner.

So in template.yaml I wrote this:

 - sensor:
  - name: "Buderus daily gas usage"
    unique_id: furnace_gas
    device_class: gas
    unit_of_measurement: "m³"
    state: "{{ (states('sensor.buderus_on_time_today') | float * 0.0957 * 60) | round(2) }}"
    state_class: total_increasing

After restart I was able to add my new sensor to energy dashboard under gas consumption and now I’m waiting for my first gas data. :smiley:
Hope will help someone.

Edit:
And there it is
Screenshot from 2023-06-14 20-15-55

I know I’m bragging but I’m so proud on this one.

1 Like

Hello. Newbie here, so bear with me, please. I have made a very similar setup for monitoring gas consumption based on gas boiler running time, and it works as expected. But, please help me with some calculations.
I have used your formula here:

So, after timing my boiler, I have 2.1 impulses for every minute the boiler is burning. I know that the meter calculates 0.01 m3 of gas for every impulse, so by multiplying I got 0.021 cm3 of gas/minute with boiler on full burn. Your formula states that I should multiply time x gas/min x 60, and that’s where I think I don’t get it. I believe that “60” in your formula is time/1 minute, but that just throws my calculations away. By not using *60, again my calculations are way off. Can you please lend a hand? :smiley:

I have only one burner on furnace. There is no two stage of multistage burner. This works for me. I had to adjust a bit formula for precise calculation but it does calculate gas consumption with great accuracy.
If you have two stage burner this probably will not work for you.

I also have single stage burner, that’s why I applied your solution

How off is your calculation? My solution will not be 100 % precise as i use gas for cooking. But it will give me 90% or more accuracy. And I’m pleased with that.
Maybe the problem is in running time. If you miscalculated running time gas calculation will be off.
I use this for calculating burner running time.

### Buderus running time daily
- platform: history_stats
  name: Buderus On Time Today
  entity_id: binary_sensor.buderus_kessel_betrieb_1_stufe_2
  state: "on"
  type: time
  start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
  end: '{{ now() }}'

And then i applied formula on running time to calculate gas usage.

Edit:

I just check my real gas consumption vs. calculated consumption.
Real gas consumption is 216 and calculated is 208.3 m3. So it has a bit offset but it can be adjusted using formula.

I only use gas for heating radiators + water. The running time works flawlessly, as I use the time sensor for other calculations.
My problem I think is here:

template:

  • sensor:
    • name: “daily gas usage”
      unique_id: furnace_gas
      device_class: gas
      unit_of_measurement: “m³”
      state: “{{ (states(‘sensor.heat_water_time_24h’) | float * 0.021 * 60) | round(2) }}”
      state_class: total_increasing

I just use one sensor to calculate gas consumption. I don’t divide it between hot water and radiators. Probably this is possible but it will be too much work gaining basically nothing.
I just use this in template.yaml

### Buderus gas usage calculation
- sensor:
  - name: "Buderus daily gas usage"
    unique_id: furnace_gas
    device_class: gas
    unit_of_measurement: "m³"
    state: "{{ (states('sensor.buderus_on_time_today') | float * 0.065 * 60) | round(2) }}"
    state_class: total_increasing

Ok, thanks for the clarifications. After fiddling with the gas meter and re timing it, I got real results on calculations. I will keep an eye on real usage, but so far so good. Thank you!!