-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2022.12 Colors changed #635
Comments
+1 |
After updating HA to 2022.12.0 there is a problem with the color "var(--button-card-light-color)" |
+1 |
I'll have a look over the weekend |
I have quickly added a template with a state and card background, so everyone is happy again in the house :-) |
+1 |
1 similar comment
+1 |
the new tile-cards in 2022.12 use the current color of the entity (e.g. color of light) But yes, the default should be grey for off and yellow for on. |
+1 but it does also relate to paper-buttons-row as well, so its a system wide thing, not just related to this custom card. |
@FlexxFR you definitely don't have a color specified for the on state of buttons still working? Mine were working where colour was specified, so I set colours for them all now. |
Yeah, that is a possibility, but when nothing is specified per state, it uses the default stated on top of the config: color: auto |
while checking the dashboard with inspector in chrome - it looks like FYI: "active" yellow color was #fdd835, rgb(253,216,53) |
my quick'n'dirty fix - add this to your resources:
then, create file /www/custom/custom_style.css and insert this inside:
reboot HA, clear browser cache, profit! active icons are now yellow :) also: you can add any css style there to override/expand your config without fiddling with themes and other options. |
Any updates on this? Seems the problem lies in HA itself, this is part of an "improvement" made to December release, without listing it as a "Breaking Change". Since this change I cannot find a way to have the card color change in relation to a light's light level. Did all the colors go static? Grrr. I just got my dashboard looking the way I wanted last month, and now I may have to start over? Grrr.... https://community.home-assistant.io/t/i-dislike-the-2022-12-color-changes/499890 |
@antisane, how could it be listed as a breaking change, this is a third party integration and not part of Home Assistant? Entity state color change was listed as a notable breaking change for developers, which covers this issue. Have you tried the fix above by @pejotigrek? It should keep things right until this integration is updated by it's maintainer. |
Given the (big) change in HA, it's going to take a bit more time than expected, but I'll fix it. old_colors:
styles:
card:
- '--state-icon-active-color': '#fdd835'
- '--paper-item-icon-active-color': var(--state-icon-active) Or use @pejotigrek's solution |
@pejotigrek I tried what you said above and mine are still broken. Was this changed again in 2022.12.6 or maybe I did something incorrectly? |
@bschatzow I didn't updated to .6 yet, so can't tell if they changed something again, so maybe double check your config? spaces in css file are not as important as in yaml, but quotes, commas, brackets, colons and semicolons are. also make sure the path you've added to resources is correct. |
@pejotigrek I did the way you post here and it works fine with 2022.12.4. @bschatzow try this way: you can just unpack and paste this file: then from GUI -> settings -> dashboards -> three dots -> resources add new resorce: /local/custom/custom_style.css?v=1 select style sheet sorry everything is in Polish, but you should be able to find the right options ;-) |
Thank you for taking the time to show this. I have this already and my file is identical to yours. I modified the resource file to load the file. It must be something else I am doing incorrectly. I did a restart of HA. Do you need to reboot the device? |
restart HA again, then try to open with other browser or in inkognito mode, to be sure, it has nothing to do with cache, if this not helped, then you really need someone who is more experienced in this subject :) |
@gryzli133 in my case it was always the cache, when speaking about resource files [js, css etc.]. so that would be the first place to look at. @bschatzow in the resource path try to change ?v=1 at the end of the line to something else, like ?v=2 [it suggests that "something changed in the url" and should force browser to read the file again, not from the cache]. second thing - if you're using chrome browser at desktop, open inspector [ctrl-shift-i] and it will "unlock" special options for refresh - after inspector is opened, right-click on the "refresh page" button, menu should popup, choose last option [something like "clear cache and force refresh", but I can't remember how it goes originally]. that should delete cache for displayed page and re-read all resources. I'm not sure if it's the same in other browsers. |
I see it the same on all of my devices. I cleared cache on all. Incognito mode was no difference. I'll check again when I get home to see if the url is loading correctly in chrome. Is there an a change to the individual card that I can make to force the on state color? |
yes, use the solution @RomRider provided in the above comment - this is via button-card template, but you can omit the template and just add style definition to the card itself. EDIT: also check here you can add colors based on state |
Thanks. For some reason the css file is not loading in chrome. Says not found. (mwc-list-item-base.ts:224 GET https://xxxxxx.duckdns.org:8123/local/custom/custom_style.css?v=1 net::ERR_ABORTED 404 (Not Found)) Not sure how as it is in the local directory. Windows sees it, but for some reason chrome can't find it. This is the error in the chrome console:
Still not yellow. |
Still didn't get css to load. With the help of @ildar Gabdullin I was able to get the yellow working again.
|
Took me a while to understand you need to have your account in advanced mode to be able to have the 3dots menu on top right of dashboard settings... |
adding to this particular issue on that variable, Id like to report that where this example:
no more shows a border top on those lights, and
seems to somewhat mitigate that. so, its a backup, but not replacement |
I found the "bug" in the card itself, at least for my use case. It's in button-card.ts in the Those are using the
and The problem is, officially, HA says they only support --primary-color and --accent-color (https://www.home-assistant.io/integrations/frontend/), the ha-style.ts file in the repo lists others, and as of 2022.12, different device types have different CSS vars, but I'm not sure what the "equivalent" replacement is for |
Thank you for the workaround @RomRider and for your GREAT work at all! old_colors:
styles:
card:
- '--state-icon-active-color': '#fdd835'
- '--paper-item-icon-active-color': var(--state-icon-active-color) |
This template no longer works as expected:
The icon changes colour for binary sensors but not device trackers or the alarm panel. The state label does not change colour for any entity. |
shouldnt those at least be
? its surprising the one obvious error in your theming variables does not appear to prevent the binary's from changing color.. testing that, I can confirm:
to be effective contrary to
which does not work correctly. That is to say, it defaults to the system settings... on the label: you don't mention it or adding:
to the card works just fine, where without that, it again sets the system default |
Thanks, yeah that was a copy/paste mistake. Fortunately in only one template - the one I copied here. Unfortunately changing it to an underscore does not help. The icon changes colour for binary sensors but not device trackers or the alarm panel. The state label does not change colour for any entity. |
it's the javascript: Changing this:
to
Does change the state text colour. |
what if you use includes(value), like:
it's the technique I use in my js templates mostly, maybe give it a try?
|
So like this?
No change. |
how odd, might be something more going on.
if that wont work, I guess we need to see the complete card ;-) |
|
hmm, quick read does make me wonder about the color stylings you use both in the generic section under don't these |
No, other way around. At least it used to. I also tried removing the |
does the template not return the wrong output for a state value? I mean, it would return True or False, and not the actual value..? this works:
as does:
test card:
note I dont use |
Yes! That works. Thanks Marius. |
on the other syntax: that requires the extra line
|
Same problem still code:
I can use fixed colors as described above, but than they do not change with the brightness % |
## [4.0.0-dev.1](v3.5.0...v4.0.0-dev.1) (2023-07-23) ### ⚠ BREAKING CHANGES * this might break some of your color settings ### Bug Fixes * Color are now aligned with HA > 2022.12 ([685d55e](685d55e)), closes [#635](#635) * localization fix ([02dfab3](02dfab3)), closes [#685](#685) [#693](#693) * lock icon was displaying over more-info dialog ([bf075b0](bf075b0)), closes [#694](#694) * lock would go out of the button ([0b3e4d3](0b3e4d3))
🎉 This issue has been resolved in version 4.0.0-dev.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
## [4.0.0](v3.5.0...v4.0.0) (2023-07-29) ### ⚠ BREAKING CHANGES * **helpers:** If you were using any of the beta before `4.0.0-dev14`. Please replace all the calls to helper functions with `helpers.xxx` for eg. `helpers.relativeTime(entity.state)` or `helpers.localize(entity)` * **hacs:** Minimum required HA Version is now 2023.7 * **actions:** Requires HA 2023.4 minimum. Support for the new action format (`target` is also be supported), `service_data` should be renamed to `data` (but it still works with the old format) * **icons:** This might break your card-mod setup * this might break some of your color settings ### Features * **action:** `repeat_limit` for `hold_action` ([73c216f](73c216f)), closes [#564](#564) [#555](#555) * **actions:** Support for the new action (assist) and all the future ones ([d9c17a4](d9c17a4)), closes [#711](#711) [#685](#685) * **custom_fields:** Add `do_not_eval` to stop evaluating js templates in an embedded card ([1638cf8](1638cf8)) * **helpers:** all template functions are now available through the `helpers` object ([f22ed69](f22ed69)) * **icons:** replace ha-icon with ha-state-icon to follow new HA's icons per domain automatically ([ab6a3f5](ab6a3f5)) * **templates:** new `relativeTime` function to display a relative time in a template and update it automatically ([965a3d7](965a3d7)), closes [#701](#701) * **templates:** New date and time format helpers ([9b4fb05](9b4fb05)) * **variables:** A variable can depend on another variable based on their name's alphabetical order ([8cddccb](8cddccb)), closes [#656](#656) * Force the `numeric_precision` for states which are numbers ([24d75c2](24d75c2)) * new helper functions for date/time in templates ([2b75993](2b75993)), closes [#701](#701) * Support for localization in templates ([5de2dc9](5de2dc9)) ### Bug Fixes * *_action more-info entity as a template was not evaluated ([02441b2](02441b2)), closes [#734](#734) * `group_expand` now works even if the entity is not a `group.xxx` ([f192ded](f192ded)), closes [#645](#645) * Color are now aligned with HA > 2022.12 ([685d55e](685d55e)), closes [#635](#635) * custom fields would sometime throw unsafeHTML errors ([c67e1d5](c67e1d5)), closes [#725](#725) * ha-icon (if in custom_fields) size was weird ([a448c8e](a448c8e)) * ha-state-icon CSS selector was wrong ([a1bb39a](a1bb39a)) * icon would be cut with card height defined ([19f8393](19f8393)), closes [#731](#731) * localization fix ([02dfab3](02dfab3)), closes [#685](#685) [#693](#693) * lock icon was displaying over more-info dialog ([bf075b0](bf075b0)), closes [#694](#694) * lock would go out of the button ([0b3e4d3](0b3e4d3)) * non string fiels would error with an unsafeHTML error ([d65c347](d65c347)), closes [#725](#725) * numerical states would not follow HA's format ([72d7c41](72d7c41)), closes [#662](#662) * optimize contrast color compute ([35109c3](35109c3)) * relativeTime didn't support to set the first letter uppercase ([f8b9b09](f8b9b09)), closes [#735](#735) * Some cards with child cards wouldn't be clickable ([9f21c58](9f21c58)) * text/icon contrast when using label-card ([01e199b](01e199b)) * variable which were objects were only evaluated once ([e40bda9](e40bda9)) * **templates:** `variables` was `undefined` if none where provided. ([fad332b](fad332b)), closes [#718](#718) * tooltip would show over everything ([1bc8f99](1bc8f99)) * **color:** main config `color` was broken ([b93c996](b93c996)) * **hacs:** minimum HA version 2023.7 ([db3b394](db3b394)) * **templates:** don't use the `numeric_precision` from the card config for `localize` in js templates by default ([2cc384f](2cc384f))
🎉 This issue has been resolved in version 4.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Checklist
Describe the bug
Inactive button became blue instead of grey.
Active button became black (day mode) or white (night mode) instead of yellow.
Version of the card
Version: 3.4.2
Same with desktop firefox or android companion.
The text was updated successfully, but these errors were encountered: