From 1c523d6cf909ca773ff9b70e2d8f6b6b63809754 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 19 Oct 2020 07:20:02 -0500 Subject: [PATCH] Adjust template rate limits for a single domain (#15291) --- .../_integrations/binary_sensor.template.markdown | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/source/_integrations/binary_sensor.template.markdown b/source/_integrations/binary_sensor.template.markdown index f6bb04ed43e..957f7db9173 100644 --- a/source/_integrations/binary_sensor.template.markdown +++ b/source/_integrations/binary_sensor.template.markdown @@ -309,7 +309,20 @@ binary_sensor: ``` {% endraw %} -If the template accesses every state on the system or all states under a specific domain, a rate limit of one update per minute is applied. If the template only accesses specific states, receives update events for specifically referenced entities, or the `homeassistant.update_entity` service is used, no rate limit is applied. +In the below example, re-renders are limited to once per second: + +{% raw %} +```yaml +binary_sensor: + - platform: template + sensors: + has_sensor_unavailable_states: + value_template: '{{ states.sensor | selectattr('state', 'in', ['unavailable', 'unknown', 'none']) | list | count }}' +``` +{% endraw %} + + +If the template accesses every state on the system, a rate limit of one update per minute is applied. If the template accesses all states under a specific domain, a rate limit of one update per second is applied. If the template only accesses specific states, receives update events for specifically referenced entities, or the `homeassistant.update_entity` service is used, no rate limit is applied. ### Working without entities