lovelace-card-mod: HA Update 2024.7.2 card_mod no longer seems to work properly

My Home Assistant version: 2024.7.2

My lovelace configuration method (GUI or yaml): both

What I am doing: See yaml code and image

What I expected to happen: see picture 1

What happened instead: see picture 2

# The least amount of code possible to reproduce my error

type: custom:stack-in-card
mode: horizontal
cards:
  - type: custom:stack-in-card
    cards:
      - type: custom:mushroom-template-card
        primary: Wohnzimmer
        secondary: >-
          🌡️ {{ states('sensor.thermometer_wohnzimmer_temperature') }}ºC    💧
          {{ states('sensor.thermometer_wohnzimmer_humidity') }}%
        icon: mdi:sofa-outline
        entity: sensor.thermometer_wohnzimmer_temperature
        multiline_secondary: true
        tap_action:
          action: none
        hold_action:
          action: none
        double_tap_action:
          action: none
        icon_color: blue
        fill_container: true
        layout: horizontal
        card_mod:
          style: |
            :host([dark-mode]) {
              background: rgba(var(--rgb-primary-background-color), 0.2);
            } 
            :host {
              background: rgba(var(--rgb-primary-text-color), 0.025);
              --mush-icon-size: 76px;
              height: 60px;
              margin-left: -20px !important;
            }
            ha-card {
              border-width: 0px;
              box-shadow: 0px 0px;
            }        
      - type: custom:mushroom-chips-card
        chips:
          - type: template
            entity: sensor.thermometer_wohnzimmer_battery
            icon: |2-
               {% set level = states(entity) | int(0)%}
               {% if level >= 90 %}
               mdi:battery-90
              {% else %}
               {% set level = states(entity) | int(0)%}
               {% if level >= 80 %}
                mdi:battery-80
               {% elif level >= 70 %}
                mdi:battery-70
               {% elif level >= 60 %}
                mdi:battery-60
               {% elif level >= 50 %}
                mdi:battery-50
               {% elif level >= 40 %}
                mdi:battery-40
               {% elif level >= 30 %}
                mdi:battery-30
               {% elif level >= 20 %}
                mdi:battery-20
               {% elif level >= 10 %}
                mdi:battery-10
               {% else %}
                mdi:battery-sync-outline
               {% endif %}
              {% endif %}
            icon_color: |-
              {% set level = states(entity) | int(0) %}
              {% if level >= 16 %}
                green
              {% elif level >= 15 %}
                yellow
              {% else %}
                red
              {% endif %}
          - type: template
            entity: light.wohnzimmer
            icon: |-
              {% if is_state(entity, 'on') %}
              mdi:lightbulb-on-outline
              {% else %}
              mdi:lightbulb-off-outline
              {% endif %}
            icon_color: |-
              {% if is_state(entity, 'on') %}
              yellow
              {% else %}
              green
              {% endif %}
            tap_action:
              action: toggle
            hold_action:
              action: more-info
            double_tap_action:
              action: none
          - type: template
            entity: input_boolean.schalter_wz_lichtautomatik
            icon: >-
              {% if is_state(entity, 'on')%}  mdi:lightbulb-auto  {% else %} 
              mdi:lightbulb-auto-outline  {%endif %}
            icon_color: >-
              {% if is_state(entity, 'on')%}  green  {% else %}  red  {% endif
              %}
            tap_action:
              action: toggle
            hold_action:
              action: none
            double_tap_action:
              action: none
          - type: template
            entity: cover.rollos_wohnzimmer
            icon: |-
              {% if is_state(entity, 'open') %}
              mdi:window-shutter-open
              {% else %}
              mdi:window-shutter
              {% endif %}
            icon_color: |-
              {% if is_state(entity, 'on') %}
              yellow
              {% else %}
              green
              {% endif %}
            tap_action:
              action: call-service
              service: browser_mod.popup
              target:
                device_id:
                  - 2b05e0fe48bf4
                  - a31f93115626a
              data:
                dismissable: true
                autoclose: false
                content:
                  type: vertical-stack
                  cards:
                    - features:
                        - type: cover-open-close
                      type: tile
                      entity: cover.rollo_wohnzimmerfenster
                      name: Wohnzimmerfenster
                      show_entity_picture: false
                      hide_state: false
                      vertical: true
                    - features:
                        - type: cover-open-close
                      type: tile
                      entity: cover.rollo_wohnzimmer_tur_links
                      name: Wohnzimmertür links
                      show_entity_picture: false
                      hide_state: false
                      vertical: true
                    - features:
                        - type: cover-open-close
                      type: tile
                      entity: cover.rollo_wohnzimmer_tur_rechts
                      name: Wohnzimmertür rechts
                      show_entity_picture: false
                      hide_state: false
                      vertical: true
                timeout: 60000
                title: Rollos Wohnzimmer
            hold_action:
              action: more-info
            double_tap_action:
              action: none
          - type: template
            entity: remote.wohnzimmer
            icon: |-
              {% if is_state(entity, 'on') %}
              mdi:television-classic
              {% else %}
              mdi:television-classic-off
              {% endif %}
            icon_color: |-
              {% if is_state(entity, 'on') %}
              yellow
              {% else %}
              green
              {% endif %}
            tap_action:
              action: toggle
            hold_action:
              action: more-info
            double_tap_action:
              action: none
          - type: template
            entity: sensor.ps5_679_activity
            icon: |-
              {% if is_state(entity, 'on') %}
              fab:playstation
              {% else %}
              fab:playstation
              {% endif %}
            icon_color: |-
              {% if is_state(entity, 'on') %}
              yellow
              {% else %}
              green
              {% endif %}
            tap_action:
              action: toggle
            hold_action:
              action: more-info
            double_tap_action:
              action: none
        alignment: left
        card_mod:
          style: |
            ha-card {
              --chip-border-width: 0px;
              --chip-box-shadow: none;
              --chip-background: none;
              padding: 0px 10px 0px 0px;
            } 
    card_mod:
      style: |
        ha-card {
          height: 102px;
          border-width: 0px;
          box-shadow: 0px 0px;
        }
card_mod:
  style: |
    ha-card { 
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none;
    }


# End of code

picture 1: 1

picture 2: 2

Image 1 is before the update to HA 2024.7.2 and image 2 is after the update

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 1
  • Comments: 19 (2 by maintainers)

Most upvoted comments

This issue is open since 2 weeks. It would be nice if this could be fixed sometime as everyones dashboard is messed up due to this bug 😦

This is not about shutting you down - this is about

  • not opening an issue considering it as a bug - which is a “wrong use by a user” instead
  • moving a discussion to a proper place - Community.

I also ruled out the card mod here.

And yet you keep breaking all Github/Home Assistant conventions, and again post in the card-mod repo…

Hi,

So here is the code of my cards:


type: custom:stack-in-card
cards:
  - type: custom:mushroom-chips-card
    chips:
      - type: spacer
      - type: template
        content_info: none
        tap_action:
          action: navigate
          navigation_path: cave-batteries
        icon: >
          {% if [states('sensor.cave_battery') | float] | select('lt', 10) |
          list | count > 0 %} mdi:battery-20 {% elif
          [states('sensor.cave_battery') | float] | select('lt', 20) | list |
          count > 0 %} mdi:battery-50   {% else %} mdi:battery {% endif %}
        icon_color: >
          {% if [states('sensor.cave_battery') | float] | select('lt', 10) |
          list | count > 0 %} red  {% elif [states('sensor.cave_battery') |
          float] | select('lt', 20) | list | count > 0 %} orange {% else %} grey
          {% endif %}
    alignment: end
    card_mod:
      style:
        .: |
          ha-card {
            --chip-spacing: 0;
            --chip-border-width: 0;
            --chip-background: none;
            margin-right: 6px;
            height: 25px;
          }
  - type: custom:mushroom-template-card
    primary: Cave
    tap_action:
      action: navigate
      navigation_path: cave
    secondary: >
      {{ states("sensor.cave_temperature") | round(1, default=0) }}°C | {{
      states("sensor.cave_humidity") | round(1) }}% | {{
      (states("sensor.prise_boiler_power") | float | round(1) ) | round(1) }}Wh
    icon: mdi:home-floor-negative-1
    icon_color: blue
    fill_container: true
    layout: horizontal
    multiline_secondary: false
    card_mod:
      style: |
        ha-card {
          --chip-spacing: 0;
          --chip-border-width: 0;
          --chip-background: none;
          --ha-card-border-width: 0;
          margin-left: -25px;
          margin-top: -55px;
        }
        :host
        {
          --mush-icon-size: 72px;
        }
  - type: custom:mushroom-chips-card
    chips:
      - type: template
        entity: switch.prise_boiler
        content_info: none
        tap_action:
          action: more-info
        icon: mdi:water-boiler
        icon_color: |
          {% if is_state('switch.prise_boiler', 'on') %}
            blue
          {% else %}
            grey
          {% endif %}
      - type: spacer
    alignment: end
    card_mod:
      style: |
        ha-card {
          --chip-spacing: 0;
          --chip-border-width: 0;
          --chip-background: none;
          margin-right: 6px;
          margin-top: -25px;
        }
card_mod:
  style: |
    ha-card {
      background: rgba(25, 25, 25, 0.1);
    }

Which gives this: image

This is a simple ones, but it follows the card the author showed at first. I removed a lot of unused CSS that I had, and the margins are a lot of different. There was also some fideling with the “:host” and “ha-card”. Not sure what it relates to, but it had an impact. I hope this can help.

  • Then all the CSS broke with just updating to 2024.7

this is just plain nonsense, why do you say that. Could be that 1 or 2 mods you use on a tile card now need adaptation.

stating all CSS broke has no foundation at all. again, this non-Issue needs to be closed, and support questions should go to the community.

As long as you dont do that, you wont get help, because this is not the place for that

same here