Can not select gas meter in energy dashboard

Hi,

i have a value which gives me the current kwh of my gas meter (e.g. 4998.741288)
This value is stored in a system variable on homematic ccu2.

my yaml entry looks like this

> - platform: template
>     sensors:
>       gas_in_kwh:
>         value_template: "{{ states.homematic.ccu2.attributes.Gaszaehler_kwh }}"
>         unit_of_measurement: kwh
>         device_class: energy
>         attribute_templates:
>           state_class: total_increasing

Im able to see the current value in the section “developer tools → states” (Entwicklerwerkzeuge → Zustände) - see screenshot
Bildschirmfoto 2022-12-30 um 07.52.56

But i can not select the value in energy dashboard.
I have read the article about statistics but can’t find my fault.

Would be great if someone can give me a tip for a solution on this.

Many thanks in advance

Look at this post:

Many thanks, i changed the values of unit_of_measurement and device_class. now gas meter appears in energy dashboard.

  • platform: template
    sensors:
    gas_in_m3:
    value_template: “{{ states.homematic.ccu2.attributes.Gaszaehler }}”
    unit_of_measurement: ‘
    device_class: ‘gas
    attribute_templates:
    state_class: ‘total_increasing’