Icon_color Not working with template

type: custom:mushroom-chips-card
chips:
  - type: action
    icon: mdi:lightbulb
    icon_color: >-
      {%if(((state_attr('light.office', 'brightness') | float(0)/255*100) |
      round(0)) == 100)%} green {%else%} red {%endif%}
    tap_action:
      action: call-service
      service: light.toggle
      data:
        brightness_pct: 100
      target:
        entity_id: light.office_light

doesn’t work, but using the dev tools templates:

{%if(((state_attr('light.office', 'brightness') | float(0)/255*100) | round(0)) == 100)%} green {%else%} red {%endif%}

works fine and returns red or green based on the brightness set.

Thanks

You need to use a template type chip, not action.

Template Chip

Wow amazing. Thanks for the help. Not sure what the difference is cause I can still have a tap action with template but this is what I needed. Just changing type: action to type: template did it for me