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
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 , is very much appreciated.
thanks
Darren