In the graphic representing my homes energy usage, it shows the energy used from Gas in KWh, but doesn’t include this in the total energy used by my home. Gas usage is being recorded and showing in the charts and cost calculation.
Is this a bug in the Energy dashboard, or deliberate - in which case what is the thinking?
Hi
Yes this is a bug that the developper does not consider as an urgent matter to fix.
The more we will ask for a fix, the more we will have a chance to have this fix
Thank you for your mail
Regards
Philippe
I created a template sensor that converts the m³ provided by my device to kWh by multiplying the m3 value by 11.36267.
The full equation is:
(Gas consumption in m³ * Calorific value of gas (typically 40 MJ/m³) * 1.02264 for correcting for expansion and pressure) / 3.6. This is specified by UK regulations.
Use device_class: energy and state_class: total_increasing so that HA will allow selection of the entity in the energy dashboard.
Thanks! So it is not yet there by default (wanted to make sure I didn’t miss it).
Just for others in case they came across this, the multiplier is not a fixed value; one can find it in the utility bills, where m3 is converted to kWh (or simply ask their energy provider).
(In Germany for example, the number is different if one is using natural gas or LPG…)
- name: 'Total Gas Used kWh'
state: "{{ state_attr('sensor.geo_energy_usage_total','totalConsumptionList') | selectattr('commodityType', 'equalto', 'GAS_ENERGY') | map(attribute='totalConsumption') | first/1000*11.36267 | round(2) if is_state('sensor.geo_energy_usage_total','guid') else 'unknown' }}"
unit_of_measurement: "kWh"
device_class: energy
state_class: total
Note that this is quite specific to the sensor I was using which was sensor.geo_energy_usage_total and had the data stored in an array attribute. However you get the m3 value you need to use /1000*11.36267 | round(2) to convert it to kWh and round it to 2 decimal places.
Does this fix the original issue with the gas consumption not being added to the total house consumption? I have the same issue as the original poster and even though I have the gas consumption showing in kWh (I get that directly from a Glowmarkt Glow CAD) it’s still not added to the total house usage.
Good question
This is as well my request to get the total
But always refused for obscure reasons
The more we are to ask the best chances we’ll have to win !
Phil
I’ll join in. For me, gas consumption is also not added to the total household energy consumption.
This is highly confusing and actually just plain wrong.
It really depends how you are getting your m³ value. I get mine from Geo Together, which presents it as part of an array.
My template sensor looks like this:
- unique_id: geo_gas_usage_total_kwh
name: 'Total Gas Used kWh'
state: "{{ state_attr('sensor.geo_energy_usage_total','totalConsumptionList') | selectattr('commodityType', 'equalto', 'GAS_ENERGY') | map(attribute='totalConsumption') | first/1000*11.36267 | round(2) if is_state('sensor.geo_energy_usage_total',my_unique_id) else 'unknown' }}"
unit_of_measurement: "kWh"
device_class: energy
state_class: total
In the state line you can see the equation for converting to kWh, amongst a lot of Jinja templating code.
Unless you are also using Geotogether to get data from your smart meter, your code would likely look somewhat different as it really depends on how your device presents data. Each section of that line separated by a pipe (|) takes data from the left and applies a transformation to it and then passes it to the right, until you get the data in the format you want. Steep learning curve, for me at least.
And if you are using Geotogether I recommend using the Geo integration from HACS which is way easier. I had forgotten I still had those template sensors in my config till just now.
Hi I already had a lot of discussions with HA development team about that topic.
They just don’t want !
So the more we are to ask, the more chances we will get it
Thanks for your GitHub issue
Phil