mmillmor / geo_home

Geo Home smart meter integration for Home Assistant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Home Assistant Energy Dashboard - Gas Consumption not showing on energy dashboard.

Dan-northwind opened this issue · comments

Hi

Thanks for your work on this, its much appreciated. I am trying to use the data to show on my energy dashboard in home assistant,
http://homeassistant:8123/config/energy

However the sensor "sensor.gas" doesn't appear as an option when I try and add it as a source.

The page points me to here:

https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics

Any ideas?

Thanks

I don't know for sure why it's not there for you - it is for me. The energy dashboard is a bit mysterious. Do you have the entity showing with the correct value on your lovelace dashboard?

Thanks for the quick reply.

So I have done some further digging if its useful for anyone else:

The gas consumption section of the energy dashboard expects the device class to be "gas" and the total consumption to be in metres3 and the unit of measurement to be in GBP/kWh rather than £/kWh

I created a couple of sensors to swap the supplied values over:

  - name: gasconsumptiontotal
    unique_id: gastotal
    unit_of_measurement: "m³"
    device_class: gas
    state_class: total_increasing
    state: "{{ states('sensor.gas') | float / 10.549 }}"

  - name: gascostperkWh
    unique_id: gascostperkWh
    unit_of_measurement: "GBP/kWh"
    device_class: gas
    state_class: total
    state: "{{ states('sensor.gas_price') }}"

That's an interesting finding. You are correct that when the device class is gas, it's measured in m³, but that shouldn't be required according to the documentation https://developers.home-assistant.io/docs/core/entity/sensor/#available-device-classes which says;

Volume of gas, statistics will be stored in m³. Gas consumption measured as energy in kWh instead of a volume should be classified as energy.

And the issue with recording it in m³ is that the conversion factor is not the same throughout the country or throughout the year. Also, on the energy dashboard page it says;

Configure gas consumption
Gas usage (Wh, kWh, MWh or GJ)

So I am wondering why you see something different. Any ideas? Do you have a particularly old version of Home Assistant, or a beta version or something like that?

You are correct re the volume, I was simply trying to see if I could get it working, I think there is a bug in HA, as I get the following message when I try and use kWh:

Unexpected unit of measurement
The following entities do not have the expected units of measurement 'Wh', 'kWh', 'MWh' or 'GJ' for an energy sensor or 'm³' or 'ft³' for a gas sensor:

So its expecting the gas sensor to be in 'm³' or 'ft³' which is less than ideal..

My HA is the latest release. I think the main 2 issues I have found has been the device_class of "gas" and the issue here with the fact that the interface is not accepting kWh for gas sensors when setting up the energy dashboard

I've reported a bug re the kWh on the dashboard
home-assistant/frontend#14397

The error message would be correct if you have changed the device class from power to gas. power and kWh are the correct values. Did you find you couldn't pick the sensor when it was at those original values? If so, that's a home assistant bug

Hi.

There is defo a bug in home assistant as i couldn't get the hilderband integration working for gas either. With this integration i have real time data from my geo meter so thanks, but i get get electric or gas in the energy dashboard.

@Trickytree1984 are you saying you can also pick electricity but not gas?

Hi.

There is defo a bug in home assistant as i couldn't get the hilderband integration working for gas either. With this integration i have real time data from my geo meter so thanks, but i get get electric or gas in the energy dashboard.

The device class needs to be gas, however the device_class of gas doesn't allow the use of kWh at the moment..

See this issue in Home Assistant:
home-assistant/frontend#14292

Well spotted. Looks like it was a regression when water was added that they are fixing soon. I'm closing this as not a bug in this integration

Sorry for the confusion, the electricity is showing up now. The sensors seem to take some time to propagate through to the energy dashboard.

I assume the correct configuration is to use sensor.electrictity in this "consumed energy" field and the "sensor.electricty_price" in the "use an entity with current price" field.

As above posters say, i cant add sensor.gas at all, which i believe is a home assistant bug

Yes, the statistics take time to show up in the energy dashbaord. And yes, that is the valid way of configuring the energy dashboard