1) If I need to apply the styling in the options area of the auto-entities filter (or where else to put the card_mod section at?) and 2) How to access the icon.
Full tree is:
custom:vertical-stack-in-card
entities
custom:auto-entities
custom:bar-card
entity
icon
Hi I tried the method youāve mention but keep getting a YAML error. Any ideas?
The style works fine when in my code but I have it in for every card and want to tidy things up.
Thanks
Happy New Year everyone. Looking at the post here, I am trying to do the exact same thingā¦
If any of these temperature sensors are offline, I would like the temperature to show in red. For each of the sensors above, I have 2 items: (sensor.water_room_temp & sensor.water_room_offline)ā¦
sensor.water_room_offline gives me a 0 if itās online or a 1 if itās offline.
I read in that post that there are different ways to accomplish this however I would like to use card_mod and templates. I have played around with the syntax based on that thread but I just canāt seem to get it working.
Thanks so much in advance everyone and all the very best for a healthy, happy 2023!
Thank you for the reply. First post, got it. Link at the bottom, got it. That took me here. I wasnāt able to find the rest - Iām sorry.
The temperature (sensor.water_room_temp) color change is based on a completely different variable (sensor.water_room_offline). Do I need to define that variable like in this post or can I just reference it in an āifā statement?
Thank you very much for your time and patience with me @ Ildar_Gabdullin. You and RobC are such a huge help to this community and I am VERY appreciative. I was making things much more complicated then they needed to be. For anyone else that may be looking to do this, here is the final code that works greatā¦
entities:
- entity: sensor.water_room_temp
card_mod:
style:
hui-generic-entity-row:
$: |
.text-content:not(.info) {
color:
{% if is_state('sensor.water_room_offline', '1') %}
red
{% else %}
black
{% endif %}
;
}
- entity: sensor.pool_room_temp
card_mod:
style:
hui-generic-entity-row:
$: |
.text-content:not(.info) {
color:
{% if is_state('sensor.pool_room_offline', '1') %}
red
{% else %}
black
{% endif %}
;
}
- entity: sensor.bears_den_temp
card_mod:
style:
hui-generic-entity-row:
$: |
.text-content:not(.info) {
color:
{% if is_state('sensor.bears_den_offline', '1') %}
red
{% else %}
black
{% endif %}
;
}```
Using this example, also the entity name (āNetwork throughputā) is changed instead of only the value area.
I am applying this to an entities card inside a grid card.
Instead, one should use .text-content:not(.info):after and .text-content:not(.info) to exclude .info.
What I could not fix so far, is the entity value being aligned at the bottom (because of the invisible original value space above) which is looking quite ugly
ā Update: for this, using line-height: 0px; inside .text-content:not(.info) did the trick.
I need to change height of the weather card to be aligned with cards on the left and right.
To be more precise, I am able to adjust card height but not to have content adopted to the new size - top padding is not changed and bottom padding is broken, solution seems to me to decrease space between the icon and day or temperatures and precipitation .
So far use"
Instead of using box-shadow: none; for the ha-card, using border-width: 0px; seems to do the trick now. Hopefully I can just search + replace this in all my dashboards, otherwise doing this manually would easily take me 3 to 5 hours.
ā¦and nothing in the 2022.11: A heck of a release! - Home Assistant release notes to have a chance of discovering this before doing the update - or did I miss something? Is there maybe a dev corner or something?
oh my godā¦ iāve been chewing on this card.button-card-main for days now to change the size of the fontā¦ your post made my week. adding !important did the trick !!! thanks a million