Es gibt dazu einige Grundvoraussetzungen, damit die Daten in den Langzeitdatentabellen landen, siehe zweiten Link, da ist auch erklärt welche nicht überführt werden.
Long-term Statistics
Home Assistant has support for storing sensors as long-term statistics if the entity has the right properties. To opt-in for statistics, the sensor must have state_class set to one of the valid state classes: SensorStateClass.MEASUREMENT, SensorStateClass.TOTAL or SensorStateClass.TOTAL_INCREASING. For certain device classes, the unit of the statistics is normalized to for example make it possible to plot several sensors in a single graph.
Es gibt aber auch hier im Forum schon einige Threads dazu, da würde ich einfach mal die Suche bemühen.
Das andere, was man machen kann ist den Recorder nutzen, damit sollte man aber aufpassen, blindlinks eingestellt kann das schnell zum Chaos führen.