Template warning: 'float' got invalid input 'unknown' when rendering template

Sell, I tried to just imitate the template like

    - name: "tasmota_sml_export_total_kwh"
      unit_of_measurement: "kWh"
      device_class: energy
      state_class: total_increasing
      state: >
         {{ states('sensor.tasmota_sml_export_total_kwh') | float(0) }}
      availability: >
        {{ states('sensor.tasmota_sml_export_total_kwh') | is_number }}

But I still get the message:

Logger: homeassistant.components.energy.sensor
Source: components/energy/sensor.py:289
Integration: Energie (documentation, issues)
First occurred: 15:03:44 (1 occurrences)
Last logged: 15:03:44

Found unexpected state_class None for sensor.tasmota_sml_total_kwh

after restart. Any ideas?

Thanks a lot so far!
Peter