I can confirm that replacing
Object.assign(this._icon.style,{color:s.attributes.icon_color,filter:""})
with
this._showIcon=true,this._iconStyle={color:s.attributes.icon_color}
fixes the issue and my icons have color again!
I can confirm that replacing
Object.assign(this._icon.style,{color:s.attributes.icon_color,filter:""})
with
this._showIcon=true,this._iconStyle={color:s.attributes.icon_color}
fixes the issue and my icons have color again!
I made the change in state-card-custom-ui.html but the color change didnāt work.
What else should I do?
take out the state:
template. that will lead to unexpected, and/or undesired effects.
if you change the actual state, (which is what this does) the template above it wonāt work anymore, since you have them evaluate āonā and āoffāā¦
you will have to wait until we manage to re-introduce _stateDisplay
or, use template-entity-row to make it show whatever you want.
and yes, follow GitHub - Mariusthvdb/custom-ui: Add templates and icon_color to Home Assistant UI.
Refresh cache ā¦
Works
THX
To help myself out (and others trying to work out how to have an icon colour change on state):
Iām running Home Assistant (previously called hassio on a pi. After hours of trying to work out what to do reading forum posts, finding Custom-UI got broken, then fixed, the broken etc and running round in circles. Should we use the HACS plugin youāve linked instead of the normal copy files and edit configuration.yaml chaos?
Also have a look here:
either or.
If you are starting from scratch, https://github.com/Mariusthvdb/custom-ui is clearer as it is up to date with the way lovelace works today
If you have HACS installed, all you need to do is add https://github.com/Mariusthvdb/custom-ui as custom repository
Yeah Iām currently conversing with the creator in an issue on his github trying to get it installed, as his instructions definitely donāt work for me (and probably others)
It looks like heās annoyed by my noobness and just giving me the old ācheck the docsā lines, despite me going to quite thorough lengths to document my steps with text and screenshots (standard for forums though, so I donāt mind ).
Can you provide any insight as to where Iām going wrong?
As I was trying to explain some basic stuff for you on the repo, and youāve now taken it to this fine community, it might be wise to focus on 1 place, so Iāll close the issue in the repo then ok?
continue here.
I look forward to someone helping me, and it helping you to improve the installation instructions to help others too
thanks for chiming in!
this wont help though, question is about icon_color
, not icon
based on state. Thereās but 1 way to do that globally (Lovelace of course allows styling of Icon and its color, but only per entity or per card) and that is using custom-ui, which adds the attribute icon_color
.
Okey, i then misunderstood the question
sure, thatās always on my mind, improve HA keep us informed about your ongoings.
Nothing has really changed this end. Iāve gone over your instructions multiple times, tried a new install of HA on a spare pie, and even had a Linux savvy friend team viewer into my computer to try and help.
All roads lead to your documentation missing something critical. And given the extensive screenshots I posted in the issue on your GitHub, Iām quite surprised you canāt instantly diagnose the issue. Although my instincts tell me that you probably donāt want to.
Can anyone lend a hand to me and others like me?
That is quite disrespectful imho - itās not even his own component (originally). He was kind enough to research all the changes introduced in 110, even contacted other developers to help. I had 0 problems to install this and it works perfectly fine. So itās definitely user error!
Anyway, I will try to help you:
Otherwise, try to rename the folder to customui (no dash), change the resources to represent this and repeat above steps.
well yeah, thanks @M1ke, that would be my assessment too.
had another look at the āextensive screenshotsā, and seems the file size is wrong. My local file is 58 kb,
repo reports 56.6 kb
while sausages file is 10 times the size:
donāt know what happened there.
still trying to as you seeā¦ against better judgement, who knows. Maybe follow the docs, and not your instincts would be better after allā¦
Good catch - didnāt see that!
I tried to investigate how one could even get such a file size, here are my observations:
I made the mistake from point 3 far too often when I started so I gave it a try, but doesnāt seem to be the case.
So @dave_sausages, the solution will be re-install it. Please follow these steps:
OR, as you have hacs installed,
HACS->FrontEnd, select the three dots/hamburger/right top menu button ā custom repositories
enter https://github.com/Mariusthvdb/custom-ui
as a lovelace entry, click add
close the repositories window, and you should have a new CustomUI /New repository on the screen. Select install. wait a few seconds for it to download, and select install
( i had a couple of issues of two instances appearing here)
Now select the main configuration side menu->LoveLace Dashboards->Resources
and make sure you have /hacsfiles/custom-ui/custom-ui.js listed.
IF you donāt, add it as a javascript module.
Refresh page
Select developer tools side menu item ā info.
make sure you have somethign like
Custom UIs:
JS 20200528-adapted-for-HA110+
Aha! Nailed it! I did indeed make the mistake of a direct single file download and not download the whole project zip file and extract it from there. I did make the same mistake a long time ago too, but obviously enough time has passed for me to repeat it.
@Mariusthvdb do you have a ādonate a beer facilityā? I canāt see one on your repo. Having a nice looking Dashboard on my system because youāve ported Custom-ui is well worth a beer or two (when/if your local pub reopens after the Corona Pirates have gone).
Thanks
*edit and thanks to others as well that pointed out how to get the correct file size. That parts wasnāt needed by me as Iād already gone āOh! Iāve done that stupid github mistake againā, but Iām sure it will help others.