MQTT discovery devices have no history?

I have a few MQTT sensors, some of them are added from yaml files and some are added with MQTT discovery.
The devices added with yaml have history, but the ones added with MQTT discovery have none.
The discovery sensors have the following flags device_class, unit_of_measurement, value_template, name, force_update and retain.

sensor.peter_train_from_work_late added manually and it has history, sensor.plant_sensor_1_moisture is added with discovery and it has no history.

So what must i do to get history on the sensors?

What do you mean “no history”. I have no problems with seeing the history of, for example, an mqtt light added by discovery.

When i click any of the auto discovery items i just get “No history found”.
What does your recorder section look like?
Here is mine

recorder:
  purge_interval: 1
  purge_keep_days: 7
  exclude:
    domains:
      - weblink
      - updater
    entities:
      - sensor.date

When i check my home-assistant_v2.db file it contains all entries so it seems there is history it just dosen’t show up.

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

thanks,
Maxime.

99% of my devices are mqtt and auto-discovered, and they all show history. So maybe you show your configuration.yaml, so we can see why you don’t have history.

As of v0.109 this is no longer a valid option.

Hello,
Thank you for your answer. I also had a bloblem with my DB. After solving this DB problem, MQTT sensor history started working.

Regards