The entity no longer has a state class

I have a Probleme with a sensor.
The entity no longer has a state class.

In the past, statistics for “outside temperature minimal” (sensor.aussen_temperature_minimal) were generated, but it no longer has a state class and therefore no long-term statistics can be created for this purpose.

Statistics are then only stored for 10 days.

I created a sensor group with min filter.
2x Temperature KlimaLoggPro 1x DS18B20.

Does anyone have any advice on what I can do that the long-term statistics work?


Do all the source sensors have a device class of temperature?

Are there any issues to fix in Developer Tools → Statistics?

Yes all sensors have device_class “temperature”

And there is no issues in Developer Tools.

entity_id:
  - sensor.temperatur_schrank_ausen_dach_ds18b20
  - sensor.temperature_7
  - sensor.temperature_8
min_entity_id: sensor.temperature_7
unit_of_measurement: °C
device_class: temperature
icon: mdi:thermometer-check
friendly_name: Außen Temperatur minimal

state_class: measurement
device_file: /sys/bus/w1/devices/28-012112f464bb/w1_slave
raw_value: 28.062
unit_of_measurement: °C
device_class: temperature
friendly_name: Temperatur Außen Dach

unit_of_measurement: °C
device_class: temperature
icon: mdi:thermometer
friendly_name: Balkon     Temperature 7


unit_of_measurement: °C
device_class: temperature
icon: mdi:thermometer
friendly_name: Außen Temperatur 8

I don’t have state class in temperature 7 and 8. Is this the problem?

Could be.

Which integration is providing those two?

Does not look like there has been any movement on this: The sensors only record 10 days of data · Issue #8 · z8i/ha_custom_klimaloggpro · GitHub

So you will likely have to add the state class manually. See: Home Assistant Core Integration - Home Assistant

EDIT: oh, there’s a fork of the integration lower down in that issue you can use.

I added the state class manually in yaml.

I think it works. Thank you.
I will test in 10 days.