Can't get device to show as available in Energy configuration

I am setting up some Shelly devices to record both my Solar production and Grid usage along with returned excess Solar back to the grid. One of the entities I have setup is as follows.

  - platform: template
        friendly_name: "Grid Consumption - Total"
        unique_id: gridconsumption
        device_class: energy 
        value_template: "{{ (states('sensor.phase_1_grid_energy_returned') | float + states('sensor.phase_2_grid_energy_returned') | float) }}"
        unit_of_measurement: "kWh"

Where the above adds two separate phase values to produce the total consumed energy from the grid.

What I can’t get is to make the entity powermon_totalconsumption available as a Consumption choice in the Energy configuration of HA.

I tried adding “state_class: measurement” to the sensor template but that did not change anything.

Using Developers Tools, my Entity state looks like this.

Screen Shot 2021-10-04 at 1.34.22 PM

Any help would be appreciated.

You are using legacy templates, you can’t add state_class to those. Use the modern style of templates.
And don’t use state_class: measurement, but state_class: total_increasing.