Issues with lower resolution long term statistics for MQTT sensors

I’m trying to make my mqtt sensors opt-in for the new long-term-statistics functionality, that lowers the resolution for older data, however without success. After reading the documentation I added the state_class option which did not help, but I have no idea what else to do. Maybe as a hint; While playing around with the “purge-keep-days” option I noticed that if I remove it the stats for these sensors get completely removed for data older than 10 days, if I set it to a longer period it stays at the same resolution. I’m not using any external database. Underneath I post the block for one of the sensors from my configuration.yaml, would be great if someone could tell me if I made a mistake or give any other hints why this is not working as expected. Thanks in advance!

- name: "Mijia Study Temperature"
  state_topic: "node-red/study/temp"
  unit_of_measurement: "°C"
  device_class: "temperature"
  state_class: "measurement"

I have exactly the same problem. Did you find a solution for this?

Not yet unfortunately… I think the issue is that the new functionality with LTS only works for everything that is integrated “natively”, so not via a manual yaml config. One path forward would be to add mqtt discovery via node red to the mqtt sensor data so the mqtt sensor is available via the mqtt integration, but that shouldn’t be necessary. Maybe this is worth a bug report?

I posted it as an issues but it was closed, maybe you feel like adding to the discussion there? At this point I’m just curious why it works for some people and not for others.