Cannot set icon variable in Button Card

In the button card documentation it says I can use the variable “icon” to overwrite icon or entity picture. So I did this:

- type: vertical-stack
  title: Cartoons
  cards:
  
  - type: button
    entity: script.disneyxd
    icon: /local/disney_xd.jpg
    icon_height: 50px
    icon_width: 50px
    tap_action:
     action: call-service
     service: script.turn_on
     service_data:
      entity_id: script.disneyxd

and placed “disney_xd.jpg” inside the “www” folder

The result was that the default icon disappeared.
What I’m I doing wrong here?

Did you refresh your browser cache with Shift + F5?

yes, I did, this was the result.

Any suggestions on this?

if you replace it with something like icon: mdi:door-open, does it make any difference?

Yes, this code

- type: vertical-stack
  title: Cartoons
  cards:
  
  - type: button
    entity: script.disneyxd
    icon: mdi:door-open
    icon_height: 50px
    icon_width: 50px
    tap_action:
     action: call-service
     service: script.turn_on
     service_data:
      entity_id: script.disneyxd

Shows me this icon
1

my guess is you can only use icons with this card, i.e something like ‘mdi:xxx’.
to show pictures you need to use a different standard or custom card.

Yeah I assumed the same, but in the docs it says icon or entity picture, that’s what confused me.

1

I really don’t know what to make of this

well, that “Entity Domain Icon” confuses me.
I’ll have a look at the code when I have time

“Entity domain icon” means the icon associated with that domain. Ie, for temperature, it will show the thermometer. This is entirely different from entity id picture.

You can override with another icon but not with a local image.

I know that.

I’ve no idea what it is, expected it to be just a picture.

I have to say it’s not the same as “Overwrites icon or entity picture”.
I’ll create a docs PR.

UPDATE: PR merged so there is no more confusion now as it clearly says “Icon” :wink: