Tasmota/ MQTT does not allow adjustment of the sensor data for energy tasks

Hello everyone,
I currently want to read the consumption on my smart meter using a Hichi IR WiFI reading head/tasmota. This works as well as the transmission of the data. However, I wanted to use the consumption in the energy task and have to adjust it with the energy type and the kWh setting. However, configuration for the entities is always removed. I can’t integrate this correctly in the Configuration.yaml either because no values are displayed afterwards. I also believe that there will be a problem because the current meter reading is determined and not what was consumed during the day.

So I wanted to adjust the values for the sensor:

name: "Netzbezug"
unit_of_measurement: "kWh"
state_topic: "sensor.none_tasmota_mt175_e_in"
state_class: measurement
device_class: energy
availability_topic: "tele/tasmota/SENSOR"

I haven’t done much in Home Assistant yet.
I am grateful for any help.

mqtt:

  sensor:

    - name: "Import"
      unique_id: EB1_TotEneImp
      state_topic: "tele/edpbox1/SENSOR"
      value_template: >
          {% set x = value_json.EB1.TEI|float(0) %}
          {% if x > 0 %}
            {{ x }}
          {% endif %}
      unit_of_measurement: "kWh"
      device_class: energy
      state_class: total_increasing

where can I find them? This is only given for some integrations.

This error occurs in the energy task:

statistics_not_defined

and

Check the integration or configuration that provides:

  • sensor.tasmota_mt175_e_out
  • sensor.tasmota_mt175_e_in

Currently I have adjusted it like this, is everything correct so far?

mqtt:

sensor:

- name: "Netzbezug"
  state_topic: "sensor.none_tasmota_mt175_e_in"
  
  value_template: >
      {% set x = value_json.EB1.TEI|float(0) %}
      {% if x > 0 %}
        {{ x }}
      {% endif %}
  unit_of_measurement: "kWh"
  device_class: energy
  state_class: total_increasing

Unfortunately it didn’t solve the problem, but thanks anyway