State colour based on other text

Hi,

I’d like to change to colour of my washing machine icon based on its state but the states in the entity aren’t compatible with the horizontal stack “state_color: true” option (i think it wants on/off). I could make a bool with the new update but I still want to display the status text “spin, rinse” etc but only have the icon grey when its “finished” or “unavailable”. Any ideas how I can do this?

Search for card_mod.

I’m busy with exact the same thing at the moment.

I downloaded Button-card from HACS

type: custom:button-card
entity: sensor.wasmachine_washer_job_state
icon: mdi:washing-machine
show_state: true
styles:
- font_size: 20px
  card:
    - height: 150px
    - width: 150px
    - font_size: 5px
state:
  - value: none
    color: rgb(125, 128, 130)
  - value: wash
    color: rgb(145, 229, 235)
  - value: rinse
    color: rgb(235, 180, 30)
  - value: spin
    color: rgb(30, 105, 235)

I do have a Samsung Washing machine, that gives the entity of “Washer job state” that I use since that entity gives the value “none” / “wash” / “rinse” / “spin” .

1 Like