Entity picture depending on device state

Can I set entity picture for different states?
I want to use photos of my lamps when turned on and when off as entity picture.

Picture entity card?

For template sensors you may use something like this:

template:
  - sensor:
      - name: xxxxxxxxxxxxx
        state: ....
        picture: >-
          {% if ....... -%}
          /local/images/test/orange.jpg
          {%- else -%}
          /local/images/test/blue.jpg
          {%- endif %}

But if you need to define dynamic images for a “light” entity - probably the only way is customizing by Custom UI (check for details in a corresponding thread in the Community).

Also, if you need to define pictures on particular card only - no need to customize the entity, check for available appropriate “image” option of the card.

1 Like

I want the on/off button to show different pictures for on and off. If you have any solution for that, let me know.