Change icon colour based on integers value

I am trying to change the colour of an icon based on its state value. I have it working for another couple of entities when the value is a float or a string but can’t get it working when it’s an integer. At the moment it only shows as black but changes to a colour when I put icon color: green for example. Have check Dev tools and it’s defo an int.

What am I missing?

type: vertical-stack
cards:
      - type: custom:mushroom-chips-card
        chips:
          - type: spacer
          - type: entity
            entity: sensor.heating_on_manual
            icon: mdi:hand-pointing-up
            icon_color: |-
              {% if states('sensor.heating_on_manual') | int == 0 %}
                green
              {% elif states('sensor.heating_on_manual') | int <= 3 %}
                amber
              {% else %}
                red
              {% endif %}
            tap_action:
              action: navigate
              navigation_path: /dashboard-nspanel/Heating_set_to_manual

Not using mushrooms.
But this code may cause problems since there is no provided default value.
If a state is not numerical (or unavailable, unknown) - then there will be an error.
Try with

states('sensor.heating_on_manual') | int(default = 0)

Thanks for the reply but no change. Icon still black even though the value is currently zero.

Suggest to post your changed simplified code.
Also a screenshot from “dev tools - state” for this entity.
And test your templates in Dev tools → Template. If the template works - then may be this option of this card does not accept jinja, have no idea, not using mushrooms…