'last_reset' is missing even though it's provided in config


I have a device that sends auto discovery messages to a MQTT broker. I want it to create an entity that can be used by the energy dashboard. The configuration looks like the following:


The entity is created and the value is correctly retrieved. So far so good! But when I try to add it to the energy dashboard, I get the following error:

The following entities have state class ‘measurement’ but ‘last_reset’ is missing

The energy is not working because of this. But 'last_reset* is clearly there if you look at the config. Any ideas why this might be happening?

State class measurement does not use last_reset. Only state classes total or total_increasing do.

How to choose state_class and last_reset

It’s recommended to use state class total without last_reset whenever possible, state class total_increasing or total with last_reset should only be used when state class total without last_reset does not work for the sensor.