Home Assistant History Not Showing
In this tutorial, you'll learn about Home Assistant History Not Showing. We cover key concepts, practical examples, and best practices.
Hook
You open the Home Assistant History panel and see no data. The graph shows a flat line for the last week. You know the sensor changed, the light was turned on, but History shows nothing. The recorder is not recording.
The Wrong Way
Deleting the entire home-assistant_v2.db database to "start fresh" loses all historical data — every temperature reading, energy consumption record, and state change is gone.
# BAD: Deleting the database
rm -f /config/home-assistant_v2.db
docker restart hass
Database deleted — starting fresh
All historical data lost
Energy dashboard shows no data for previous months
A fresh database is clean but empty.
The Right Way
Check why the recorder is not saving data.
# 1. Check the database file exists and size
ls -la /config/home-assistant_v2.db
-rw-r--r-- 1 root root 524288000 Jun 24 12:00 /config/home-assistant_v2.db
The database exists and is 500 MB — data should be there.
# 2. Check recorder configuration
cat /config/configuration.yaml | grep -A 10 "recorder:"
recorder:
db_url: !secret recorder_db_url
purge_keep_days: 10
exclude:
domains:
- sensor
The recorder is excluding all sensor domain entities — that is why history is empty.
# 3. Fix: Remove the exclusion or include specific entities
recorder:
db_url: !secret recorder_db_url
purge_keep_days: 30
include:
domains:
- sensor
- light
- binary_sensor
# 4. Check database integrity
sqlite3 /config/home-assistant_v2.db "PRAGMA integrity_check;"
ok
# 5. Restart Home Assistant
docker restart hass
Recorder started — tracking 150 entities
History panel now shows data
Prevention
- Do not exclude entire domains from the recorder unless you are sure.
- Set
purge_keep_days: 30(or more) in recorder config. - Run
PRAGMA integrity_checkmonthly for large databases. - Keep at least 1 GB free disk space for the database (500 MB per year is average).
- Use a separate MariaDB/PostgreSQL database for larger installations.
Advanced Troubleshooting
Check the Logs
Most TOOL errors are logged to stdout or a dedicated log file. Check your logs first:
# Check system logs
journalctl -u tool --since "1 hour ago"
# Or check the application log
tail -50 ~/.tool/logs/error.log
Test with a Minimal Example
Create the simplest possible tool configuration to verify the base setup works:
tool --version
tool --help
If the minimal test passes, add configuration options one at a time until you find the breaking change.
Common Configuration Mistakes
- Using the wrong file path or URL in configuration
- Forgetting to restart TOOL after changing config files
- Mixing tabs and spaces in YAML configuration files
- Setting incorrect permissions on configuration directories
When to Reinstall
If none of the above resolves the issue, consider a clean reinstall:
# Backup your configuration
cp -r ~/.tool ~/.tool.bak
# Remove and reinstall
# Follow the official TOOL installation guide
This ensures you start from a known good state and can isolate the issue.
Common Mistakes with assistant history
- Forgetting
deriving (Show, Eq)on custom data types needed for debugging - Placing the wildcard pattern first in case expressions, making all subsequent patterns unreachable
- Using
headandtailinstead of pattern matching, causing runtime errors on empty lists
These mistakes appear frequently in real-world HOME code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.
Practice Exercise
Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.
This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.
FAQ
DodaTech — history that remembers everything.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro