Researched from current Home Assistant documentation on October 23, 2026. The configurations and temperature calculation below are worked examples, not measurements from a Tara installation or a live Home Assistant test. The cover is an illustrative generated scene.
1. Choose the graph for the question
To choose between Home Assistant’s History graph and Statistics graph, start with the question you want the picture to answer. “Did the room cool after the window opened?” needs recent readings and an open/closed timeline. “How warm did this room get each day?” needs daily summaries. Use History graph for the first and Statistics graph for the second.
Both are built into Home Assistant. You do not need a custom dashboard download or a Statistics helper just to draw these charts. A card is a panel on your dashboard; an entity is one named reading or control, such as sensor.living_room_temperature.
The distinction is not simply short history versus long history. The History graph documentation says older sections can be filled with hourly statistics when detailed readings are no longer retained. Statistics graph lets you choose the summary and time interval explicitly.
Scroll sideways on a narrow screen.
| Your question | Start with | What it tells you |
|---|---|---|
| When did the temperature change today? | History graph, 24 hours | The recorded readings while detailed history remains available. |
| Was the window open at the same time? | Add its contact sensor to History graph | An open/closed timeline alongside the temperature chart. Timing alone does not prove the cause. |
| Which days had the largest temperature swings? | Statistics graph, 30 days, daily minimum/maximum/mean | Each day’s low, high and average, where saved statistics exist. |
| How long was a device on today? | A History Stats helper | A duration calculation; a timeline alone is not a daily runtime total. |
For that last question, follow the separate daily runtime walkthrough. The official History graph design guide explains the distinction between numeric lines and state timelines.
2. Check one room before adding cards
- Choose an existing temperature sensor. Open its details and copy its entity ID. You need a working numeric reading with a temperature unit, such as °C or °F. If you have a window contact sensor, copy that ID too.
- Open History and select the temperature entity. Choose a recent range with data. Confirm you are looking at the intended room. Current versions offer Sources → Add target; older versions may label the selector differently.
- Check the sensor’s classification. In Settings → Tools → States, inspect its attributes without changing them. Older versions call this area Developer tools. An ordinary room-temperature sensor should have
state_class: measurement. A name beginning withsensor.is not sufficient by itself. - Check Statistics for reported issues. The current path is Settings → Tools → Statistics. A numeric sensor must also be included in Recorder, Home Assistant’s history storage. A recorder exclusion can prevent new statistics even when the live reading looks fine.
The statistics requirements cover recording and numeric states. The sensor state-class reference defines a measurement. Keep the existing temperature unit; do not change classifications or units merely to make a picker accept the entity.
3. Add two cards for the same temperature
Use a dashboard you already edit, or a separate dashboard for this trial, with an account allowed to edit it. Open Edit dashboard → Add card. Choose the card type, then its code editor to enter the example. These are card configurations, not entries for configuration.yaml. The card instructions describe the different Add card locations for Sections and other layouts. If an automatically managed dashboard asks you to take control, use a separate editable dashboard if you want to preserve its automatic updates.
A recent “what happened?” view
Choose History graph. Replace both entity IDs with yours. If you have no window sensor, remove its two-line entry.
The code examples scroll sideways on a narrow screen.
type: history-graph
title: Living room — last 24 hours
hours_to_show: 24
entities:
- entity: sensor.living_room_temperature
name: Room temperature
- entity: binary_sensor.living_room_window
name: Window
Expect a temperature line and a separate window-state timeline. They are different kinds of information, not two numbers on one scale. The source devices decide how often readings arrive; this card cannot reveal a temperature change between unrecorded samples.
A monthly “how did the room behave?” view
Add a Statistics graph using the same temperature entity. The example requests one daily set of summaries across the last 30 days:
type: statistics-graph
title: Living room — daily temperature range
days_to_show: 30
period: day
chart_type: line
stat_types:
- min
- max
- mean
entities:
- entity: sensor.living_room_temperature
name: Room temperature
min means the lowest recorded value, max the highest, and mean the average. The Statistics graph reference documents these options. A wider gap between low and high means a bigger recorded swing. Today’s values describe a day still in progress, so compare completed days when judging a change to the room.
If the sensor has only existed for three days, a 30-day card will not invent the other 27. For a newly eligible sensor, allow statistics to accumulate through completed reporting intervals before expecting a useful daily view.
4. Understand why the lines differ
Consider this hypothetical recorded hour, with no missing readings: the temperature stays at 20°C for 50 minutes, then stays at 24°C for 10 minutes. Home Assistant’s measurement average is weighted by duration. It is not the simple average of the two numbers.
Hourly mean = (20 × 50 + 24 × 10) ÷ 60 = 20.67°C.
The recorded minimum is 20°C and the maximum is 24°C.
This is a calculation, not a measured room test. Scroll sideways on a narrow screen.
| View of that hour | What to expect | What you can conclude |
|---|---|---|
| Recent detailed History | The saved change from 20°C to 24°C | The timing of the change is available. |
Statistics graph with period: hour and mean | About 20.67°C | The room’s average was modest, even though it briefly reached 24°C. |
| Hourly minimum and maximum | 20°C and 24°C | The peak remains visible, but these summaries do not give its precise start time. |
| Older History after detailed data expires | An hourly summary can replace the detailed line | You cannot recover the original minute-by-minute sequence from that average. |
The measurement statistics documentation explains the time weighting. The History data-source explanation describes the older hourly averages and the darker line used for recent detail. A calmer-looking line is not evidence that the sensor became more accurate.
The monthly card above uses period: day, so it combines more than this single hour. Temporarily set it to hour if you want to inspect one completed hour. Do not compare a daily average directly with one instantaneous reading and call the difference an error.
5. Verify the cards without changing the house
- Wait for ordinary readings. Leave heating, windows and existing routines alone. Do not overwrite a real sensor’s state to make a test point.
- Compare the recent card with History. Select the same entity and time window in the History panel. A recorded temperature change should appear in both. A window timeline should agree with its recorded state changes.
- Inspect a completed hour. Temporarily use
period: houron the Statistics graph. Its mean should fall between its minimum and maximum. Compare with the detailed record, not just the current value. - Restore the monthly view. Set
period: dayagain. Keep minimum and maximum visible if brief warm or cold periods matter. Remove either trial card to undo the dashboard change.
This verifies the display against recorded data; it does not calibrate the physical sensor. Check gaps before interpreting an average: a day with missing readings is not a complete record of the room. A chart also cannot prove that an unchanged value is fresh. If you need the underlying data for closer inspection, History offers Menu → Download data. An export of an older summarized period still cannot restore discarded detailed readings.
If a graph is blank or surprising
Scroll sideways on a narrow screen.
| Observation | Check first | Next step |
|---|---|---|
| History works, but the temperature is absent from Statistics graph | Numeric state, measurement state class, Recorder inclusion and Statistics issues. | For a sensor you created, correct its definition in the source integration or helper options. For a device-provided sensor, consult that integration’s documentation. A temporary States-panel edit is not a lasting configuration fix. |
| A switch or window cannot be selected for statistics | It is an on/off entity, not a numeric measurement sensor. | Use its History timeline. Use History Stats separately if you need a duration. |
| Older History looks smoother or lighter | The date range and your detailed-history retention. | Expect hourly summaries where available. Use minimum and maximum statistics to inspect recorded extremes. |
| A new card has little or no older data | When recording and eligible statistics actually began. | Keep collecting. Selecting a longer range does not create missing history. |
| Statistics stopped after a sensor change | Reported unit or state-class issues in Statistics. | Resolve the source metadata with its documentation. Do not delete history as the first troubleshooting step. |
By default, Recorder retains detailed history for 10 days. Increasing retention affects storage across recorded entities; it is not a setting on one chart. For an actual storage problem, use our Recorder database guide as a separate maintenance task.
Common questions
Do I need a Statistics helper first?
No. The Statistics graph card reads saved statistics for eligible sensors. The separate Statistics helper creates a new calculated sensor from a buffer of recent values. Its sample capacity and age settings matter; seeing an older chart does not mean that helper has the same underlying samples.
Will the average change my heating automation?
No. Selecting a graph’s mean changes what the card displays. It does not replace the entity used by a routine. If you deliberately want a different input, our sensor filtering guide explains the added lag and why the original reading should remain available.
Should I install a custom chart?
Start with these native cards. Consider a custom chart only when you can name the missing feature, such as a particular comparison layout. A different chart cannot supply measurements that Home Assistant never received or retained.
For a household setup that includes understandable dashboards and documented controls, see Tara’s configured Home Assistant setup.
