Energy Dashboard - Allow Gas as kWh

Please add kWh gas consumption sensor to be used for long term statistics and gas consumption within the Energy dashboard not just m3.

I fully agree with the request
M3 are not energy
KWh is energy
In addition, this would low to sum both electricity and gas energies


Do you have a gas meter that reports consumption in kWh?

If not, how do you propose converting cubic meters into kiloWatt-hours?

I do have a gas meter that is in kWh so much easier for me to have that as a unit for gas consumption.

In France, the meter sends the consumption in m3 but we have contract and we are charged in €/kWh.
The parameter kWh/m3 depends upon several factors such as: gas types, gas mixture, altitude.
The French gas distributor (GRDF) has a web site from which we can find this parameter in real time from the zip code.
A good approximation can also be used with a average value ( around 1 m3 = 10 kWh)
This is what I use for calculating the €/m3 from the €/kWh

1 Like

If you’re willing to accept a fixed conversion factor of 10 then it will simplify the implementation of this Feature Request (and potentially make it more likely for a volunteer to fulfill this request).

I think that for the so called « Natural gas », 1m3 = 10 kWh should be a good starting point.
Average is 10 in the north part of France , and 11 in the other parts of France.
This should introduce an error lower than 10% that should be acceptable.
This value could be introduced as a parameter in future releases

Nevertheless, I don’t if it makes sens but Propane for exemple has a coefficient of around 26 kWh/m3

Thank you for your understanding


Hi everyone. I would like to underline that this would be a very important feature.
I maintain the Vicare integration. Viessmann only provides kWh as measurement for gas consumption.
The same seems to be true for Ovo as this issue indicates:

1 Like

Did you notice that the Vicare app gives the gas consumption in “m3” when your integration gives the exact same figure with “kWh” as unit.
In my personal case, both says 1020.
On the invoice from the gas supplier, this figure is roughly the one for m3.
As pointed out by @pbranly, to have it in kWh it should be 1020 m3 x 11,14 kWh/m3 = 11362 kWh
11,14 kWh/m3 appears on my invoice and it’s location dependant in France.

Where does the unit comes from? your integration or the Vicare API?
There is something to be fixed here.

It does not change the purpose of this feature request.
However, it shows that it would be nice to have a way to convert from m3 to kWh, similar to the one HA offers the possibility to convert from kWh to €£$ (either with a fixed rate, or an input_number entity, and so on).

Hey there. I am aware of that issue but it’s not the same for all users. Some users seem to get kWh via this value while others get m3. We are still investigating on why that is.
There’s a github issue for that btw

I have opened a similar feature request to add more energy sources like wood, water and wind turbines etc. I don’t think the energy dashboard needs to calculate the kWh from the sensor input.

In my case I’m able to and willing to do the conversion outside of the energy dashboard in a sensor.

E.g. I’m connected to the city heat grid for heating and warm tap water.
I have an FHEM installation that get the reading from a wireless MBUS water meter. I have datapoints every other second in m3.
I assume a temperature of the cold water of 10 C. I use this formula: m3 * 2.5 * (60 (C of hot water) - 10 (C of cold water). 10 m3 * 2.5 * (60-10) = 1.250 kWh (which assumes about 50 % efficiency for heater the water).
I could calculate this in fhem and send it by mqtt or I could create a template sensore and calculate it. To balance the consumtion I would also create sensor that “consumes” it and can be displayed with the other indivdual power meters.

Does the Viessmann ViCare Viessmann ViCare - Home Assistant ( work with the energy dashboard for Gas?

In UK meters measure in cubic meters but billing and tarif is done in kwh. This is for good reasons, first to align costs with electricity, and secondly the calorific value of gas is variable. There is a well established calculation to convert from one to another:

m³ * compensation for temperature and pressure * calorific value in megajoules / conversion factor

typically one cubic metre will be equivalent to:
1m³ * 1.02264 x 39.2 ÷ 3.6 = 11.14kwh
So when inputting your cost per m³ in to the energy integration in Home Assistant multiply your unit rate by 11.14 - This will be correct until the calorific value changes - which it does periodically - I have been doing this in a spreadsheet for multiple years and had the calorific value static, when my calculated billing was not matching the suppliers bill it took me a while to find that calorific value had changed.

The variability of the calorific value is a good enough reason for Home Assistant to accept kwh as a valid measurement for gas

It looks like the development branch of HA now allows Gas in kWh.

Yes it does and it is nearly working .
Existing issues are:

  • Energy coming from grid and coming from gas in kWh are not added in the Total
  • « non fossil » is only the one of grid ( so is wrong as gas is 100% fossil) and calculation should consider « non fossil »/« Total »
  • Even if you choose kWh rather than m3, fixed unit prixe stay as €/m3 while it should be €/kWh
  • Even with an unit price, gas price stays equal to 0



Following my post above, as the displayed value reflects the actual consumption in m3 (using the wrong unit, with kWh), would it make more sense for the integration to force the unit to m3?

Would that not defeat the point of requesting kWh as a unit for gas consumption?

Mine is now plotting correctly the kWh consumption but as others have said the unit price is still in M cubed and does the cost remains £0.

I think we all have the same issue
Please add your comment to that PR or make yours


not really.
Vicare is one specific case.
some others may need kWh for gas

I don’t see the link between my comment and yours

I have resolved part of the cost issue for GAS in kWh in my development environment…

And have submitted a pull request:

1 Like