Shelly EM and Energy configuration wrong data, again

This has been brought up in the past but I can’t seem to solve the issue.
In installed a Shelly EM, configured it with mqtt and it shows correctly in home assistant.

- platform: mqtt
  name: "Shelly EM consumo casa"
  state_topic: "shellies/shellyem-485519C9ACC8/emeter/0/total"
  device_class: energy
  state_class: total_increasing
  unit_of_measurement: "kWh"
  value_template: "{{ value|float / 1000 }}"

I the setup Energy configuration to use this sensor:

The sensor is returning the correct data:

But the Energy page is completely wrong:

Any help?