Custom-ui + Mushroom Template : customized icon not showing

Hi everyone!

I’m using custom-ui, which allows me to customize the icon and its color without creating a sensor.

Custom-ui works well with Mushroom cards except for the Mushroom Template card. In fact, the icon I customized isn’t displayed. Instead, calling states(entity, 'icon') shows the default entity icon (“mdi:door-closed” which is the device class icon i presume). I understand custom-ui creates a “Templates” attribute for the entity, but how do I retrieve the customized icon from this attribute to use it?

this for example:

homeassistant:
  customize_glob:
    binary_sensor.floor1_door_*:
      templates:
        icon: >
          if (state === 'on') return 'mdi:ab-testing'; return 'mdi:candy';

I know i can customize icon and its color directly within the mushroom template card. But i prefer my customisations hardcoded in customize.yaml. But using custom-ui with Mushroom Template card authorize me to define a main and secondary information for each entity.

So i’m wondering if it’s possible to use Custom-ui + Mushroom Template card?