Sensor from template not working

I’m trying to make some automations based on the outside temperature. To do this I have created a sensor from template that is supposed to pull the temperature attribute from my weather card entity.

  # Temperature from entity
  - platform: template
        friendly_name: "norwegian_temperature"
        unit_of_measurement: '°C'
        value_template: "{{ states_attr('weather.home', 'temperature') }}"

This worked like a charm (thanks to your help!) and I have found a new entity on my list:

However, this new entity does not seem to be working. It never updates and is listed at unavailable.

I would be very grateful for any ideas that could help to make it work.

Best wishes!

The function’s name is:




Reference: Templating Documentation.

Change it to this:

        value_template: "{{ state_attr('weather.home', 'temperature') }}"
1 Like

Thank you very much! This has fixed everything! I now feel a bit stupid cause of the typo :frowning:
Best wishes!

1 Like