Energy Dashboard is not showing my gas consumption - something wrong, but what?

Hi all,

my counter and gas sensor are showing the gas consumption correct. It is an aqara door sensor who is counting the gas consumption on my gas meter, but I am trying since 3 days to have it on my Energy dashboard but without any success. I have waited more than 10 hours after having set up something in the Dashboard.

Can someone explain me what is wrong here?

in the first row of my configuration.yaml I have also added
homeassistant:
customize: !include customize.yaml

and more down the following

Configuration.yaml:

# Sensors
sensor:
  - platform: template
    sensors:
### Gas meter template from counter
      gas_leser:
        friendly_name: Gas Meter
        value_template: "{{ states ('counter.gasmesser') | float * 0.01}}"
        unit_of_measurement: "m³"
        icon_template: "mdi:fire"
        device_class: gas
        

Customize.yaml:

sensor.gas_leser:
  state_class: measurement
  last_reset: '2021-08-20T06:43:36.740703+00:00'

Automations.yaml

- id: '1644906284649'
  alias: Gas Counting
  description: ''
  trigger:
  - platform: state
    entity_id: binary_sensor.lumi_magnet
    from: 'off'
    to: 'on'
  condition: []
  action:
  - service: counter.increment
    target:
      entity_id: counter.gasmesser
  mode: single

It counts correct and I can chose it in the energy dashboard as Gas device:

grafik

If someone can help me, it would have be a dream for me.

Thanks,
Argo

1 Like

Change this:

To:

state_class: total_increasing

Remove this:

last_reset: '2021-08-20T06:43:36.740703+00:00'

Then restart.

1 Like

Ok, I did both, still not showing up.

Wait one or 2 hours

1 Like

Do I need to do some restarts or does it appear then automatically in the Energy Dashboard after 1-2 hours?

Whatever you change in home assistant it is always better to restart it before any conclusion

1 Like

Ok, it started now to work.

Doesnt the Energy dashboard take all the history of the sensor? Seems that it just considers the consumption after I have added it to the Energy dashboard, correct?

Nope. It starts after you add the sensor.

Ok, thanks Tom, you made my day. Does that mean: when I now delete the Dashboard and select it again, everything is lost without having the possibility to get it back in the Energy Dashboard statistics?

Delete the dashboard or sensor?

Dashboard, what happens when I delete the gas source in the dashboard?

So deleting the sensor from the dashboard, not deleting the dashboard.

I think long term stats are retained. But as you have less than a day’s worth of data it will disappear.