Error in YAML file but works developer tools "Template"

I get errors in my yaml file, but it works in developer tools “tamplate”

Here is the code that fails:
template:
-sensors:
##Vejrdata##
-name: Udetemp
state: “{{ state_attr(‘weather.hjemme’ , ‘temperature’) }}”

Please format your post correctly for the forum, https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

It’s sensor: not sensors:, see: Template - Home Assistant

1 Like

As additional remark, developer tools > template doesn’t validate the YAML, it only renders the templates.