Template and image url

I am a bit lost.
What is the difference between :slight_smile:

template:

    - trigger:
       - platform: state
         entity_id: weather.forecast_home_2
         to: 
      image:
        - name: Wetterbild
          unique_id: 7bbd302d-3246-40ab-aad8-3760d1b75100
          url: >

            {% set condition = states('weather.forecast_home_2') %}
           
            {% if 'rain' in condition or 'sleet' in condition %}
              http://192.168.10.41:8123/local/images/rain.jpg

and :slight_smile:

template:

    - trigger:
       - platform: state
         entity_id: weather.forecast_home_2
         to: 
      image:
        - name: Wetterbild
          unique_id: 7bbd302d-3246-40ab-aad8-3760d1b75100
          url: >

            {% set condition = states('weather.forecast_home_2') %}
           
            {% if 'rain' in condition or 'sleet' in condition %}
              /local/images/rain.jpg

The first version works, the second doesn’t.

The first one download an image from a http server (in this case, home assistant, but could hold any url).

The second one tries to load an image from a local folder.

But… in automation, instead of using /local/, one should not use the linked folder but use the real folder location, which is: /config/www/

Try this:

OR… Collecting and Sharing Media Files

Hmm, that does not work either.

The reason why I am asking :slight_smile:
This is from the documentation :slight_smile:

template:
  - image:
      - name: "Room Status Picture"
        unique_id: room_status_picture
        url: >
          {% set state = states('light.living_room_lights') %}
          {% if state == 'on' %}
            /local/images/room_on.png
          {% else %}
            /local/images/room_off.png
          {% endif %}

I checked history and see the problem appearing again and again for several years; no real solution is given in these topics.

Probably I have to continue using the full url.

The option is asking for a URL, not a file path. Two different things.

The key is in the key name (pun!).

Ah…yes…sorry, @tom_l is right…

image map Required
List of images

url template Required
The URL on which the image is served.

Thank you !