Show image/icon when device is on status "Unavailable"

Hi there,

I am working on a floor plan and have two different images show according my lightbulbs’ state: On or Off. I am currently configuring my light switches to always have power throughput to the bulb. Kind of disabling the light switch on the wall, but not there yet. Therefor, my family sometimes shuts down the power to one or more of my zigbee lightbulbs.

The device then becomes unavailable and shows Unavailable:

In my YAML file i have it configures so to show an image when state is ON or OFF. But when its unavailable it shows a quite ugly svg image with a dark background. I would like to show an image exclemation.png for “Unavailable” state too which has a transparent background.

So I figured, Maybe I can add this to the list and should work? Nope…

YAML config:

- entity: light.color_light_1
        state_image:
          'off': /local/lights_off.png
          'on': /local/lights_on.png
          'Unavailable': /local/exclamation.png
        style:
          left: 15%
          top: 96%
          width: 8%
        type: image
        tap_action:
          action: toggle

This is how the code looks like when I inspect the button:

Is there anyone that could point me into the right direction? Thanks in advance!

Lol, nevermind. Solved my own problem… it is capital sensative. Changed ‘Unavailable’ to ‘unavailable’, now it works. yay!

Wanted to post the solution just in case anyone else ever runs into the same issue. Doh! :stuck_out_tongue:

1 Like