How to get temperature from a template

You can use a template sensor that references the attribute of your weather component to achieve that. You’ll want to confirm the entity_id of your weather component and that the temperature attribute is named temperature.

Here’s an example of what I would need based on my weather component:

sensor:
  - platform: template
    sensors:
      weather_temperature:
        friendly_name: "Weather Temperature"
        unit_of_measurement: 'degrees'
        value_template: "{{ state_attr('weather.local_weather', 'temperature') }}"

image

7 Likes