Stack-In-Card: Drop-in replacement for vertical-stack-in-card

Hi @RomRider

Incompatibility with Home Assistant version .110

After upgrading to Home Assistant .110 today, all my cards that use Stack-in-Card (that are part of a vertical-stack) aren’t displaying correctly anymore. This also happens with horizontal-stacks too. This issue is very easy to reproduce.

The weird thing is that this issue doesn’t happen with my Android app or Windows Edge web browser (legacy).

I just reported this issue on the the Stack-In-Card Github repository.

I would appreciate any suggestions/workarounds for this issue other than reverting to an older version of Home Assistant or switching to a different web browser.

Thank you for your time.

It’s nice to say that it’s not working as expected anymore but you don’t explain what is not working for you :wink: I screenshot might help with some explanation of what you expect.

Windows 10 and Firefox:
In my case every cards using custom:vertical-stack-in-card as type do not appear…
until I use F5 to refresh the internet page.

If I close the browser window, and open again, cards disappear. Until F5, etc…

On Mobile App:
iPhone and iPad, some custom:vertical-stack-in-card are displayed but not all… I can’t discriminate cases…

No error in the log…

This is stack-in-card, not vertical-stack-in-card :slight_smile:

Oups sorry… :grin:

:tada::tada: Version 0.1.1 :tada::tada:

Bugfixes

  • Support for > 0.110 (Fix #8)

Not sure if this is a bug in stack-in-card or button-card or if I am missing something - I tried searching both threads but was hard to find anything specific, so thought I would ask here first.

If I use button-card with color_type: label-card within a stack-in-card, the label background is rendered in the chosen colour, and then fades out to the standard card colour (just once, it does NOT loop like the gif shows below!). If I remove the stack-in-card, it works as expected.

OK:

      - type: custom:button-card
        color_type: label-card
        color: rgb(129, 0, 0)
        name: Uptime & Updates

image

Not OK:

      - type: custom:stack-in-card
        mode: vertical
        cards:
          - type: custom:button-card
            color_type: label-card
            color: rgb(129, 0, 0)
            name: Uptime & Updates

stack-in-card

I’ve confirmed it does it with default theme as well.

EDIT: scrap that, I completely overlooked the keep option - all fixed now!

1 Like

Very nice card. Thank you.
I am having some trouble with the border setting
using this code:

          - type: custom:stack-in-card  ## SECOND VERTICAL STACK ----- TEMPERATURE : MEDIA PLAYER
            mode: vertical
            cards:                    
              - type: weather-forecast
                entity: xxxxxxxxx            ##### WEATHER FORECAST CARDS
                name: xxxxxxx
                style: |
                  ha-card {
                    color: white;
                    font-variant: small-caps;
                    border-top: 3px double grey;
                    border-bottom: 3px double grey;
                    height: 185px;
                  }
                  .card-header {
                    font-size: 23px;
                    color: white;
                    text-align: center;
                    }

the bottom border does not extend to the edge of the card
image

Any idea what I am doing wrong?

this is coming and going, but now on 0.111 the issue is fixed: somehow there are borders around my buttons in a stack-in-card using a horizontal stack,


and I cant get rid of them, please have a look what I could change in the code:

the card:

type: custom:stack-in-card
keep:
  background: true
cards:

  - type: custom:button-card
    name: Set Hue Outdoors sensitivity
    template: button_default_title_fixed

  - !include /config/lovelace/buttons/buttons_set_hue_outdoors_sensitivity.yaml

  - type: entities
    show_header_toggle: false
    entities:
      - input_select.select_hue_outdoors_motion_sensor
      - entity: script.set_hue_outdoors_sensitivity
        action_name: Set

the include:

type: horizontal-stack
cards:

  - type: custom:decluttering-card
    template: set_hue_outdoors_sensitivity
    variables:
      - option: 'Very low'
      - icon: mdi:numeric-0-box-multiple-outline
      - label: Very low

  - type: custom:decluttering-card
    template: set_hue_outdoors_sensitivity
    variables:
      - option: 'Low'
      - icon: mdi:numeric-1-box-multiple-outline
      - label: Low

  - type: custom:decluttering-card
    template: set_hue_outdoors_sensitivity
    variables:
      - option: 'Medium'
      - icon: mdi:numeric-2-box-multiple-outline
      - label: Medium

  - type: custom:decluttering-card
    template: set_hue_outdoors_sensitivity
    variables:
      - option: 'High'
      - icon: mdi:numeric-3-box-multiple-outline
      - label: High

  - type: custom:decluttering-card
    template: set_hue_outdoors_sensitivity
    variables:
      - option: 'Very high'
      - icon: mdi:numeric-4-box-multiple-outline
      - label: Very high

the decluttering template:

card:
  type: custom:button-card
  template: button_picture_script_small
  show_label: true
  size: 50%
  icon: '[[icon]]'
  label: '[[label]]'
  tap_action:
    action: call-service
    service: script.buttons_set_hue_outdoors_sensitivity
    service_data:
      option: '[[option]]'
  state:
    - operator: template
      value: >
        [[[
        return states['input_select.select_hue_outdoors_sensitivity'].state == '[[option]]'
        ]]]
      color: 'silver'
    - operator: default
      styles:
        background:
          - color: '#595959'
        name:
          - color: 'white'

and the button template finally:

button_picture_script_small:
  size: 70%
  show_state: false
  show_label: false
  show_name: true
  show_entity_picture: true
  color_type: card
  aspect_ratio: 1/1
  tap_action:
    action: none
    haptic: light
  hold_action:
    action: more-info
    haptic: success
  color: '#555B65'
  styles:
    name:
      - padding-left: 3px
      - font-weight: bold
      - font-family: Helvetica
      - font-size: 13px
      - color: 'lightgrey'

have the exact same issue on another stack-in-card with a horizontal-stack:

  - type: custom:hui-element
    card_type: horizontal-stack
    cards:
      - type: picture-entity
        style: |
          ha-card {
            animation: {% if is_state('persistent_notification.trash_notification', 'notifying') and
                               states('sensor.saver_trash_today') != 'Geen' %} blink 2s linear infinite;
                       {% else %} none
                       {% endif %}
            }
          @keyframes blink {
            100% {opacity: 0;}
            }

        entity: sensor.saver_trash_today
        name: Vandaag
        show_state: false
        state_image:
          'gft': /local/mijnafvalwijzer/gft.png
          'papier': /local/mijnafvalwijzer/papier.png
          'restafval': /local/mijnafvalwijzer/restafval.png
          'pbd': /local/mijnafvalwijzer/pbd.png
          'Geen': /local/mijnafvalwijzer/kliko_geen.png
      - type: picture-entity
        style: |
          ha-card {
            animation: {% if is_state('persistent_notification.trash_notification', 'notifying') and
                               states('sensor.saver_trash_tomorrow') != 'Geen' %} blink 2s linear infinite;
                       {% else %} none
                       {% endif %}
            }
          @keyframes blink {
            100% {opacity: 0;}
            }
        entity: sensor.saver_trash_tomorrow
        name: Morgen
        show_state: false
        state_image:
          'gft': /local/mijnafvalwijzer/gft.png
          'papier': /local/mijnafvalwijzer/papier.png
          'restafval': /local/mijnafvalwijzer/restafval.png
          'pbd': /local/mijnafvalwijzer/pbd.png
          'Geen': /local/mijnafvalwijzer/kliko_geen.png
      - type: picture-entity
        entity: sensor.saver_trash_day_after_tomorrow
        name: Overmorgen
        show_state: false
        state_image:
          'gft': /local/mijnafvalwijzer/gft.png
          'papier': /local/mijnafvalwijzer/papier.png
          'restafval': /local/mijnafvalwijzer/restafval.png
          'pbd': /local/mijnafvalwijzer/pbd.png
          'Geen': /local/mijnafvalwijzer/kliko_geen.png

showing like:

where before, these were flat and attached, no little corners, no shadow, nothing.

please have a look? thanks!

2 Likes

I just started using this to try and make an existing vertical stack look neater. Unfortunately it seems to be combining the background transparencies and ending up making things darker.

Original vertical stack (using GUI editor):
image

Code for stack-in-card:

cards:
  - card:
      entity: media_player.lounge_tv
      group: false
      hide:
        icon_state: false
        power_state: false
      icon: 'mdi:television'
      type: 'custom:mini-media-player'
    conditions:
      - entity: media_player.lounge_tv
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.onkyo_amp
      group: false
      hide:
        controls: true
        icon_state: false
        power_state: false
        progress: true
      icon: 'mdi:amplifier'
      type: 'custom:mini-media-player'
      volume_stateless: true
    conditions:
      - entity: media_player.onkyo_amp
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.everywhere
      group: false
      hide:
        icon_state: false
        power_state: false
      icon: 'mdi:speaker-wireless'
      type: 'custom:mini-media-player'
    conditions:
      - entity: media_player.everywhere
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.all_except_office
      group: false
      hide:
        icon_state: false
        power_state: false
      icon: 'mdi:speaker-wireless'
      type: 'custom:mini-media-player'
    conditions:
      - entity: media_player.all_except_office
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.house
      group: false
      hide:
        icon_state: false
        power_state: false
      icon: 'mdi:speaker-wireless'
      type: 'custom:mini-media-player'
    conditions:
      - entity: media_player.house
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.house_except_office
      group: false
      hide:
        icon_state: false
        power_state: false
      icon: 'mdi:speaker-wireless'
      type: 'custom:mini-media-player'
    conditions:
      - entity: media_player.house_except_office
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.lounge_and_office
      group: false
      hide:
        controls: true
        icon_state: false
        power_state: false
      icon: 'mdi:speaker-wireless'
      type: 'custom:mini-media-player'
    conditions:
      - entity: media_player.lounge_and_office
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.googlehome3019
      group: false
      hide:
        controls: true
        icon_state: false
        power_state: false
        progress: true
      icon: 'mdi:speaker-wireless'
      type: 'custom:mini-media-player'
    conditions:
      - entity: media_player.googlehome3019
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.lounge_speakers
      group: false
      hide:
        controls: true
        icon_state: false
        power_state: false
        progress: true
      icon: 'mdi:speaker-wireless'
      type: 'custom:mini-media-player'
    conditions:
      - entity: media_player.lounge_speakers
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.bedroom
      group: false
      hide:
        controls: true
        icon_state: false
        power_state: false
        progress: true
      icon: 'mdi:speaker-wireless'
      type: 'custom:mini-media-player'
    conditions:
      - entity: media_player.bedroom
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.googlehome0147
      group: false
      hide:
        controls: true
        icon_state: false
        power_state: false
        progress: true
      icon: 'mdi:speaker-wireless'
      type: 'custom:mini-media-player'
    conditions:
      - entity: media_player.googlehome0147
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.googlehome2136
      group: false
      hide:
        controls: true
        icon_state: false
        power_state: false
        progress: true
      icon: 'mdi:speaker-wireless'
      type: 'custom:mini-media-player'
    conditions:
      - entity: media_player.googlehome2136
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.chromecastaudio8002
      group: false
      hide:
        controls: true
        icon_state: false
        power_state: false
        progress: true
      icon: 'mdi:speaker-wireless'
      type: 'custom:mini-media-player'
    conditions:
      - entity: media_player.chromecastaudio8002
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.alfresco_sony
      group: false
      hide:
        icon_state: false
        power_state: false
      icon: 'mdi:speaker-wireless'
      type: 'custom:mini-media-player'
      volume_stateless: true
    conditions:
      - entity: media_player.alfresco_sony
        state_not: 'off'
    type: conditional
mode: vertical
type: 'custom:stack-in-card'

Stack-in-card result:
image

Is there something I can do to prevent the card transparencies combining and going dark?

Hello,

i’m trying to make a card with a label and 2 buttons cards in one card. So i use stack-in-card but the color of the label don’t work.

When i set the color in de config editor i see the color for 1 second and then it is white again. Also when i save the card the label is still white.
This is what i want and what i see only for 1 second while configurating the card.

After 1 second it became like this:

What i’m doing wrong?

This is the code:

type: 'custom:stack-in-card'
cards:
  - type: vertical-stack
    cards:
      - type: 'custom:button-card'
        name: Music
        color: var(--disabled-text-color)
        color_type: card

Check the doc on github, but this should be the solution:

keep:
  background: true

Damn, it was that easy.
thank you!

Hello, please excuse my bad english.

Can I implement this compilation with the “Stack in card”? That I only have a framework for everything?

Did you try with group: true instead of false in each mini-media-player config?

Yes, just add a single stack-in-card around your current configuration.

I have tested that out and it only groups the media players closer together within the stack, but the cards still add there transparency / colour together to end up being darker than normal (as per my screenshots above)

EDIT: thank you! that actually works, I just needed to test it on a different lovelace page due to the background image

Hi. Is there any solution for this on the horizon? All my pages in the UI consist only of stack-in-cards and therefore the layout is completely messed up (all stacks display in only one column). Even layout-card cannot fix the problem. Would be nice to know if there will be a solution some time in the future, because otherwise I have to rework my UI and get rid of the stack-in-card (which would be a shame).
Thanks!

Yes there’s a solution but I need to find some time to update the card :blush: I’m quite busy lately…

1 Like

Great! Thanks for the quick reply. And take your time. Good to know that there is at least something on the horizon.

Is it possible to adjust the width on Stack-in-card ?
i place some button-card inside and i can’t adjust the width
thanks