Yesterday I configured my gas energy dashboard to track my gas usage. The cost that is calculated by HA does not match what I am expecting. I suspect a configuration issue, but have not been able to identify it.
Sensor configurations that are used by the gas energy dashboard.
mqtt:
sensor:
- name: "Gas Meter Reading"
state_topic: "metermon/999999"
value_template: "{{ value_json.Consumption | float * 0.028316846592 }}" # convert ft³ to m³
unit_of_measurement: "m³"
state_class: "total_increasing"
device_class: gas
- sensor:
- name: "Columbia Gas PTC"
state: "{{ 0.33169 }}"
unit_of_measurement: "USD/therm"
device_class: monetary
- name: "Columbia Gas PTC"
The cost that HA is calculating for 4.02 m³ of usage is $1.31 but I believe it should be ~$0.47.
Constants used in calculations
1 ft³ = 0.01 therm
1 ft³ = 0.028316846592 m³
1 therm = $0.33169
HA reporting
Usage: 4.02 m³
Cost: $1.31
Convert usage back to ft³
4.02 m³ / 0.028316846592 = 141.96 ft³
Convert usage to therm
141.96 ft³ * ( 0.1 therm / 1 ft³ ) = 1.4196 therm
Calculate Cost
1.4196 therm * ( 0.33169 USD/therm ) = $0.47 # HA is reporting $1.31