Issues and questions on Template - weather platform

Hello,
I'm trying to configure a new weather entity (map) using the "template" integration on the "weather" platform.

The first question is about the name of the entities of the weather (map) container:
If I use e.g. temperature the template do not load with the error "temperature is an invalid option", so I need to use: temperature_template; this sound very strange.
If I try to use a wind_gust_speed attribute it doesn't work neither as wind_gust_speed_template.

This is my very first time with template weather and I don't understand if there is some my fault of the integration template on weather platform has some unresolved Issue.

I'm using HA 2026.5.1.

This is my template code:

template:
  - weather:
      - name: "Stazione Meteo Urbiano"
        unique_id: meteo_station_urbiano

        # ── CONDITION: da Met.no (non disponibile da stazioni locali) ──
        condition_template: "{{ states('weather.forecast_met_no') }}"

        # ── TEMPERATURE: Meteobridge → fallback Met.no ──
        temperature_template: >
          {% set mb = states('sensor.davis_vantage_vue_meteobridge_air_temperature') %}
          {% if mb not in ['unknown', 'unavailable', ''] %}
            {{ mb | float }}
          {% else %}
            {{ state_attr('weather.forecast_met_no', 'temperature') | float }}
          {% endif %}
        temperature_unit: "°C"
        # ── HUMIDITY: Meteobridge → fallback Met.no ──
        humidity_template: >
          {% set mb = states('sensor.davis_vantage_vue_meteobridge_relative_humidity') %}
          {% if mb not in ['unknown', 'unavailable', ''] %}
            {{ mb | float }}
          {% else %}
            {{ state_attr('weather.forecast_met_no', 'humidity') | float }}
          {% endif %}

        # ── WIND speed: Meteobridge → fallback Met.no ──
        wind_speed_template: >
          {% set mb = states('sensor.davis_vantage_vue_meteobridge_wind_speed') %}
          {% if mb not in ['unknown', 'unavailable', ''] %}
            {{ mb | float }}
          {% else %}
            {{ state_attr('weather.forecast_met_no', 'wind_speed') | float }}
          {% endif %}
        wind_speed_unit: "km/h"
        # NOT PRESENT!! ── WIND gust speed: Meteobridge ──
        #wind_gust_speed_template: >
        #  {% states('sensor.sensor.davis_vantage_vue_meteobridge_wind_gust') %}
        # ── WIND bearing: Meteobridge → fallback Met.no ──
        wind_bearing_template: >
          {% set mb = states('sensor.davis_vantage_vue_meteobridge_wind_direction') %}
          {% if mb not in ['unknown', 'unavailable', ''] %}
            {{ mb | float }}
          {% else %}
            {{ state_attr('weather.forecast_met_no', 'wind_bearing') | float(0) }}
          {% endif %}

        # NOT PRESENT!! ── Rain → precipitation (mm/h): Meteobridge ──
        #precipitation_template: >
        #  {% set mb = states('sensor.meteobridge_rain_rate') %}
        #  {% if mb not in ['unknown', 'unavailable', ''] %}
        #    {{ mb | float }}
        #  {% else %}
        #    {{ state_attr('weather.forecast_met_no', 'precipitation') | float(0) }}
        #  {% endif %}
        precipitation_unit: "mm"

        # ── PRESSURE: Meteobridge → fallback Met.no  ──
        pressure_template: >
          {% set mb = states('sensor.davis_vantage_vue_meteobridge_sea_level_pressure') %}
          {% if mb not in ['unknown', 'unavailable', ''] %}
            {{ mb | float }}
          {% else %}
            {{ state_attr('weather.forecast_met_no', 'pressure') | float(0) }}
          {% endif %}
        pressure_unit: "hPa"

Regards.

Because you’re mixing {field}_template with {field} in your configuration. Do not use any {field}_template, they will be deprecated shortly (Likely starting next month). So remove all instances of _template in your configuration. You’ll note that {field}_template isn’t even covered in the documentation.

Hi Pedro,
I tried to use the {field} without _template first, but the integration didn't load with the following errors in log:

Invalid config for 'template' at configuration.yaml, line 45: required key 'condition_template' not provided 
Invalid config for 'template' at configuration.yaml, line 45: required key 'humidity_template' not provided 
Invalid config for 'template' at configuration.yaml, line 45: required key 'temperature_template' not provided 
Invalid config for 'template' at configuration.yaml, line 49: 'condition' is an invalid option for 'template', check: weather->0->condition 
Invalid config for 'template' at configuration.yaml, line 52: 'temperature' is an invalid option for 'template', check: weather->0->temperature 
Invalid config for 'template' at configuration.yaml, line 61: 'humidity' is an invalid option for 'template', check: weather->0->humidity 
Invalid config for 'template' at configuration.yaml, line 70: 'wind_speed' is an invalid option for 'template', check: weather->0->wind_speed 
Invalid config for 'template' at configuration.yaml, line 79: 'wind_bearing' is an invalid option for 'template', check: weather->0->wind_bearing 
Invalid config for 'template' at configuration.yaml, line 88: 'precipitation' is an invalid option for 'template', check: weather->0->precipitation 
Invalid config for 'template' at configuration.yaml, line 97: 'pressure' is an invalid option for 'template', check: weather->0->pressure

So I change the names of the keys in the {name}_template format and that work.
In the same way I can't use the wind_gust_speed option.
In my opinion is also very strange that I can set a precipitation_unit and not a precipitiation option.

Petro

What version of HA are you on?

Precipitation can only be set through the forecast. This is a limitation of all weather entities in home assistant, and template weather is no exception.

I’m sorry.

Ok, this is a Pitty… I have a local weather station that has a rain sensor and I’m trying to mix weather entity and local sensor.

If you're on 2026.5.1, share your entire template weather configuration without the _templates.

I tried to remove all the _template.
Also fix the wind_gust_speed option , the problem was an error in the template string {% %} and not {{ }}
Now this code works, but not the first time :thinking:

But I don't understand why the first time it generate the errors reported in the previous message.

template:
  - weather:
      - name: "Stazione Meteo Urbiano"
        unique_id: meteo_station_urbiano

        # ── CONDITION: da Met.no (non disponibile da stazioni locali) ──
        condition: "{{ states('weather.forecast_met_no') }}"

        # ── TEMPERATURE: Meteobridge → fallback Met.no ──
        temperature: >
          {% set mb = states('sensor.davis_vantage_vue_meteobridge_air_temperature') %}
          {% if mb not in ['unknown', 'unavailable', ''] %}
            {{ mb | float }}
          {% else %}
            {{ state_attr('weather.forecast_met_no', 'temperature') | float }}
          {% endif %}
        temperature_unit: "°C"
        # ── HUMIDITY: Meteobridge → fallback Met.no ──
        humidity: >
          {% set mb = states('sensor.davis_vantage_vue_meteobridge_relative_humidity') %}
          {% if mb not in ['unknown', 'unavailable', ''] %}
            {{ mb | float }}
          {% else %}
            {{ state_attr('weather.forecast_met_no', 'humidity') | float }}
          {% endif %}

        # ── WIND speed: Meteobridge → fallback Met.no ──
        wind_speed: >
          {% set mb = states('sensor.davis_vantage_vue_meteobridge_wind_speed') %}
          {% if mb not in ['unknown', 'unavailable', ''] %}
            {{ mb | float }}
          {% else %}
            {{ state_attr('weather.forecast_met_no', 'wind_speed') | float }}
          {% endif %}
        wind_speed_unit: "km/h"
        # NOT PRESENT!! ── WIND gust speed: Meteobridge ──
        wind_gust_speed: "{{ states('sensor.davis_vantage_vue_meteobridge_wind_gust') }}"
        # ── WIND bearing: Meteobridge → fallback Met.no ──
        wind_bearing: >
          {% set mb = states('sensor.davis_vantage_vue_meteobridge_wind_direction') %}
          {% if mb not in ['unknown', 'unavailable', ''] %}
            {{ mb | float }}
          {% else %}
            {{ state_attr('weather.forecast_met_no', 'wind_bearing') | float(0) }}
          {% endif %}

        # NOT PRESENT!! ── Rain → precipitation (mm/h): Meteobridge ──
        #precipitation: >
        #  {% set mb = states('sensor.meteobridge_rain_rate') %}
        #  {% if mb not in ['unknown', 'unavailable', ''] %}
        #    {{ mb | float }}
        #  {% else %}
        #    {{ state_attr('weather.forecast_met_no', 'precipitation') | float(0) }}
        #  {% endif %}
        precipitation_unit: "mm"

        # ── PRESSURE: Meteobridge → fallback Met.no  ──
        pressure: >
          {% set mb = states('sensor.davis_vantage_vue_meteobridge_sea_level_pressure') %}
          {% if mb not in ['unknown', 'unavailable', ''] %}
            {{ mb | float }}
          {% else %}
            {{ state_attr('weather.forecast_met_no', 'pressure') | float(0) }}
          {% endif %}
        pressure_unit: "hPa"

Hi everyone, (and @petro since you mentioned the ongoing transition to the modern template: structure in this thread).

I wanted to point out a bug/missing key in the schema validator for the modern template: weather integration regarding the UV index.

According to the official documentation, uv_index is an optional variable. However, when setting it up under the modern template: format, the configuration validation strictly rejects it.

Here is the modern format that FAILS:

  - weather:
      - name: "My Weather"
        temperature: "{{ states('sensor.temp') }}"
        condition: "{{ states('sensor.condition') }}"
        uv_index: "{{ states('sensor.my_uv_index') }}" # <--- This line causes the error

The Error Log:

Invalid config for 'template' at packages/weather.yaml, line xxx: 'uv_index' is an invalid option for 'template', check: weather->0->uv_index

The Workaround: If I revert back to the legacy format under the weather: domain and use uv_index_template, it works perfectly fine and parses the data correctly.

  - weather:
      - name: "My Weather"
        temperature: "{{ states('sensor.temp') }}"
        condition: "{{ states('sensor.condition') }}"
        uv_index_template: "{{ states('sensor.my_uv_index') }}" # <--- This works perfectly

It seems the uv_index key was accidentally left out of the schema validator when the new template: weather integration was built. Could the dev team look into adding this missing key to the schema so we can fully migrate away from the legacy _template format?

My template weather entity works fine with uv_index only in my Combined template weather

So it's strange that it doesn't for you. I added the uv_index end of March (I initially missed this option), so I has been working for me with the _template sufix since the 2026.4 beta (which I had installed end of March)

Hi, TheFes
Thanks for getting back to me! That's really strange.

I tried using just uv_index exactly as you mentioned, but it throws an error for me upon validation. Could you take a look at the attached screenshots? Do you have any idea why this might be happening, or did I format something incorrectly in my configuration?

I've attached both my code snippet and the error log for reference. Any thoughts or advice would be greatly appreciated!

I'm using Home Assistant 2026.6.2.


2026-06-11 20_26_21-EA

Really strange, for me it works with the code linked above, and this screenshot shows it works in the actual entity

@petro any idea why uv_index is not working for @wanball ?

That's sound like the problem I had first with my weather template.
I suggest you to try to delete and rewrite the whole template. That's worked for me.

It seems like there’s a bug somewhere

Thanks so much! Your advice worked perfectly.

I followed your suggestion by deleting the entire template, performing a full restart of Home Assistant, and then rewriting the code from scratch. After that, it finally accepted the uv_index option without any errors. It seems like something might have been stuck in the configuration cache or the validation schema, but a clean rewrite solved it.

Thanks again for the help!