Difficulties with MQTT sensor in combination with the Energy integration

I am having difficulties with getting values below 0 being accepted by the new Energy integration. It looks like the value is then interpreted as character and as a consequence ignored.

My sensor setup is as follows:
 - platform: mqtt
   name: "Smart_Meter_7"
   unit_of_measurement: 'kW'
   state_class: measurement
   device_class: energy
   value_template: |-
    {{ value | float }}
   state_topic: "home-assistant/smv_7/values"
   unique_id: smv7

Additionally I  added a customization to add the last_reset option:
  last_reset: '1970-01-01T00:00:00+00:00'

The sensor shows up in the Energy integration, similar sensors configured exactly the same do work because the values are > 0. I added the value_template to see if that helps (awaiting update, takes approx an hour before new values show up).

Any suggestions on how to solve/tackle this issue are welcome.

Correction, I meant values below 1, starting with 0.

1 Like

Iā€™m surprised that works correctly because the unit of measurement for an energy sensor is kWh not kW (which is power).

Sorry for the delayed response, I was away during the weekend.
You are correct, I provided the wrong information (this is the initial setup, later on I created an integration sensor that converts the value to kWh).
The energy integration seems to work correctly now although I am not sure what exactly caused it to start working, I made the mistake to change several parameters at the same time!
The problem is solved, thanks for your reaction!