These sensors will calculate the gas cost of running your furnace. At a minimum, you will need a smart thermostat, or some other way of tracking the furnace on time.
# t = furnace on time
# 88000 = BTUh rating of furnace
# p = current gas price in currency/therm, either from a scrape sensor or a fixed value.
# 0.00001 is the conversion factor for therm to BTU
sensor:
- platform: template
sensors:
furnace_gas_cost:
friendly_name: "Furnace Gas Cost"
value_template: >-
{% set t = states('sensor.furnace_on_time') | float %}
{% set p = states('sensor.current_gas_cost') | float %}
{{(0.00001 * 88000 * t * p) | round(2)}}
device_class: monetary
unit_of_measurement: USD
This functions independently of the energy monitoring integration in home assistant. If you go that route, be sure to add device_class: gas, state_class: total_increasing, and last_reset: '1970-01-01T00:00:00+00:00' The way it handles units is weird, and I’m waiting for an update before I implement that fully.
You could probably also use powercalc for that and some tricks to have it considered as gas consumption, or see with the author to add an option to the component.
I was able to get it recognized as gas consumption, however it seems like the energy monitoring integration converts usage in m^3 to ft^3, but it uses the value before the conversion to do the cost calculation. Its weird, and I’d rather have a short term cost value than trying to monkey with the integration for long term tracking (for now).
How does that work? There is no interface to the energy (gas in this case) outside of measuring it’s consumption via the gas meter. You can get close by using the input rating of the equipment, but that is rarely accurate, unless the technician did a fantastic job when commissioning the equipment. That accuracy diminishes over time. (unless completed again)
Thankfully, with single stage equipment is quite easy to do, and you only need to do it once.
Hi,
I’m sorry to revive this topic, but I need ideas to calculate gas consumption. I’ve got a smart thermostat that reads % of furnace power on over time; knowing that if the 35kW furnace would be on at max power for 1h, it will consume 130703 BTUs circa. Can somebody help me to create a template to calculate real-time calculation to solve this equation?
Thanks
Maybe https://github.com/bramstroker/homeassistant-powercalc#linear-mode is good enought, if not, I guess that the author can help or extend the integration - after all it says “PowerCalc is a custom component for Home Assistant to estimate the power consumption (as virtual meters) of lights, fans and other devices”