Long Term Statistics in graphs

I’m showing a couple of LTS sensors’ data in an Apex Charts graph, but the graph seems to be only able to pull the regular 10-day History, not the long-term stats.

Here’s the sensor’s History display (darker blue line segment is LTS data:

And here’s the Apex Charts display of the same data:

Is this a known limitation of front-end graphs? Or am I missing something?

There’s a statistics option with a number of settings.

Try this one, cannot do all that apex can but also other things and is menu-wise easier to config. cataseven/Statistics-Graph-Chart-Card: A highly customizable, smooth, and advanced graph chart card for Home Assistant dashboards. Shows historical sensor data with dynamic trend colors, statistics (min, max, avg), and more. The best graph chart card for your Home Assistant statistics

Thanks, I’ll give that a try!

Though I’m still not clear why an LTS sensors full range of data wouldn’t be available to anything querying it; shouldn’t the source of that data (LTS vs History) be invisible and provide the same results either way?

LTS stores 5-minute aggregations and is a different dataset in the HA DB. It’s by design.

You can always plot both, on the same graph.

By default Apex Graph card pulls the entity state history, but you can plot any series from the Short-Term (5minutes) or Long-Term (>hour) statistics. Here I am plotting the same entity, using the state history (blue) and the long-term statistics as hourly mean (orange). By arranging to plot the LTS first, the state overplots, so the ‘state history’ shows and you can just see the difference.

Since the Long-Term stats are collated at the end of each hour (for the hour previous) there is always the LTS available, and since in many cases, particularly if you want to plot a long period, the visible difference is so minimal that just plotting the LTS should satisfy most people.

Easy enough to do

type: custom:apexcharts-card
header:
  show: true
  title: Kitchen Temperature
  show_states: true
graph_span: 30 days
series:
  - entity: sensor.kitchen_temperature_temperature_2
    stroke_width: 1
    name: Long-Term Stats
    statistics:
      type: mean
      period: hour
      align: middle
  - entity: sensor.kitchen_temperature_temperature_2
    name: Entity State
    stroke_width: 1