Template documentation inaccurate on latest Home Assistant version?

It took me way too long to realize that the - otherwise pretty awesome - documentation seems to be inaccurate when it comes to describing templates: in most pages, templates are described this way (simplified for clarity, see https://www.home-assistant.io/docs/scripts/service-calls/ ):

service: thermostat.set_temperature
data:
  entity_id: thermostat.upstairs
data_template:
  temperature: {{ 22 - distance(states.device_tracker.paulus) }}

When putting this into scripts.yml, this does not work and does not pass the config check, because the template behind temperature should actually be quoted:

service: thermostat.set_temperature
data:
  entity_id:  thermostat.upstairs
data_template:
  temperature: '{{ 22 - distance(states.device_tracker.paulus) }}'

If looks like all the Home Assistant doc has this inaccuracy, or am I missing something? I’d be happy to do a PR to correct it…

Those lines haven’t been changed in 4 years.

https://developers.home-assistant.io/docs/en/documentation_standards.html#templates

Use double quotes ( " ) for (more information):

  • friendly_name
  • Single-line templates:
    • value_template
    • level_template
    • icon_template
    • Children of data_template

So yeah, they should have quotes in the docs.

1 Like