From 126ce10bace535d6633a22e5debc3c0e3773340f Mon Sep 17 00:00:00 2001 From: milanvo Date: Thu, 21 Sep 2017 13:35:42 +0000 Subject: [PATCH 1/3] Doc for recorder purge service --- source/_components/recorder.markdown | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/_components/recorder.markdown b/source/_components/recorder.markdown index ddf835cff50..fcfe7314c15 100644 --- a/source/_components/recorder.markdown +++ b/source/_components/recorder.markdown @@ -28,6 +28,7 @@ recorder: Configuration variables: - **purge_days** (*Optional*): Delete events and states older than x days. The purge task runs every 2 days, starting from when Home Assistant is started if you restart your instance more frequently than the purge will never take place. +- **purge_disable_timer** (*Optional*): Disable default purge timer (every 2 days). Default: False. You can then start purge task by [service](#service) call. - **exclude** (*Optional*): Configure which components should be excluded from recordings. - **entities** (*Optional*): The list of entity ids to be excluded from recordings. - **domains** (*Optional*): The list of domains to be excluded from recordings. @@ -85,6 +86,17 @@ recorder: If you only want to hide events from e.g. your history, take a look at the [`history` component](/components/history/). Same goes for logbook. But if you have privacy concerns about certain events or neither want them in history or logbook, you should use the `exclude`/`include` options of the `recorder` component, that they aren't even in your database. That way you can save storage and keep the database small by excluding certain often-logged events (like `sensor.last_boot`). +### {% linkable_title Service `purge` %} + +Call the service `recorder.purge` to start purge task, which deletes events and states older than x days, according to `purge_days` variable setting. + +Automation [action](https://home-assistant.io/getting-started/automation-action/) example: + +```yaml +action: + service: recorder.purge +``` + ## Custom database engines | Database engine | `db_url` | From ad1e0b0b850f88837635faed8520195050881f10 Mon Sep 17 00:00:00 2001 From: milanvo Date: Sun, 24 Sep 2017 11:06:03 +0200 Subject: [PATCH 2/3] Doc update for recoder purge service --- source/_components/recorder.markdown | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/_components/recorder.markdown b/source/_components/recorder.markdown index fcfe7314c15..ce196ae2e11 100644 --- a/source/_components/recorder.markdown +++ b/source/_components/recorder.markdown @@ -2,7 +2,7 @@ layout: page title: "Recorder" description: "Instructions how to configure the data recorder for Home Assistant." -date: 2016-05-21 09:00 +date: 2017-09-24 09:00 sidebar: true comments: false sharing: true @@ -27,8 +27,7 @@ recorder: Configuration variables: -- **purge_days** (*Optional*): Delete events and states older than x days. The purge task runs every 2 days, starting from when Home Assistant is started if you restart your instance more frequently than the purge will never take place. -- **purge_disable_timer** (*Optional*): Disable default purge timer (every 2 days). Default: False. You can then start purge task by [service](#service) call. +- **purge_days** (*Optional*): Enables purge of events and states older than x days by [service](#service) call `recorder.purge`. Purge task is not scheduled by `recorder` component anymore. (post release 0.55) - **exclude** (*Optional*): Configure which components should be excluded from recordings. - **entities** (*Optional*): The list of entity ids to be excluded from recordings. - **domains** (*Optional*): The list of domains to be excluded from recordings. From 1ce3bef153ab180cddac27b349fb959feebe4c0f Mon Sep 17 00:00:00 2001 From: milanvo Date: Wed, 4 Oct 2017 10:57:50 +0200 Subject: [PATCH 3/3] Update recorder doc for purge service --- source/_components/recorder.markdown | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/_components/recorder.markdown b/source/_components/recorder.markdown index ce196ae2e11..80e0c2dd11c 100644 --- a/source/_components/recorder.markdown +++ b/source/_components/recorder.markdown @@ -27,7 +27,8 @@ recorder: Configuration variables: -- **purge_days** (*Optional*): Enables purge of events and states older than x days by [service](#service) call `recorder.purge`. Purge task is not scheduled by `recorder` component anymore. (post release 0.55) +- **purge_interval** (*Optional*): (days) Enable scheduled purge of older events and states. The purge task runs every x days, starting from when Home Assistant is started. If you restart your instance more frequently, than the purge will never take place. You can use [service](#service) call `recorder.purge` when needed. +- **purge_keep_days** (*Required with `purge_interval`*): Specify number of history days to keep in recorder database after purge. - **exclude** (*Optional*): Configure which components should be excluded from recordings. - **entities** (*Optional*): The list of entity ids to be excluded from recordings. - **domains** (*Optional*): The list of domains to be excluded from recordings. @@ -42,7 +43,8 @@ Define domains and entities to `exclude` (aka. blacklist). This is convenient wh ```yaml # Example configuration.yaml entry with exclude recorder: - purge_days: 5 + purge_interval: 2 + purge_keep_days: 5 db_url: sqlite:///home/user/.homeassistant/test exclude: domains: @@ -87,13 +89,15 @@ If you only want to hide events from e.g. your history, take a look at the [`his ### {% linkable_title Service `purge` %} -Call the service `recorder.purge` to start purge task, which deletes events and states older than x days, according to `purge_days` variable setting. +Call the service `recorder.purge` to start purge task, which deletes events and states older than x days, according to `keep_days` service data (*Required*) Automation [action](https://home-assistant.io/getting-started/automation-action/) example: ```yaml action: service: recorder.purge + data: + keep_days: 5 ``` ## Custom database engines