I am trying to use the energy integration to show how much gas my furnace is using as well as the cost.
I am using a scraper to get the current price in $/therm, and then a template sensor to convert that to $/m³.
I then have another template sensor that calculates gas usage based on the total runtime of my furnace and its capacity. This sensor’s units are m³. I had to add customization in order for the Energy integration to recognize it as a gas consumption source.
homeassistant:
customize:
sensor.gas_usage_cubic_meters:
state_class: total_increasing
meter_period: daily
icon: hass:counter
sensor:
- platform: template
sensors:
gas_price_cubic_meters:
friendly_name: "Gas Price (m^3)"
value_template: >-
{% set p = states('sensor.current_gas_cost') | float %}
{{p / 2.83168}}
unit_of_measurement: "$/m³"
gas_usage_cubic_meters:
friendly_name: "Gas Usage (m^3)"
device_class: gas
value_template: >-
{% set t = states('sensor.furnace_on_time') | float %}
{{t * 2.038788}}
unit_of_measurement: "m³"
When looking at the actual values of these sensors, they appear to be correct. My issues are with the Energy tab. I configured the energy integration to show these values, however it doesn’t seem to be treating the gas sources as a total_increasing
value. In fact, the energy tab is displaying numbers that don’t make any sense.
You can see that I have only used 16.04 m³ of gas, but the integration shows it at over 600 m³. Even if that were correct, the cost of that 600 m³ should be around $130, not $9.84.
I’m not sure what is going on here, I’ve tried everything from just about every forum post on this topic including using the utility_meter
integration (that made things worse) and I’m stuck. Hopefully I can get some insight into this behavior.
I’m honestly offended that the gas consumption graph is giving me the bird.