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

Hello!

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:

{
	"avty_t":"EMR_C69134/device/status",
	"dev":{
		"ids":["Device0"],
		"name":"Device0",
		"via_device":"EMR_C69134"
	},
	"ic":"mdi:lightning-bolt",
	"name":"Device0/Energy/Active/Positive",
	"pl_avail":"connected",
	"pl_not_avail":"disconnected",
	"stat_t":"EMR_C69134/Device0/Energy/Active/Positive/value",
	"uniq_id":"48015",
	"dev_cla":"energy",
	"frc_upd":true,
	"last_reset":"1970-01-01T00:00:00+00:00",
	"stat_cla":"measurement",
	"unit_of_meas":"kWh"
}

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.

https://developers.home-assistant.io/docs/core/entity/sensor/#entities-representing-a-total-amount