State_class: total_increasing not working

Hi there,
my energy config say “Last reset missing, beacuse of state_class measurement” Well this is due to that the sensor is created by MQTT. Can I configure MQTT to set state_class?
So I did write a customie part in configuration.yaml, but I can’t verify that it’s read up when HA starts. Nothing happens to the sensors config and the energy chart is still complaining.

homeassistant:
customize:
# Add an entry for each entity that you want to overwrite.
sensor.p1_p1_energy_active_positive:
state_class: total_increasing

I thought this should do the trick.

here is the sensor
image

Running core 2025,4,1

Regards Marten