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.
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.
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 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
But I don't understand why the first time it generate the errors reported in the previous message.
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?