State class measurement impossible?

Im getting this error

Entity sensor.alpha_read_raw_register_register_address (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using state class 'measurement' which is impossible considering device class ('enum') it is using; expected None; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22

Im thinking it relates to this code:


- state_class: "measurement"
    force_update: "true"
    icon: "mdi:information-variant"
    name: "Dispatch Normal Response Status"
    unique_id: "dispatch_normal_response_status"
    state_topic: "HomeAssistant/MQTTSensor/NORMAL_RESPONSE_responseStatus"
    value_template: "{{ value | string }}"
    device_class: "enum"

Whats the proper way to write this? Thanks!

remove this:

Thanks Tom, do I then use this?

- device_class: "enum"

Yes you can leave that.

enum = string

measurement = numeric

So one has to go. And looking at the rest of your config it seems like it returns a string.