Configure gas consumption - No matching statistics found

I’ve successfully configured electricity usage, but when I try to configure gas consumption I get a No matching statistics found error, even though I do have a Smart Gas Meter configured with kWh.

Images of both are below. Am I missing something stupid here?

Anybody have any ideas?

If you click on the dropdown > Why is my entity not listed? you’ll get to the documentation that you need to read.

Basically, those sensors don’t have all the parameters that HA Energy needs (sucks, I know).
Documentation will tell you to tell the Integration Developer (good luck). So, you’ll have to bridge the gap.

In my case, I have a Template Sensor in configuration.yaml:

template:
  - sensor:
      - name: "Gas - Contador m³"
        unit_of_measurement: "m³"
        device_class: gas
        state_class: total
        state: >-
          {{ states('input_number.gas_contador_zigbee') }}

You have many differences:

  1. kWh instead of m3 (so no need to convert to kWh later like me or calculate the kWh price from the last bill)
  2. You get the daily (resets daily) and the yearly (resets yearly I guess).
  3. You already get all the info (consumption, rate, today cost,…) so integrating this into the Energy dashboard will duplicate stuff and that seems (is) stupid…

But anyway, your sensor probably has to look close to this:

template:
  - sensor:
      - name: "Gas - Consumption"
        unit_of_measurement: "kWh"
        device_class: gas
        state_class: total_increasing
        state: >-
          {{ states('sensor.gas_consumption_today') }}  # grab your correct entity_id here!!. You could also use the Yearly, but that seems unnecessary if you have the daily

total_increasing because your consumption sensor resets daily (Sensor Entity | Home Assistant Developer Docs) but read that carefully to understand and maybe even compare (create 2 sensors, one with “total” instead, and wait a couple of days)

Then go to Dev Tools > refresh Template entities (no need to reboot) and wait for it to go up a bit.

It should now appear on the Energy config, Gas dropdown. When you add it, you then also select the Use an entity with current price and select the Gas Tariff Rate I guess. I don’t know what the Standing is.

That said, my Dashboard only allows me to add gas as m3 or ft3 (volume), as well as the documentation for gas, not the other units you have in the screenshots. I don’t know if you’re on an older version, beta, or it allows you to add anything until you have a “correct” one.

But try it, or re-classify it as Energy as stated 3 rows above in the documentation table.

Thank you :slight_smile: I’ll give this a go!

I got it working with these settings

# Example configuration.yaml entry
mqtt:
  sensor:
    - name: "Water Meter Consumption"
      state_topic: "metermon/19228737" # <--- change this
      value_template: "{{ value_json.Consumption }}"
      unit_of_measurement: "gal"
      device_class: "water"
      state_class: "total_increasing"
      availability:
        - topic: "metermon/status"
          payload_available: "Online"
          payload_not_available: "Offline"
      json_attributes_topic: "metermon/19228737" # <--- change this

    - name: "Electric Meter Consumption"
      state_topic: "metermon/15929976" # <--- change this
      value_template: "{{ value_json.Consumption }}"
      unit_of_measurement: "kWh"
      device_class: "energy"
      state_class: "total_increasing"
      availability:
        - topic: "metermon/status"
          payload_available: "Online"
          payload_not_available: "Offline"
      json_attributes_topic: "metermon/15929976" # <--- change this

    - name: "Gas Meter Consumption"
      state_topic: "metermon/94491948" # <--- change this
      value_template: "{{ value_json.Consumption }}"
      unit_of_measurement: "ft³"
      device_class: "gas"
      state_class: "total_increasing"
      availability:
        - topic: "metermon/status"
          payload_available: "Online"
          payload_not_available: "Offline"
      json_attributes_topic: "metermon/94491948" # <--- change this

I am also struggling with getting my Gas Meter Readings to show up in the Energy Dropdown.
I was comparing my Gas Meter Readings to my electric readings supplied by the Emporia Energy system and just discovered that the readings that show up in the dropdown are 1 Day and 1 Month readings, but the 1 Minute readings are not.

Looking at the attributes for these readings in the Developer Tool, I noticed that the 1 Day and 1 Month include an attribute Last Reset.

I am curious for those of you who have been successful in getting your gas meter readings to show up in the Energy Dashboard how you configured your readings.

UPDATE: I discovered the fix to make my gas meter show up from this thread per the moderator.

He says to click the FIX IT button on the Statistics tab under the Developer’s Tools!