Change the icon and color with customize.yaml

I have a MQTT switch configured and tried to change the icon and color depening on state with the next lines in customize.yaml:

switch.thermostaat_woning:
  icon_template: >-
      {% if is_state("switch.thermostaat_woning", "on") %}
        mdi:snowflake
      {% else %}
        mdi:fire
      {% endif %}
  icon_color: >-
      {% if is_state("switch.thermostaat_woning", "on") %}
        255,0,0
      {% else %}
        0,0,255
      {% endif %}

The entity shows the states:

image

Why is the icon not chaning, neither the color?

You can’t template in the customize section. Also, icon_color is not a valid field either. The only way to do this is in the frontend with custom cards or changing your theme.