Looks like the rgb_color works only on the icon (-for me) when in a group, not the text. The rgb_color works not for the sensor when on the default view.
Do you know if there are a code for the color within the default sensor view?
Yeah if you use “rgb_color” as shown in my second post, it will only change the icon colour when in the group.
If you use “theme” as shown in my first post, it will change the colour of the badges (the circular representations shown in your second image). If you then add it to a group, whilst using theme, it will change the icon, text and value, as I show in the first image of my second post!
To use theme, you need to define the colours under the theme section of the front end - I’m at work now, but when I get home I will post that config for you.
Don’t worry, it confused the hell out of me (I find CustomUI incredibly confusing as it is!), so am happy to help!
well, almost. Havent found a way to distinguish between border colors of the badge and label. Also, no changing of the label text is possible (yet). Other than that, most things can be customized…
for the badges i use my dedicated frontend themes file, you might be able to adapt it to your own likings:
##########################################################################################
# Badge-themes in order of severity, either up or down
##########################################################################################
#source https://github.com/home-assistant/home-assistant-polymer/blob/master/src/resources/ha-style.html
# /* for label-badge */
# --label-badge-background-color: white;
# --label-badge-text-color: rgb(76, 76, 76);
# --label-badge-red: #DF4C1E;
# --label-badge-blue: #039be5;
# --label-badge-green: #0DA035;
# --label-badge-yellow: #f4b400;
# --label-badge-grey: var(--paper-grey-500);
green_badge:
label-badge-red: green
label-badge-border-color: lightgrey
label-badge-background-color: white
label-badge-text-color: green
# label-badge-blue: blue
# label-badge-green: black
# label-badge-yellow: yellow
# label-badge-grey: grey
grey_badge:
label-badge-red: grey
label-badge-border-color: lightgrey
label-badge-background-color: white
label-badge-text-color: grey
black_badge:
label-badge-red: black
label-badge-border-color: lightgrey
label-badge-background-color: white
label-badge-text-color: black
brown_badge:
label-badge-red: brown
label-badge-border-color: brown
label-badge-background-color: white
label-badge-text-color: brown
orange_badge:
label-badge-red: orange
label-badge-border-color: orange
label-badge-background-color: white
label-badge-text-color: orange
blue_badge:
label-badge-red: blue
label-badge-border-color: blue
label-badge-background-color: white
label-badge-text-color: blue
yellow_badge:
label-badge-red: grey
label-badge-border-color: yellow
label-badge-background-color: lightgrey
label-badge-text-color: yellow
red_badge:
label-badge-red: grey
label-badge-border-color: lightgrey
label-badge-background-color: white
label-badge-text-color: red
just beware to have the proper headers in place, along with careful indenting.
strange behavior might occur though. Groups declared in the packages aren’t shown after one clicks the reload groups button in configuration. Also, in my setup, script behave unreliably when declared in the packages, so I always put these in their dedicated /config/scripts folders.
Other than that, packages are very nice to have. very easy to take out also when testing and debugging…
frontend:
themes:
green_badge:
label-badge-red: green
label-badge-border-color: lightgrey
label-badge-background-color: white
label-badge-text-color: green
red_badge:
label-badge-red: grey
label-badge-border-color: lightgrey
label-badge-background-color: white
label-badge-text-color: red