I’m trying to figure out the exact same thing using an mqtt based meter reading. Also, assuming we can get these sensors to show up as options, which is best to use, the daily, monthly, current reading?
But as a sensor entity its is visual with values in the graphic, but not any more as value:
What do I mis or must do to get the sensor working in Energy?
And why is the value unknown but the grapic shows values?
===========================
After several hours, put a backup back and now it’s working strainge
Here is a config that works for me (Note: multiply(1) can be ignored):
- platform: mqtt
unique_id: "15066054" #rng 1-100M
name: Gas Meter
icon: mdi:gauge
state_topic: "gasmeter/outside/value"
unit_of_measurement: 'ft³' #Actual is ccf, but ccf not available in HA.
device_class: 'gas'
state_class: 'total_increasing' #value monotonically increasing
value_template: " {{ ( value | multiply(1)) | round (2) }}"
You want to include a value in an energy panel. Energy is given in kWh, but m³ is a volume. You even pay for kWh, not for m³. Unfortunately the m³/kWh ratio changes depending on the delivered natural gas, but roughly calculated you get 10 kWh from 1 m³.
For me it was a factor of 10.909971 in January 2021, 10.931289 from February to September and 10.954545 from September to December.