I am trying to add the “state_class” property to an existing MQTT sensor but got the message “Property state_class is not allowed”.
However from the documentation an several examples this should be possible. Does anyone know what I am doing wrong?
The original sensor configuration looks as follows:
I am also running Home Assistant 2021.9.7 in a virtual machine (HASSOS) on my Synology.
Perhaps it has something to do with the fact that I started to use Home Assistant several years ago in a Synology Package, then merged to run in a docker and finally moved to HASSOS in a Virtual Machine.
As soon as I type “state_class” this error pops up.
What do you mean by “as soon as I type”? Are you using Visual Studio Code with the Home Assistant Config Helper and that message appears in VS Code when you enter state_class?
Because if that’s what you mean then that message has nothing to do with Home Assistant. That’s reported by the Config Helper (and it’s out of date).
Glad to hear it resolved the mystery of the error message’s source.
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions. For more information, refer to guideline 21 in the FAQ.