From 3dc0126c312f1f9cd621b68e8c9476c6571dd57b Mon Sep 17 00:00:00 2001 From: DubhAd Date: Sun, 28 Oct 2018 11:09:36 +0000 Subject: [PATCH] Wording tweak (#7148) * Wording tweak Based upon feedback after the breaking change, re-wording the description of the `entity_id` line to hopefully be clearer. * Added example about entity_id Added a note about the template at the end not updating automatically, and an example about using the entity id --- source/_components/sensor.template.markdown | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/_components/sensor.template.markdown b/source/_components/sensor.template.markdown index 78926760a31..6915c2c262a 100644 --- a/source/_components/sensor.template.markdown +++ b/source/_components/sensor.template.markdown @@ -55,7 +55,7 @@ sensor: required: false type: template entity_id: - description: A list of entity IDs so the sensor only reacts to state changes of these entities. This can be used if the automatic analysis fails to find all relevant entities. + description: The template engine will attempt to work out what entities should trigger an update of the sensor. If this fails to get the correct list (for example if your template loops over the contents of a group) then you can provide a list of entity IDs that will cause the sensor to update. required: false type: string, list unit_of_measurement: @@ -292,7 +292,7 @@ sensor: ### {% linkable_title Working with dates %} -The `template` sensors are not limited to use attributes from other entities but can also work with [Home Assistant's template extensions](/docs/configuration/templating/#home-assistant-template-extensions). +The `template` sensors are not limited to use attributes from other entities but can also work with [Home Assistant's template extensions](/docs/configuration/templating/#home-assistant-template-extensions). This template contains no entities that will trigger an update, so either we need to use `homeassistant.update_entity` or add an `entity_id:` line for an entity that will force an update - here we're using `sun.sun`. {% raw %} ```yaml @@ -301,6 +301,7 @@ sensor: sensors: nonsmoker: value_template: '{{ (( as_timestamp(now()) - as_timestamp(strptime("06.07.2018", "%d.%m.%Y")) ) / 86400 ) | round(2) }}' + entity_id: sun.sun friendly_name: 'Not smoking' unit_of_measurement: "Days" ```