Can't get my own icons to show up in a card

So I am working on getting a weather (Button) card to show specific icons of my choosing according to the openweathermap_weather_code. I have a group of icons at /local/community/weathericons/ I can directly access the icons a http://localip:8123/local/community/weathericons/storm.png so I know my path is correct. here is my yaml that I am trying in a button card

type: custom:button-card
entity: sensor.openweathermap_weather_code
show_name: false
show_state: false
show_icon: false
styles:
  card:
    - padding: 0
    - background: none
    - box-shadow: none
  grid:
    - grid-template-areas: '"i"'
    - grid-template-rows: auto
    - align-items: center
  img_cell:
    - justify-content: center
    - align-items: center
  image:
    - width: 100%
    - height: auto
image: >
  [[[ 
    const code = entity.state; 
    return '/local/community/weathericons/' + {
      '200': 'storm.png',
      '804': 'rain.png',
      '800': 'sun.png'
    }[code] || 'default.png'; 
  ]]]

I get no icon at all, even though the code right now is 804 I got this code from chatgpt for HA. I thought it might help me out but not so much.

Don’t know much about icons, but I don’t think your path is right. Files accessed with /local/…
need to go in a directory called /config/www/

Frontend plugins are located here in my setup:
image
i.e. in “/local/community”

That is where I have them

image

I have not worked much with the button card, but I know the path on the HTTP link is different than the ones for the file link and many mess it up.
I suggest you remove your template in the image section and start with just a direct path to the file and when that works, then you advance your code to a template.

I have set a single icon in the card and it does render. That is what is so frustrating.

Then it is your template that is wrong and not your path.

Kinda what I figured. I have seen somewhere that I could substitute the icons by changing a theme, but haven’t pursued that. I might tho

Ask on the Github page for the button card you use or see if the author have a thread in the forum somewhere.
I know that the author is pretty active, so the chances of an answer is pretty high. :slight_smile: