Template Issue

I’m trying to setup a Template but it fails to load when added to yaml. It works in the Template tester. Does anyone have any suggestions?
{{ distance(states(‘sensor.alex_latitude’),states(‘sensor.alex_longitude’)) | round (0) }}

What is the error message?
Have you tried hass --script check_config?

I’m getting
17-01-22 08:11:23 homeassistant.util.yaml: while parsing a block mapping
in “/config/includes/sensors/mdistancefromhomecalc.yaml”, line 4, column 7
expected , but found ‘’
in “/config/includes/sensors/mdistancefromhomecalc.yaml”, line 4, column 44
in the log

As for hass --script check_config I’m not sure what that is as I’m very new to Home Assistant.

Try with qoutes around template
"{{.... }}"
You should also read this: https://home-assistant.io/getting-started/troubleshooting-configuration/

Yeah, I have in the yaml . I’ll try “…” instead.

  • platform: template
    value_template: ‘{{ distance(states(‘sensor.alex_latitude’),states(‘sensor.alex_longitude’)) | round (0) }}’

Thank you for the assistance.

Just fyi I traced it out. Not sure why it worked in the template tester but
value_template: ‘{{ distance(states(‘sensor.alex_latitude’),states(‘sensor.alex_longitude’)) | round (0) }}’
was changed to
value_template: ‘{{ distance(states(“sensor.alex_latitude”),states(“sensor.alex_longitude”)) | round (0) }}’