CustomUI - discussion thread

Thanks @andrey love icon_color

Here is a screen shot from the dev tools:

55

I should perhaps have mentioned that I just updated to 0.67.1 - sorry!

not sure i follow… is it working now? or are you saying it wont work under 67.1…
( i ask since i was just about to do so…)

I was on 0.65.5 and it was working (both with rgb(a, b, c) with quote marks, and in my original configuration with square brackets [a, b, c]).

Under 0.67.1 I cannot get any colour, using either icon_color or rgb_color

thats not very promising… ill hold back the update then, until @andrey can confirm whats up? My request for icon_color was explicitly done to resolve the hs_color issue in .66 and up. Hope that @andrey s effort in that way wasn’t in vain.

@Mariusthvdb - doh! Was a browser cache issue.

icon_color works as expected.

Not here I am afraid…
hue messed up also.
But that’s another thread…;-((

What is going wrong?

Have you cleared your browser cache? :slight_smile:

I am on 0.68.0b2 and icon_color is working fine for me here. You can check my customize_glob for details.

yes its working in the desktop browsers, both Chrome and Safari. The app is not showing correct colors yet though. Have reloaded completely. App has different cache issues I guess, as with older images showing up too.

Hue is way off though, with correct settings according to the documentation … so frustrating this

Hue is a separate issue and is being worked upon. Both the app and browsers working fine for me here.

BTW, can we use hex colors as well with icon_color?

Looks like the Hue bug is fixed. See https://github.com/home-assistant/home-assistant/issues/14119

my guess would be we can use all correct CSS syntax. Only tested the ‘rgb(1,2,3)’ yet, because it was the direct transition of my rgb_color templates

dont see the solution yet, but will take it to the correct thread, thanks for pointing me to this

icon_color is applied verbatim to color: style, so any CSS goes.
#FFACAC red rgba(10, 20, 30, 0.5)etc.

2 Likes

It will be good to clarify the same in custom_ui docs…it was not immediately obvious to me :slight_smile: Thanks!!

Hi @andrey please have a look with me, how I could apply a multiple condition in a template? Cant seem to find correct syntax yet:

 icon_template: "if (state === 'on') and (entities['sensor.driveway_reachable'].state === 'True') return 'mdi:power-plug';
                        else return 'mdi:power-plug-off';"

obviously in want both conditions to be true, for the ‘On’ icon to show, else the ‘Off’.

tried with && also and parentheses in various variations. No luck just yet.
Maybe you could point me in the right direction?
Thanks,
Marius

replace and with &&

the thing is, of course i tried before posting, it didnt work though.

"if (state === 'on') && (entities['sensor.driveway_reachable'].state === 'True') return 'mdi:power-plug';
                        else return 'mdi:power-plug-off';"

hence i thought it might have been the parentheses placed wrong?
(to be complete, the (state === ‘on’) is the state of the entity I want to customize. Both conditions working fine separately.