recorder component is storing details in a database which then are handled by the
The default database engine is SQLite which doesn’t require any configuration. The database is stored in your Home Assistant configuration directory (
.homeassistant) and called
To setup the
recorder component in your installation, add the following to your
# Example configuration.yaml entry recorder:
- purge_days (Optional): Delete events and states older than x days.
- db_url (Optional): The URL which point to your database.
# Example configuration.yaml entry recorder: purge_days: 5 db_url: sqlite:///home/user/.homeassistant/test
Not all Python bindings for the chosen database engine can be installed directly. This section contains additional details which should help you to get it working.
For MySQL you may have to install a few dependencies:
$ sudo apt-get install libmysqlclient-dev $ pip3 install mysqlclient
For PostgreSQL you may have to install a few dependencies:
$ sudo apt-get install postgresql-server-dev-X.Y $ pip3 install psycopg2