Entity does not have a state class anymore

Hi,

I am having a power meter which is publishing values using mqtt.
I have the following definition:

  - name: strom_server_power
    unique_id: strom_server_power
    state_topic: fhem/strom_server/power
    device_class: POWER
    unit_of_measurement: W

since some time HA tells me, that this entity does not have a state class anymore and it can not save statistics data?!
Would anyone please be so kind and tell me whats wrong?
In the past this worked like a charm…
Best regards and thanks in advance,
Otto

No, in the past it did not have a state class silently. Because you did not specify a state class, the sensor isn’t keeping long term statistics. It is for the first time telling you what was wrong already, you just were not aware. So set the state class, and you’ll lose the warning and have long term statistics from then on. Or ignore the warning, or have no long term statistics as you did before.

See:

aha. thank you! and what state class should it be in this case? i am really a little bit lost?!

state_class: measurement

is this correct?

I just added the mqtt docs to the above post, the state class description links to the options. It should be measurement in your case for power. For Energy it would likely be total or total_increasing. But you might also be ok with no long term statistics for wattages?

thank you!