tmkmarius
(Marius T.)
December 17, 2020, 7:20pm
1
I tried to use CustomUI today so I installed it.
Then I wanted to change “icon”, “icon_color” and “state” using the “customize.yaml” file but it doesn’t work.
I lost hours but I was not successful.
Later I noticed that everything in “customize.yaml” does not work.
Any help is welcome.
Tinkerer
(aka DubhAd on GitHub)
December 17, 2020, 7:39pm
2
Check that the customizations are loaded :
homeassistant:
customize: !include customize.yaml
tmkmarius
(Marius T.)
December 17, 2020, 7:41pm
3
That is, see the image in the previous post.
Tinkerer
(aka DubhAd on GitHub)
December 17, 2020, 7:41pm
4
It’s hard to tell unfortunately because of all the mangling applied to the image… way easier to work with text, rather than images of images
tmkmarius
(Marius T.)
December 17, 2020, 7:50pm
5
In configuration.yaml I have:
homeassistant:
customize: !include customize.yaml
Then I created a customize.yaml file in which I have this:
switch.g16_i1:
templates:
icon: 'if (state === ''on'') return ''mdi:window-open-variant''; return ''mdi:window-closed-variant'';
'
icon_color: 'if (state === ''on'') return ''rgb(255, 0, 0)''; return ''rgb(0,
0, 0)'';
'
state: if (state==='on') return 'Deschis'; else return 'Inchis';
binary_sensor.g7_s1:
templates:
icon: >
if (state === 'on') return 'mdi:motion-sensor';
return 'mdi:human-male';
icon_color: >
if (state === 'on') return 'rgb(255, 0, 0)';
return 'rgb(0, 171, 0)';
state: if (state ==='on') return 'MISCARE'; else return 'Liniste';
switch.g20_i2:
friendly_name: Kitchen kettle
icon: mdi:kettle
Have you restarted homeassistant since adding the line to configuration.yaml?
tmkmarius
(Marius T.)
December 17, 2020, 8:09pm
7
I restarted it over 10 times.
I know how to set it up, I’ve done it before. But now it just doesn’t work.
tmkmarius
(Marius T.)
December 18, 2020, 9:07am
8
I don’t know what else to do.
tmkmarius
(Marius T.)
December 19, 2020, 11:21am
9
What else can I do?
I’m going crazy …
henrikbjorn
(Henrik Bjørnskov)
December 19, 2020, 11:29am
10
According to this, the above is not valid yaml https://codebeautify.org/yaml-validator
Have you tried the “check config” button?
Tagging @Mariusthvdb here as he’s the maintainer of custom UI
If anything for this to work you need custom_ui installed.
Did you do that ? If so, please show the inspector console showing that, or the config/info page, I ask because your post doesn’t show the latest version.
Second to that, not having checked all your templates but please don’t customize States. That is very dangerous, because it interferes with the Ha state machine, and will cause more confusion than profit.
switch.g16_i1:
templates:
icon: >
if (state == 'on') return 'mdi:window-open-variant';
return 'mdi:window-closed-variant';
icon_color: >
if (state == 'on') return 'rgb(255, 0, 0)';
return 'rgb(0, 0, 0)';
binary_sensor.g7_s1:
templates:
icon: >
if (state == 'on') return 'mdi:motion-sensor';
return 'mdi:human-male';
icon_color: >
if (state == 'on') return 'rgb(255, 0, 0)';
return 'rgb(0, 171, 0)';
switch.g20_i2:
friendly_name: Kitchen kettle
icon: mdi:kettle
this should work
tmkmarius
(Marius T.)
December 19, 2020, 2:23pm
13
Thank you very much everybody!
The problem is that HA does not read the “customize.yaml” file.
On another IP, everything works, including CusomUI.
are you preceding the templates with:
homeassistant:
customize:
?
either do this in a package, or, via configuration.yaml, where you point the config to the correct customize.yaml
tmkmarius:
I will try.
no need to try the config checker, you need to correct your yaml… and, point the configuration to the correct location, so it can find it
this isn’t necessary either, simply reload the customizations, via the left side configuration menu /server controls/reload location & customizations
sometimes a clear cache and reload page helps, but this should suffice
tmkmarius
(Marius T.)
December 19, 2020, 2:34pm
16
In configuration.yaml I have:
homeassistant:
customize: !include customize.yaml
And if I have something simple in customize.yaml it doesn’t work, for example:
switch.g16_i1:
friendly_name: pii kettle
icon: mdi:kettle
tmkmarius
(Marius T.)
December 19, 2020, 2:40pm
17
Thanks @ Mariusthvdb
Everything works on another IP.
In the meantime I found out about reload the customizations.
I also cleared the cache.
Ok but this doesn’t require custom_ui, and is a matter of regular (core) customization as @Tinkerer posted above.
custom_ui is needed when you start templating, or when you need icon_color.
btw, where did you save the customize.yaml? it should be in the config folder, using the !include you do now.
tmkmarius
(Marius T.)
December 19, 2020, 2:56pm
19
customize.yaml is in the configuration folder.
cusiom_ui …
I wanted to use custom_ui … and so I found that whatever is in customize.yaml does not work
seems alright…
please delete all custom_ui files and download the latest version. (It is needed to hide the more-info attributes)
Also, you don’t happen to have files left of the older custom_ui, or the customizer for that matter? They should all be deleted from your config.