Energy Monitoring Sensor not suitable

Dear Community,
I am very happy that ha supports energy monitoring now. Thanks to everybody who contributed to this cool and useful feature.
I am trying to set up some monitoring with custom sensors. But the sensor isn’t showing up in the add consumption list.
It’s a rest sensor based on this json:
{“name”:“Daten PV-Anlage”,“consumption”:“14970.899”,“consumptionTimestamp”:“2021-10-18T20:20:30”,“state_class”:“total”,“device_class”:“energy”}
configured like this in configuration.yaml:

name: AktuellerBezug2
      - consumption
      - consumptionTimestamp
      - state_class
      - device_class
    value_template: '{{ value_json.consumption }}'
    unit_of_measurement: 'kWh'

And the entity shows up in the developer tools like this:

What am I doing wrong? In my opinion I set the state_class and units according to the guide (Sensor Entity | Home Assistant Developer Docs)

Any ideas?
Thanks a lot


value_template: '{{ value_json.consumption | float }}'

Thanks a lot for the quick reply but unfortunately it didn’t work out.
Do I need to set the state attribute?

state_class: should be total_increasing not total

Thanks, but it still doesn‘t work.

I found another post, which helped:
I had to set the state_class in the customize se ction:

      state_class: total_increasing
      state_class: total_increasing
      state_class: total_increasing