Sensors not showing in statistics diagram card

Hi! Some of my temp sensors are not showing anymore in my statistics diagram card? Probably related to a recent update?

If I click the sensor directly, it shows current values and complete history. So I think there is nothing wrong with the sensor. The problem seems to be in the statistics diagram card?

Working here.

Do those sensors have the attribute, state_class: measurement?

If not then LTS will not be collected for them.

Hi! Actually the two sensors that are causing problems are “Shelly H&T” sensors. My other temp sensors are ESPhome and they work fine.

Where can i see the state class?

Right hand column of Developer Tools → States.

Or at the bottom of the sensor more info pop up.

Thanks! It looks like this here (these 2 sensors dont show up in the diagrams):

That is because none of them have state_class: measurement.

Which integration is supplying these sensors?

Thanks!

Both have been added through the Shelly integration. It used to work until recently.

Can i manually add this state class?

You can but it would be better if the integration was updated to support this.

There was an issue open about it but it was let go stale and was closed:

Until this is fixed you can add state_class: measurement to the sensors using customize:

e.g. configuration.yaml

homeassistant:
  name: Home
  unit_system: metric
  # etc

  customize:
    sensor.h_t_keller_humidity:
      state_class: measurement
    sensor.h_t_keller_temperature:
      state_class: measurement

Fantastic help here, many thanks @tom_l

Problem is fixed