Unable to get MQTT temp sensor into statistics graph

I have read around the forum, and i found this:

But I think I have followed the instructions fully, and I still can’t get my MQTT temp sensors into the graph. This is what one of the sensors looks like:

mqtt:
  - sensor:
    - name: "Ute"
      state_topic: "eg/HomeAssistant-temperatur/1"
      unique_id: temperatur_ute
      device_class: temperature
      state_class: measurement
      unit_of_measurement: '°C'
      value_template: "{{ value | round(1, 'half', default)}}"
      force_update: true

This is the outdoors temp, and it works just as it should in every other way, but the statistics I just can’t get working. None of the sensors are available for statistics, while the built-in temp sensors in motion detectors and thermostats are available. Does anybody have any idea what this can be?

Never mind, found it. I had Device class above State class. Having State class above fixed it. Small and dumb mistake from the original version.

It should not matter in which order state_class and device_class appear…

Maybe not. But it didn’t work before I changed that and it started working after, without anything else changed.