From 1ef144bb81d4e083c4c5b6ca15e294b106cb7023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20=C3=98strup?= Date: Sat, 8 Feb 2020 20:32:21 +0100 Subject: [PATCH 1/4] added documentation for recorder component Added db_max_retries and db_retry_wait variables to docs --- source/_integrations/recorder.markdown | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/_integrations/recorder.markdown b/source/_integrations/recorder.markdown index 793883fc4c65..563d5918a51e 100644 --- a/source/_integrations/recorder.markdown +++ b/source/_integrations/recorder.markdown @@ -8,7 +8,7 @@ ha_release: pre 0.7 ha_quality_scale: internal --- -The `recorder` integration is responsible for storing details in a database, which then are handled by the [`history` integration](/integrations/history/). +The `recorder` , which then are handled by the [`history` integration](/integrations/history/). Home Assistant uses [SQLAlchemy](https://www.sqlalchemy.org/), which is an Object Relational Mapper (ORM). This means that you can use **any** SQL backend for the recorder that is supported by SQLAlchemy, like [MySQL](https://www.mysql.com/), [MariaDB](https://mariadb.org/), [PostgreSQL](https://www.postgresql.org/), or [MS SQL Server](https://www.microsoft.com/en-us/sql-server/). @@ -31,6 +31,14 @@ recorder: description: The URL that points to your database. required: false type: string + db_max_retries: + description: The max amount of times, the recorder retries to connect to the database. + required: false + type: int + db_retry_wait: + description: The time in seconds, that the recorder sleeps when trying to connect to the database. + required: false + type: int purge_keep_days: description: Specify the number of history days to keep in recorder database after a purge. required: false From 438974c06bb8f21cb89b5124d7f4d273b833ee47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20=C3=98strup?= Date: Sat, 8 Feb 2020 20:40:02 +0100 Subject: [PATCH 2/4] added default values to vars and edited database setup section. --- source/_integrations/recorder.markdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/_integrations/recorder.markdown b/source/_integrations/recorder.markdown index 563d5918a51e..4559849682c6 100644 --- a/source/_integrations/recorder.markdown +++ b/source/_integrations/recorder.markdown @@ -34,10 +34,12 @@ recorder: db_max_retries: description: The max amount of times, the recorder retries to connect to the database. required: false + default: 10 type: int db_retry_wait: description: The time in seconds, that the recorder sleeps when trying to connect to the database. required: false + default: 3 type: int purge_keep_days: description: Specify the number of history days to keep in recorder database after a purge. @@ -188,6 +190,7 @@ If you are using the default `FULL` recovery model for MS SQL Server you will ne ### Database startup If you are running a database server instance on the same server as Home Assistant then you must ensure that this service starts before Home Assistant. For a Linux instance running Systemd (Raspberry Pi, Debian, Ubuntu and others) then you should edit the service file. +To help facilitate this, db_max_retry and db_retry_wait variables have been added to ensure the recorder retries the connection to your database enough times, for your database to start up. ```bash sudo nano /etc/systemd/system/home-assistant@homeassistant.service From d4b3c8b46dbe50d7c53a7ac7b8522aa3ef49364b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20=C3=98strup?= Date: Sun, 9 Feb 2020 01:36:16 +0100 Subject: [PATCH 3/4] readded recorder details line i mistakenly removed --- source/_integrations/recorder.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_integrations/recorder.markdown b/source/_integrations/recorder.markdown index 4559849682c6..f6f0d190dc58 100644 --- a/source/_integrations/recorder.markdown +++ b/source/_integrations/recorder.markdown @@ -8,7 +8,7 @@ ha_release: pre 0.7 ha_quality_scale: internal --- -The `recorder` , which then are handled by the [`history` integration](/integrations/history/). +The `recorder` integration is responsible for storing details in a database, which then are handled by the [`history` integration](/integrations/history/). Home Assistant uses [SQLAlchemy](https://www.sqlalchemy.org/), which is an Object Relational Mapper (ORM). This means that you can use **any** SQL backend for the recorder that is supported by SQLAlchemy, like [MySQL](https://www.mysql.com/), [MariaDB](https://mariadb.org/), [PostgreSQL](https://www.postgresql.org/), or [MS SQL Server](https://www.microsoft.com/en-us/sql-server/). From 4e926825a19c1a2b2be0051ff15971d5a16c4771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20=C3=98strup?= Date: Sun, 9 Feb 2020 01:36:43 +0100 Subject: [PATCH 4/4] changed int to integer --- source/_integrations/recorder.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/_integrations/recorder.markdown b/source/_integrations/recorder.markdown index f6f0d190dc58..f9cb8af4ec0f 100644 --- a/source/_integrations/recorder.markdown +++ b/source/_integrations/recorder.markdown @@ -35,12 +35,12 @@ recorder: description: The max amount of times, the recorder retries to connect to the database. required: false default: 10 - type: int + type: integer db_retry_wait: description: The time in seconds, that the recorder sleeps when trying to connect to the database. required: false default: 3 - type: int + type: integer purge_keep_days: description: Specify the number of history days to keep in recorder database after a purge. required: false