mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-05-30 06:46:49 +00:00
1.8 KiB
1.8 KiB
layout, title, description, date, sidebar, comments, sharing, footer, logo, ha_category, ha_release
layout | title | description | date | sidebar | comments | sharing | footer | logo | ha_category | ha_release |
---|---|---|---|---|---|---|---|---|---|---|
page | Recorder | Instructions how to configure the data recorder for Home Assistant. | 2016-05-21 09:00 | true | false | true | true | home-assistant.png | History | pre 0.7 |
The recorder
component is storing details in a database which then are handled by the history
component.
Home Assistant uses SQLAlchemy as Object Relational Mapper (ORM). This means that you can now use any SQL backend for the recorder that is supported by SQLAlchemy, like MySQL, MariaDB, or PostgreSQL.
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 home-assistant.db
.
To setup the `recorder` component in your installation, add the following to your `configuration.yaml` file:
```yaml
# Example configuration.yaml entry
recorder:
purge_days: 14
Configuration variables:
- purge_days (Optional): Delete events and states older than x days.
- db_url (Optional): The URL which point to your database.
Database engine | db_url |
---|---|
SQLite | sqlite:///PATH/TO/DB_NAME |
MySQL | mysql://SERVER_IP/DB_NAME |
MySQL | mysql://user:password@SERVER_IP/DB_NAME |
PostgreSQL | postgresql://SERVER_IP/DB_NAME |
PostgreSQL | postgresql://scott:tiger@SERVER_IP/DB_NAME |