Customize_glob and icons

Hello folks

I am very (very very) new to Home Assistant. I must admit I normally find this I can pick things up quickly but must admit I am struggling. But never give up :slight_smile:

I now have my server up and running on a Pi 4.

So I am starting with simple things and I am trying to get some icons to change colour based on the state of the sensor.

I tried putting this is the customize.yaml but didn’t work as no icon appeared.

sensor.epson_xp_540_series_magenta_ink:
unit_of_measurement: ‘%’
marker_low_level: 20
friendly_name: XP-540 Magenta ink
icon: “if (state > marker_low_level) return mdi:water;
else return mdi:water-off;”

Then I have read quite a few posts and got very confused, but appeared to decipher that I need to put it in customize_glob.yaml but with some different code

'customize_glob:
sensor.epson_xp_540_series_*:
templates:
icon_color: >
if (state > 70) return ‘green’;
if (state > 50) return ‘orange’;
return ‘red’;

but kept getting following error

extra keys not allowed @ data[‘customize’][‘customize_glob’]

took out the customize_glob: and config file checks the gives error

extra keys not allowed @ data[‘customize’][‘sensor.epson_xp_540_series_*’]

If the then change the code to;

sensor.epson_xp_540_series_cyan_ink:
templates:
marker_low_level: 20
icon_color: >
if (state > 70) return ‘green’;
if (state > 50) return ‘orange’;
return ‘red’;

The config file check is fine, but nothing changes/happens.

I then saw a post to say that I need to install CustomUI and then another post to say it isn’t supported/used any more.

So am I way off here? any advice, even if it is give up :slight_smile: , is very much appreciated.

thanks
Darren

It isn’t supported by the developer who created it. So it’s on it’s last leg and has been for the past year or so. You can use it but it may not work in the future.

check config does not work with custom solutions like CustomUI. Every piece of code you’ve put in your post is for CustomUI only.

All in all, it sounds like your issue is that you haven’t installed CustomUI.

No I haven’t installed CustomUI, I take it that is what i need to do then
thanks