Skip to content

Gas consumed

peno64 edited this page Jan 13, 2023 · 8 revisions

In the yaml config file there are 2 possible configurations for gas: gas_delivered and gas_delivered_be

They are both in the default configuration. gas_delivered_be must be used in belgium to display the gas consumed value. In all other countries gas_delivered returns the gas consumed value. This is because Belgium meters return the gas information a bit differently. So one of the two will always be empty or NA (not available).

Some people also report that non of the two values give a result. This can happen because the gas meter is returning its information on another bus. By default this is bus 1. Possible values are 1-4 and this can be defined in the yaml file via the setting gas_mbus_id. See also

In the yaml configuration file the following must be set:

dsmr:
   gas_mbus_id: 2

In above example bus 2 is used.

Note, for Belgium, when I tried this that I got the water consumption value when using bus 2. This because the water meter is on bus 2 in my installation.

My meter returns the gas consumption in m³. However energy is measured in kWh and also the cost of gas is calculated on the energy value of your gas.

In home assistant the energy tab also shows energy consumption in kWh.

To return the gas usage also in kWh I added the following in the yaml configuration file:

sensor:
  - platform: template
    name: "Gas Consumed in kWh"
    unit_of_measurement: "kWh"
    accuracy_decimals: 3
    state_class: total_increasing
    device_class: "energy"
#    The conversion factor from m3 to kWh depends on many factors.
#    Check your (year) bill. It should show the usage in m3 and then also in kWh. Divide the two and you should get the factor which will be a year average value.
    lambda: |-
      return id(gas_delivered_belgium).state * 11.78;

As the comment says, the factor 11.78 can vary.