Changing the icon color according to status

How to change the icon color according to status?

I have a lamp switch, I wanted to leave it yellow when turned on … How do I do? any direction follow?

The only component that supports that is the binary sensor.

I created input boolean.

input_boolean:
    sonoff_switch_1:
        name: Luz Entrada 
        initial: off
    sonoff_switch_2:
        name: Luz Principal
        initial: off
    sonoff_switch_3:
        name: Luz Jantar
        initial: off
    sonoff_switch_4:
        name: Luz Home
        initial: off
    sonoff_switch_5:
        name: Luz Piscina
        initial: off

Make it a switch :wink:

Sorry, my knowledge in HA is not enough.
How would you do that?

With a switch template rather than an input boolean.