Gas ft³ Won't Show Up in Energy Dashboard

I’ve just recently started tracking electricity and gas data and successfully setup the electric in the Energy Dashboard, however I just can’t get the gas to become selectable. I’ve read numerous other posts of similar issues but none seem to address what’s going on with mine. Here’s the relevant bit of my ESPHome YAML:

  - platform: template    
    name: "Gas Total"
    lambda: |-
      float temp = id(gas_counter_total);
      return temp/16;
    update_interval: 5s
    unit_of_measurement: 'ft³'
    state_class: 'total_increasing'
    device_class: 'gas'

And here’s a screenshot of the state of the entity within HA:

Please tell me what amateur mistake I’m making… Much appreciated in advance!

Hi Ben,

Based on your subject line, I don’t think the energy dashboard will display in ft3. My gas meter is logged in ft3, however, the ‘standard’ Energy dashboard displays it in m3… I could never find a way of easily changing this. In fact, neither ft3 or m3 are really useful to me as I get billed in kWh!! :roll_eyes:

To overcome this I created two custom dashboards, one for gas, one for electricity to provide more information than is available generically in HA. See this very short post/thread here with an explanation of what I did.

I hope that helps,

Cheers,

Mike

I don’t use ESPHome, so can’t help there, but I do use an MQTT sensor and units_of_measurement of ft³ does work in the Energy Dashboard :slight_smile: . As for state_class, device_class, its the same as what I have, so I’m not sure what’s wrong.

I finally decided to create a template sensor literally duplicating the sensor I already have coming from my ESPHome device. It immediately let me add it into the Energy Dashboard and shows up in ft³. What unit system do you have your Home Assistant setup for? Maybe that’s why it was displaying it as m³ for you. That’s an issue I’ve ran into, as I have mine setup for English units but have some specific instances I would prefer metric shown; never figured out a way to force it to do this on a case-by-case basis.

1 Like

Good to know. I ended up deleting my ESPHome device and rebooted and re-added it (and rebooted again for good measure) and it still never showed up. Creating a template sensor that’s a complete duplicate did the trick; no idea why that is…

That’s a good point, Ben which I didn’t think of. I’m in the UK so we are a sort of halfway house with both metric and Imperial measurements. I tend to work in metric i.e. Centigrade, Metres, Millimeters, grams, millilitres etc, but still in common usage are imperial units. We drive distances in miles, and we measure fuel consumption in miles per gallon, although we buy our fuel in litres!.. We still drink pints (nipping down the pub for 568 millilitres doesn’t roll off the tongue like ‘a pint’ does :beers:), people still go to the timber yard and will buy 12 metres of 2" x 8"… to a large extent we are sort of ambidextrous and have developed the ability to work in both systems. My old gas meter is a throwback to this, as newer gas meters now measure in m3, not ft3.

Cheers,

Mike.

1 Like

So I finally figured out the root cause of this issue. While reading a different post someone mentioned that they had units for a sensor that changed that was causing problems for them with the Energy Dashboard. When I had originally setup my sensor, I had the units listed as “CF” instead of “ft³”. Going to the statistics tab, it had a prompt (I assume it was always there, but I just never noticed it) letting me know I had mixed units with an easy way to correct it.

I’ve since switched my sensor back to the ‘actual’ sensor instead of the template sensor and all seems to be working well. The one bummer is I lost all of my historical data (a month or so). I know it would be possible to dive into the database and fix this but I really don’t care that much and feel like there’s an equal chance I would screw something else up in the process.

Hopefully this post helps someone else!