From 0bd0eeef956ee5f17f5648ddfbbf922898eb3a98 Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Mon, 22 Apr 2024 11:11:00 -0700 Subject: [PATCH] Update recorder.markdown for purge_entities service change (#32376) Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> --- source/_integrations/recorder.markdown | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/source/_integrations/recorder.markdown b/source/_integrations/recorder.markdown index c562b77522f..d1a46d8fd48 100644 --- a/source/_integrations/recorder.markdown +++ b/source/_integrations/recorder.markdown @@ -216,17 +216,15 @@ Note that purging will not immediately decrease disk space usage but it will sig ### Service `purge_entities` -Call the service `recorder.purge_entities` to start a task that purges events and states from the recorder database that match any of the specified `entity_id`, `domains` and `entity_globs` fields. Leaving all three parameters empty will result in all entities being selected for purging. +Call the service `recorder.purge_entities` to start a task that purges events and states from the recorder database that match any of the specified `entity_id`, `domains`, and `entity_globs` fields. At least one of the three selection criteria fields must be provided. | Service data attribute | Optional | Description | | ---------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `entity_id` | yes* | A list of entity_ids that should be purged from the recorder database. | -| `domains` | yes | A list of domains that should be purged from the recorder database. | +| `entity_id` | yes | A list of entity_ids that should be purged from the recorder database. | +| `domains` | yes | A list of domains that should be purged from the recorder database. | | `entity_globs` | yes | A list of regular expressions that identify entities to purge from the recorder database. | | `keep_days` | yes | Number of history days to keep in the database of matching rows. The default of 0 days will remove all matching rows. | -Note: The `entity_id` is only optional when used in `automations.yaml` or `scripts.yaml`. When using the UI to call this service then it is mandatory to specify at least one `entity_id` using the Target Picker or via YAML mode. - #### Example automation to remove data rows for specific entities The below automation will remove history for `sensor.power_sensor_0` older than 5 days at `04:15:00` every day. @@ -240,7 +238,6 @@ action: - service: recorder.purge_entities data: keep_days: 5 - target: entity_id: sensor.power_sensor_0 mode: single ```