Template yaml if temperature questionary problem

cannot get this last if to work!
{% if states(‘entry.temperature’) > tempr %}

uid: wzeit8grad always unavailabe! tried a lot of variants, but not the right one until now. can someone help me?

code in template.yaml file:

  • trigger:
    • platform: time
      at: “10:30:00”
      action:
    • variables:
      w: weather.forecast_home
    • service: weather.get_forecasts
      target:
      entity_id: ‘{{ w }}’
      data:
      type: daily
      response_variable: d
      sensor:
    • name: ‘WetterMaxTemp’
      unique_id: ‘wmaxtemp’
      unit_of_measurement: ‘°C’
      device_class: temperature
      state: “{{ d[w].forecast[0].temperature }}”
  • trigger:
    • platform: time
      at: “10:30:00”
      action:
    • variables:
      w: weather.forecast_home
    • service: weather.get_forecasts
      data:
      type: hourly
      target:
      entity_id: ‘{{ w }}’
      response_variable: h
      sensor:
    • name: “WetterMaxZeit”
      unique_id: wmaxzeit
      state: >
      {% if h[w] and h[w].forecast %}
      {% set max_temp = h[w].forecast | map(attribute=‘temperature’) | max %}
      {% for entry in h[w].forecast %}
      {% if entry.temperature == max_temp %}
      {{ as_timestamp(entry.datetime) | timestamp_custom(‘%H:%M’) }}
      {% endif %}
      {% endfor %}
      {% else %}
      “Keine Daten”
      {% endif %}
    • name: “WetterZeit8Grad”
      unique_id: wzeit8grad
      state: >
      {% if h[w] and h[w].forecast %}
      {% set tempr = 8 | float %}
      {% for entry in h[w].forecast %}
      {% if states(‘entry.temperature’) > tempr %}
      {{ as_timestamp(entry.datetime) | timestamp_custom(‘%H:%M’) }}
      {% endif %}
      {% endfor %}
      {% else %}
      “Keine Daten”
      {% endif %}

No “states”, it is not an entity.

Just entry.temperature | float

Hello Karl,

Thanks for coming here and asking a question.
Would you be so kind as to adjusting the format of your code so that we can read it properly & check the YAML spacing, etc. Editing your original is the preferred way. It is very hard for us to tell what is what when the text formatter jumbles everything like that.
You can use the </> button like this… How to format your code in forum posts
OR… Here is an example of how to fix formatting from the site FAQ Page.
How to help us help you - or How to ask a good question.