after changing from rgb_color to hs_color
in the square bracket [ ] , Can I put [Hue, Saturation, Brightness ] [100, 150, 100] instead of only [100, 150] as most of the icon now black when I put only 2.
So where to check what color will I get if I put only 2 values inside square bracket. or can I put the HEX in square bracket [#94856B ]
that would surely be the more logical, not to mention easiest thing to do:
templates:
icon_color: [#fefefe ]
too bad we donât have icon_colorâŚ
arsaboo
(Arsaboo)
April 26, 2018, 12:22pm
44
No, unfortunately, you can only use hs_color
mbonani
(Mauricio Bonani)
April 26, 2018, 8:53pm
45
How to make this work in Safari and in the iOS app too?
I only made this change instead of rgb and everything works good!
hs_color: "if (state === 'on') return [48, 96];"
andrey
(Andrey)
April 27, 2018, 6:37am
47
If the slider is hidden for lights-off then you canât turn on the light to a specific brightness.
Another downside that unless the light is in single-line
mode turning the light on/off will change the height of the card.
Whatâs the use-case? To adjust brightness for an already-on light?
To protect again accidental switch you can indeed use confirmable controls that should protect the slider too.
Solved!
# CustomUI Features
* [Customizer component](#customizer-component)
* [CustomUI panel](#customui-panel)
* [Global Features](#global-features)
+ [Hiding entities from default view tab (HA 0.62+)](#hiding-entities-from-default-view-tab)
+ [Template attributes [New in 20170927]](#template-attributes)
+ [Icon Color](#icon-color)
+ [Action name](#action-name)
* [Features available for all domains](#features-available-for-all-domains)
+ [Context-aware attributes](#context-aware-attributes)
+ [Badges in state cards](#badges-in-state-cards)
+ [Per entity theming (Requires HA 0.50+)](#per-entity-theming)
+ [Secondary custom UI](#secondary-customui)
* [Features available for almost all domains](#features-available-for-almost-all-domains)
+ [You can always show the last-changed text](#you-can-always-show-the-last-changed-text)
* [Features available for light, cover, climate, "plain", and "toggle" cards](#features-available-for-light-cover-climate-plain-and-toggle-cards)
- [You can hide the control altogether](#you-can-hide-the-control-altogether)
- [You can add extra data below the entity name](#you-can-add-extra-data-below-the-entity-name)
- [Add badge to the state card](#add-badge-to-the-state-card)
This file has been truncated. show original
We have icon_color:
Thank you @andrey
hoping
templates:
rgb_color: "if (state === 'on') return [251, 210, 41]; else return [54, 95, 140];"
will translate easily to:
templates:
icon_color: "if (state === 'on') return rgb(251, 210, 41); else return rgb(54, 95, 140);"
2 Likes
andrey
(Andrey)
April 27, 2018, 11:03am
49
Note that you need to use 'rgb(251, 210, 41)'
(quoted)
1 Like
andrey
(Andrey)
April 27, 2018, 11:16am
50
You donât think HA allows to hide views or groups.
Also for the syntax:
customize_glob:
group.tab_settings:
device:
"*.*":
hidden: true
mydevice:
hidden: false
The device name matching is a regexp, not a glob, so if you meant to match âeverythingâ it should be ".*"
Note that âmydeviceâ also matches ".*"
and the order of matching if a name matches several line is undefined.
An âempty nameâ will never match anything under device:
. If you want to hide by default, but only in the frontend use templates:
my.device:
templates:
hidden: true
device:
admin_device:
hidden: false
Anything you can theme globally you can theme per-entity using custom UI.
What specifically would you like to change?
I donât know what the app does, but everything should work in Safari. Could you try a config that works on Chrome in Mac Safari?
PianSom
(Pian Som)
April 27, 2018, 11:34am
51
Please can I clarify what is the working syntax these days?
In customize.yaml I currently (0.65.5) have
sensor.door_front_battery:
templates:
rgb_color: "if (state < 20) return [200, 100, 30]; else return [10, 20, 30];"
On upgrade should this become:
rgb_color: "if (state < 20) return 'rgb(200, 100, 30)'; else return 'rgb(10, 20, 30)';"
try:
icon_color: "if (state === 'on') return 'rgb(251, 210, 41)'; else return 'rgb(54, 95, 140)';"
1 Like
mbonani
(Mauricio Bonani)
April 27, 2018, 12:04pm
53
@andrey thanks for the feedback.
Anything you can theme globally you can theme per-entity using custom UI.
What specifically would you like to change?
In this case I want to change only the icon and battery percentage (state) colors, keeping name/friendly_name in default colors.
I donât know what the app does, but everything should work in Safari. Could you try a config that works on Chrome in Mac Safari?
Please take a look at these screenshots. I donât know how to make it work in Safari.
thanks for the very quick response and update @andrey
I can confirm all rgb values to showup perfectly, while still under 0.65.5.
(forgot to change the version info?
still showing)
see one post above
working just fine .
not sure about the value though, maybe the author will be able to answer that. Maybe the per-entities theming could be of help here: home-assistant-custom-ui/docs/features.md at master ¡ andrey-git/home-assistant-custom-ui ¡ GitHub though it might need some further templatingâŚ
PianSom
(Pian Som)
April 27, 2018, 12:50pm
56
Sadly, neither
rgb_color: "if (state < 20) return 'rgb(200, 100, 30)'; else return 'rgb(10, 20, 30)';"
nor
icon_color: "if (state < 20) return 'rgb(200, 100, 30)'; else return 'rgb(10, 20, 30)';"
are working
depending on the custom_ui version either the first or the latter should work. You can confirm you have the custom-ui installed properly? https://github.com/andrey-git/home-assistant-custom-ui/blob/master/docs/installing.md
mbonani
(Mauricio Bonani)
April 27, 2018, 12:54pm
58
Try this or use hs_color.
PianSom
(Pian Som)
April 27, 2018, 1:02pm
59
Hi @Mariusthvdb
I have been using custom_ui for many months, so believe it is installed correctly. A run of update.sh
reports all files are up to date.
Oddly, the UI seems to think that icon_color has been set, but the colour of the icon no longer changes.
sensor.door_front_status:
templates:
icon_color: "if (state === 'Open') return 'rgb(200, 100, 30)'; else if (state === 'Closed') return 'rgb(100, 200, 30)'; else return 'rgb(10, 20, 30)';"
ok, well if so maybe the template is wrong.
How many states other than open and closed can the door have?
seems to me it can only be open or closed, so no need for the extra condition in the template?
maybe try:
templates:
icon_color: "if (state === 'Open') return 'rgb(200, 100, 30)'; else return 'rgb(100, 200, 30)'; "
PianSom
(Pian Som)
April 27, 2018, 1:06pm
61
The other state that it can have is âUnknownâ