I think you mean this? Showing the generic section of the mod is applied, and the detailed per entity section is not:
full code is this
HA card
type: entities
card_mod:
style:
hui-sensor-entity-row:
$: |
hui-generic-entity-row {
height: 25px;
padding: 0px 16px;
border-radius: var(--ha-card-border-radius);
border: 1px groove var(--primary-color);
}
.: |
.card-content {
background:
{% set dark = is_state('binary_sensor.donker_thema','on') %}
{% if not dark %} var(--ha-color)
{% endif %};
}
ha-card {
color: white;
--card-mod-icon-color: white;
--mdc-icon-size: 20px;
font-weight: bold;
}
entities:
- type: custom:hui-element
card_type: vertical-stack # required because hui-element does not support visibility
cards:
- visibility:
- condition: state
entity: binary_sensor.donker_thema
state: 'on'
image: /local/home-assistant/home-assistant-wordmark-color-on-dark.png
<<: &picture
type: picture
entity: device_tracker.ha_main
card_mod:
style: |
ha-card {
box-shadow: none;
background:
{% set dark = is_state('binary_sensor.donker_thema','on') %}
{% if not dark %} var(--ha-color)
{% endif %};
}
tap_action:
action: more-info
hold_action:
action: navigate
navigation_path: /config/system
- visibility:
- condition: state
entity: binary_sensor.donker_thema
state: 'off'
image: /local/home-assistant/home-assistant-wordmark-monochrome-on-dark.png
<<: *picture
- entity: sensor.last_boot
format: datetime
card_mod:
style: |
hui-generic-entity-row {
border: none !important;
}
- entity: sensor.processor_use
name: Cpu
card_mod: &perc
style: |
hui-generic-entity-row {
background:
{% set perc = states(config.entity)|float(0) %}
/*{% set rest = 100 - perc %}*/
{% if perc >= 59 %} {% set bar = '255,0,0' %}
{% elif perc >= 44 %} {% set bar = '128,0 0' %}
{% elif perc >= 24 %} {% set bar = '255,165,0' %}
{% elif perc >= 9 %} {% set bar = '0,100,0' %}
{% else %} {% set bar = '0,128,0' %}
{% endif %}
/*linear-gradient(to left,ivory {{rest}}%, {{bar}} {{perc}}%);*/
linear-gradient(to right, rgb({{bar}},0.9) 0%, rgb({{bar}},0.6) {{perc}}%,
rgba({{bar}},0.3){{perc}}%, rgba({{bar}},0.1) 100%);
}
- entity: sensor.processor_temperature
name: Temp
card_mod:
style: |
hui-generic-entity-row {
background:
{% set temp = states(config.entity)|float(0) %}
/*{% set rest = 100 - temp %}*/
{% if temp >= 85 %} {% set bar = '255,0,0' %}
{% elif temp >= 75 %} {% set bar = '128,0,0' %}
{% elif temp >= 65 %} {% set bar = '255,99,71' %}
{% elif temp >= 55 %} {% set bar = '255,69,0' %}
{% elif temp >= 45 %} {% set bar = '255,140,0' %}
{% elif temp >= 35 %} {% set bar = '255,165,0' %}
{% else %} {% set bar = '0,128,0' %}
{% endif %}
/*linear-gradient(to left,ivory {{rest}}%, {{bar}} {{temp}}%);*/
linear-gradient(to right, rgba({{bar}},0.9) 0%, rgba({{bar}},0.9) {{temp}}%,
rgba({{bar}},0.6){{temp}}%, rgba({{bar}},0.2) 100%);
}
- entity: sensor.memory_use_percent
name: Memory
card_mod:
style: |
hui-generic-entity-row {
background:
{% set perc = states(config.entity)|float(0) %}
/*{% set rest = 100 - perc %}*/
{% if perc >= 85 %} {% set bar = '255,0,0' %}
{% elif perc >= 75 %} {% set bar = '128,0,0' %}
{% elif perc >= 60 %} {% set bar = '255,165,0' %}
{% elif perc >= 50 %} {% set bar = '165,42,42' %}
{% else %} {% set bar = '0,128,0' %}
{% endif %}
/*linear-gradient(to left,ivory {{rest}}%, {{bar}} {{perc}}%);*/
linear-gradient(to right, rgba({{bar}},0.9) 0%, rgb({{bar}},0.9) {{perc}}%,
rgba({{bar}},0.6){{perc}}%, rgba({{bar}},0.2) 100%);
}
- entity: sensor.disk_use_percent_home
name: Disk
card_mod: *perc
- entity: sensor.swap_use_percent
name: Swap
card_mod:
style: |
hui-generic-entity-row {
background:
{% set swap = states(config.entity)|float(0) %}
/*{% set rest = 1000 - swap %}*/
/*{% set factor = 0.06 %}*/
{% if swap >= 768 %} {% set bar = '255,0,0' %}
{% elif swap >= 640 %} {% set bar = '255,215,0' %}
{% else %} {% set bar = '50,205,50' %}
{% endif %}
/*linear-gradient(to left,ivory {{rest*factor}}%, {{bar}} {{swap*factor}}%);*/
linear-gradient(to right, rgba({{bar}},0.9) 0%, rgba({{bar}},0.9) {{swap}}%,
rgba({{bar}},0.1){{swap}}%, rgba({{bar}},0.1) 100%);
}
current result (all is applied except the background color):