Weather template help please

I’m trying to create a Weather template but for some reason it will not accept my condition.

This is my template

template:
  - weather:
      - name: Weather Combined
        unique_id: weather_combined
        apparent_temperature: >
          {{ states('sensor.weather_current_feels_like_temperature') }}
        cloud_coverage: >
          {{ states('sensor.weather_current_cloud_cover') }}
        condition: >
          {{ states('sensor.weather_current_conditions') }}
        dew_point: >
          {{ states('sensor.weather_current_dew_point') }}
        humidity: >
          {{ states('sensor.weather_current_humidity') }}
        precipitation_unit: mm
        pressure: >
          {{ states('sensor.weather_current_pressure') }}
        pressure_unit: hPa
        temperature: >
          {{ states('sensor.weather_current_temperature') }}
        temperature_unit: °C
        uv_index: >
          {{ states('sensor.weather_current_uv_index') }}
        visibility: >
          {{ states('sensor.weather_current_visibility') }}
        visibility_unit: km
        wind_gust_speed: >
          {{ states('sensor.weather_current_wind_gust') }}
        wind_speed: >
          {{ states('sensor.weather_current_wind_speed') }}
        wind_speed_unit: km/h
        wind_bearing: >
          {{ states('sensor.weather_current_wind_direction') }}

It creates the Weather entity but not condition and hence its state is unknown.

Here is some supporting ‘evidence’…


First, sensor.weather_current_conditions to prove it is valid

Here is the weather entity itself:

Note that everything else is populated because…

…on a dashboard I do not get all the data.
But in the dev tools clicking the ‘i’ icon I get some extra data in the more info dialog

And finally here is evidence that when creating it in the UI it seems to be happy…

(here is the preview at the bottom)

… but it still isn’t

I know that’s a lot of info for such a ‘small’ problem but hopefully someone knows what is going on?

Thanks.

I think it may be down to the fact that “Light rain” is not one of the standard conditions.

1 Like

yeah I did consider that but for the life of me I could not find a list of the standard conditions.
You would have thought that might be documented in the weather template documentation?

But thanks for the link!!

You can always suggest an edit to the documentation :wink:

I may well do that but that page needs a hell of a lot more than that one edit.

For example, the hourly, daily and twice daily forecast attributes are completely devoid of any guidance of what is actually needed to make it work.

Given how new this template is I cannot believe it got through any of the approval processes.

I’ve actually moved on now anyway, I pretty much gave up with constructing my own weather template. It seemed like a lot of trouble for not much gain :person_shrugging:

And while I’m at it, why is humidity a required field? To my mind that is one of the least used/interesting weather measures; at least it is in the temperate region I live in.

You mean like the entire Weather Forecast Data section, where the structure of each type is described?

I mean exactly that.
Show me where it tells you the structure of the data that is read into the template?

All done :wink:

Pulled straight from the docs

Tells you it needs to be a dictionary in the main template docs with a link to all dictionary values.

And the link references “mapping” which is another way to describe a dictionary, and shows all the values.

I’m not going to replicate that information in the template documentation when a link to it works. It just seems like you didn’t look at the link.


As for why humidiy is required: I don’t know, it’s a requirement of weather entities in HA, so it was forced that way in template weather implementation.

As a sidebar, I’m also not happy with how template weather was implemented. From a code standpoint it was clearly rushed through without much thought. I’ve fixed it up to be on-par with all the other platforms for templates so it’s behavior is more predictable. The documentation was also fast tracked when it was originally added and the configuration option descriptions are rather lacking and need updates. However the forecast documentation was updated at some point in the past year.

I don’t see the issue in the documentation repo, do you have a link to it?

It’s been approved by Frenck. It all happened in about 20 minutes from start to finish.
It felt like he had been reading this thread and was waiting for my edit :joy:

1 Like