Change icon based on state using Card-mod for entities card

Thanks Blackway, but I want the following to work without ifelse statements:

  - entity: binary_sensor.tp_link_router_wan_status_2
    name: Wan status
    state_color: true
    card_mod:
      style: |
        :host {
          --paper-item-icon-active-color: red;
          --paper-item-icon-color: green;
        }

Any idea why its not working ? According to this post it should work

1 Like