Global customize icon color for state sensors don't work

some time ago rgb_color was disabled and changed into icon_color for customizations. Note, this was before Lovelace, so maybe not up to date, bit still, you might try this:

sensor.dorm_state:
  templates:
    icon: >
      if (state === 'on') return 'mdi:human-child';
      return 'mdi:hotel';
    icon_color: >
      if (state === 'on') return 'rgb(251, 210, 41)';
      return 'rgb(54, 95, 140)';

and see what happens. I use this on 0.81.6 non_lovelace with custom-ui installed, and works without any issue at all. Use any Css color name: https://github.com/andrey-git/home-assistant-custom-ui/blob/master/docs/features.md#icon-color