Template entity(sensor) not showing in energy consuption

Hi there
I create a new entity in the configuration file, like this:

#configuration.yaml
sensor:
  platform: template
  sensors:
      energy_solar_total:
        friendly_name: solar total energy
        unit_of_measurement: 'kWh'
        device_class: energy
        value_template: >
          {{ (states('sensor.sn_3006761873_total_yield')|float(0)) + (states('sensor.sn_3006761876_total_yield')|float(0)) }}

And the entity appears in the list with all others entity and i can see the graphics , but for some reason i cant select it in the energy consumption dashboard

Do i need to do something eles for this to work?

Thanks in advance! :smiley:

Probably because the entity needs the state_class option. However you have defined your Template Sensor using legacy format which doesn’t support state_class.

I suggest you define the Template Sensor using modern format which does support state_class.