Input_number set different pictures

Cant figure out how to do this…

I have an imput_number that can be set between 1.0 and 7.0
What I want is to have one card that shows different images based on the number 1.0 to 7.0 (7 different numbers and images)
I can do one conditional card per number but I wanted to have just one card for all.
Is that possible?

Thanks!

Images or icons?
There is entity_picture or icon you can use.
If you use customize.yaml then you could do something like:

  input_number.number:
    templates:
      icon: if(state === 1) return 'mdi:house'; 
            if(state === 2) return 'mdi:dog';
            if(state === 3) return 'mdi:cat';

Or entity_picture.
Perhaps that will work for you?

Thanks for your reply!

In my case I want to show an image (like in the normal picture card).
I have the images stored in /local as usual.

Found this and it worked

type: horizontal-stack
cards:
  - entity: "the sensor"
    name: "name of card"
    show_name: false
    show_state: false
    state_image:
      '0': /local/images/home.png
      '1': /local/images/sleeping.png
      '2': /local/images/away.png
      '3': /local/images/vacation.png       
    type: picture-entity
1 Like